CSIT-465: Common test setup and teardown
[csit.git] / tests / func / vlan / qinq_l2_xconnect.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Resource | resources/libraries/robot/default.robot
16 | Resource | resources/libraries/robot/testing_path.robot
17 | Resource | resources/libraries/robot/tagging.robot
18 | Resource | resources/libraries/robot/l2_traffic.robot
19 | Library  | resources.libraries.python.Trace
20 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | HW_ENV | VM_ENV
21 | Test Setup | Func Test Setup
22 | Test Teardown | Func Test Teardown
23 | Documentation | *L2 cross-connect with QinQ test cases*
24 | ...
25 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology with
26 | ... | single links between nodes.
27 | ... | *[Enc] Packet encapsulations:* Eth-dot1ad-IPv4-ICMPv4 on DUT1-DUT2,
28 | ... | Eth-IPv4-ICMPv4 on TG-DUTn for L2 switching of IPv4.
29 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2
30 | ... | cross-connect (L2XC) switching with 802.1ad QinQ VLAN tag push and pop.
31 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are
32 | ... | sent in both directions by TG on links to DUT1 and DUT2; on receive TG
33 | ... | verifies packets for correctness and their IPv4 src-addr, dst-addr and
34 | ... | MAC addresses.
35 | ... | *[Ref] Applicable standard specifications:* IEEE 802.1ad.
36
37 *** Variables ***
38 | ${subid}= | 10
39 | ${outer_vlan_id}= | 100
40 | ${inner_vlan_id}= | 200
41 | ${type_subif}= | two_tags
42 | ${tag_rewrite_method}= | pop-2
43
44 *** Test Cases ***
45 | TC01: DUT1 and DUT2 with L2XC and two VLAN push-pop switch ICMPv4 between two TG links
46 | | [Documentation]
47 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on \
48 | | ... | DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUTn. [Cfg] On DUT1 and DUT2
49 | | ... | configure L2 cross-connect (L2XC), each with one interface to TG
50 | | ... | and one Ethernet interface towards the other DUT; each DUT
51 | | ... | pushes two VLAN tags on packets received from local TG, and
52 | | ... | popping two VLAN tags on packets transmitted to local TG. [Ver]
53 | | ... | Make TG send ICMPv4 Echo Req in both directions between two of
54 | | ... | its interfaces to be switched by DUT1 and DUT2; verify all
55 | | ... | packets are received. [Ref] IEEE 802.1ad.
56 | | Given Path for 3-node testing is set
57 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
58 | | And Interfaces in 3-node path are up
59 | | When VLAN subinterfaces initialized on 3-node topology
60 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut2_node} | ${dut2_to_dut1} | ${subid}
61 | | ... | ${outer_vlan_id} | ${inner_vlan_id} | ${type_subif}
62 | | And L2 tag rewrite method setup on interfaces
63 | | ... | ${dut1_node} | ${subif_index_1} | ${dut2_node} | ${subif_index_2}
64 | | ... | ${tag_rewrite_method}
65 | | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect
66 | | ... | ${dut1_node} | ${dut1_to_tg} | ${subif_index_1}
67 | | ... | ${dut2_node} | ${dut2_to_tg} | ${subif_index_2}
68 | | Then Send and receive ICMP Packet
69 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}