Func test reorg - decrease exec time per vpp patch
[csit.git] / tests / func / vlan / eth2p-dot1ad--dot1q-l2xcbase-vlantrans21-func.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 | SKIP_VPP_PATCH
21 | Test Setup | Func Test Setup
22 | Test Teardown | Func Test Teardown
23 | Documentation | *L2XC with VLAN tag rewrite test cases - translate-2-1*
24 | ...
25 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology
26 | ... | with single links between nodes.
27 | ... | *[Enc] Packet encapsulations:* Eth-dot1ad-IPv4-ICMPv4 or
28 | ... | Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1, Eth-dot1q-IPv4-ICMPv4 or
29 | ... | Eth-dot1aq-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2
30 | ... | for L2 switching of IPv4/IPv6.
31 | ... | *[Cfg] DUT configuration:* DUT1 is configured with L2 cross-connect
32 | ... | (L2XC) switching between VLAN sub-interface with VLAN tag rewrite
33 | ... | translate-2-1 method of interface towards TG and interface towards DUT2.
34 | ... | DUT2 is configured configured with L2 cross-connect (L2XC) switching
35 | ... | between VLAN sub-interface with VLAN tag rewrite pop-1 method
36 | ... | of interface towards DUT1 and interface towards TG.
37 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are
38 | ... | sent from TG on link to DUT1 and received in TG on link form DUT2;
39 | ... | on receive TG verifies packets for correctness and their IPv4 src-addr,
40 | ... | dst-addr and MAC addresses.
41 | ... | *[Ref] Applicable standard specifications:* IEEE 802.1q, IEEE 802.1ad.
42
43 *** Variables ***
44 | ${subid}= | 10
45
46 | ${outer_vlan_id1}= | 110
47 | ${outer_vlan_id2}= | 120
48 | ${outer_vlan_wrong}= | 150
49
50 | ${inner_vlan_id1}= | 210
51
52 | ${src_ip}= | 3ffe:63::1
53 | ${dst_ip}= | 3ffe:63::2
54
55 *** Test Cases ***
56 | TC01: DUT1 and DUT2 with L2XC and VLAN translate-2-1 (DUT1) switch ICMPv4 between two TG links
57 | | [Documentation]
58 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1, \
59 | | ... | Eth-dot1q-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2.
60 | | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to
61 | | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite
62 | | ... | translate-2-1 method; on DUT2 configure L2 cross-connect (L2XC) with
63 | | ... | one interface to TG and one VLAN sub-interface towards DUT1 with
64 | | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv4 Echo Req
65 | | ... | tagged with Dot1ad tags from one of its interfaces to another one
66 | | ... | via DUT1 and DUT2; verify that packet is received.
67 | | ... | [Ref] IEEE 802.1q, IEEE 802.1ad
68 | | Given Path for 3-node testing is set
69 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
70 | | And Interfaces in 3-node path are up
71 | | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created
72 | | ... | ${dut1_node} | ${dut1_to_tg} | ${subid}
73 | | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1}
74 | | ... | type_subif=two_tags dot1ad
75 | | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created
76 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
77 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node}
78 | | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_id2}
79 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node}
80 | | ... | ${vlan2_index} | pop-1
81 | | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect
82 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index}
83 | | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index}
84 | | Then Send and receive ICMP Packet
85 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1ad
86 | | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1}
87
88 | TC02: DUT1 and DUT2 with L2XC and VLAN translate-2-1 with wrong tag used (DUT1) switch ICMPv4 between two TG links
89 | | [Documentation]
90 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1, \
91 | | ... | Eth-dot1q-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2.
92 | | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to
93 | | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite
94 | | ... | translate-2-1 method to set tag different from tag set on VLAN
95 | | ... | sub-interface of DUT2; on DUT2 configure L2 cross-connect (L2XC) with
96 | | ... | one interface to TG and one VLAN sub-interface towards DUT1 with
97 | | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv4 Echo Req
98 | | ... | tagged with Dot1ad tags from one of its interfaces to another one
99 | | ... | via DUT1 and DUT2; verify that packet is not received.
100 | | ... | [Ref] IEEE 802.1q, IEEE 802.1ad
101 | | [Tags] | SKIP_PATCH
102 | | Given Path for 3-node testing is set
103 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
104 | | And Interfaces in 3-node path are up
105 | | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created
106 | | ... | ${dut1_node} | ${dut1_to_tg} | ${subid}
107 | | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1}
108 | | ... | type_subif=two_tags dot1ad
109 | | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created
110 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
111 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node}
112 | | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_wrong}
113 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node}
114 | | ... | ${vlan2_index} | pop-1
115 | | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect
116 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index}
117 | | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index}
118 | | Then Run Keyword And Expect Error | ICMP echo Rx timeout
119 | | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1}
120 | | ... | ${tg_to_dut2} | encaps=Dot1ad | vlan1=${outer_vlan_id1}
121 | | ... | vlan2=${inner_vlan_id1}
122
123 | TC03: DUT1 and DUT2 with L2XC and VLAN translate-2-1 (DUT1) switch ICMPv6 between two TG links
124 | | [Documentation]
125 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1, \
126 | | ... | Eth-dot1q-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2.
127 | | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to
128 | | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite
129 | | ... | translate-2-1 method; on DUT2 configure L2 cross-connect (L2XC) with
130 | | ... | one interface to TG and one VLAN sub-interface towards DUT1 with
131 | | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv6 Echo Req
132 | | ... | tagegd with Dot1ad tags from one of its interfaces to another one
133 | | ... | via DUT1 and DUT2; verify that packet is received.
134 | | ... | [Ref] IEEE 802.1q, IEEE 802.1ad
135 | | Given Path for 3-node testing is set
136 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
137 | | And Interfaces in 3-node path are up
138 | | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created
139 | | ... | ${dut1_node} | ${dut1_to_tg} | ${subid}
140 | | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1}
141 | | ... | type_subif=two_tags dot1ad
142 | | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created
143 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
144 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node}
145 | | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_id2}
146 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node}
147 | | ... | ${vlan2_index} | pop-1
148 | | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect
149 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index}
150 | | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index}
151 | | Then Send and receive ICMP Packet
152 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip}
153 | | ... | dst_ip=${dst_ip} | encaps=Dot1ad | vlan1=${outer_vlan_id1}
154 | | ... | vlan2=${inner_vlan_id1}
155
156 | TC04: DUT1 and DUT2 with L2XC and VLAN translate-2-1 with wrong tag used (DUT1) switch ICMPv6 between two TG links
157 | | [Documentation]
158 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1, \
159 | | ... | Eth-dot1q-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2.
160 | | ... | [Cfg] On DUT1 configure L2 cross-connect (L2XC) with one interface to
161 | | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite
162 | | ... | translate-2-1 method to set tag different from tag set on VLAN
163 | | ... | sub-interface of DUT2; on DUT2 configure L2 cross-connect (L2XC) with
164 | | ... | one interface to TG and one VLAN sub-interface towards DUT1 with
165 | | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv6 Echo Req
166 | | ... | tagegd with Dot1ad tags from one of its interfaces to another one
167 | | ... | via DUT1 and DUT2; verify that packet is not received.
168 | | ... | [Ref] IEEE 802.1q, IEEE 802.1ad
169 | | [Tags] | SKIP_PATCH
170 | | Given Path for 3-node testing is set
171 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
172 | | And Interfaces in 3-node path are up
173 | | ${vlan1_name} | ${vlan1_index}= | When Tagged Subinterface Created
174 | | ... | ${dut1_node} | ${dut1_to_tg} | ${subid}
175 | | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1}
176 | | ... | type_subif=two_tags dot1ad
177 | | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created
178 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
179 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut1_node}
180 | | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_wrong}
181 | | And L2 Tag Rewrite Method Is Set On Interface | ${dut2_node}
182 | | ... | ${vlan2_index} | pop-1
183 | | And Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect
184 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${vlan1_index}
185 | | ... | ${dut2_node} | ${dut2_to_tg} | ${vlan2_index}
186 | | Then Run Keyword And Expect Error | ICMP echo Rx timeout
187 | | ... | Send and receive ICMP Packet | ${tg_node} | ${tg_to_dut1}
188 | | ... | ${tg_to_dut2} | src_ip=${src_ip} | dst_ip=${dst_ip} | encaps=Dot1ad
189 | | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1}