CSIT-604: Bootstrap file for vpp-csit-verify-master-centos7-nightly
[csit.git] / tests / func / vlan / eth2p-dot1ad--dot1q-l2bdbasemaclrn-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/bridge_domain.robot
17 | Resource | resources/libraries/robot/testing_path.robot
18 | Resource | resources/libraries/robot/tagging.robot
19 | Resource | resources/libraries/robot/l2_traffic.robot
20 | Library  | resources.libraries.python.Trace
21 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | HW_ENV | VM_ENV | SKIP_VPP_PATCH
22 | Test Setup | Set up functional test
23 | Test Teardown | Tear down functional test
24 | Documentation | *L2BD with VLAN tag rewrite test cases - transalte-2-1*
25 | ...
26 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology
27 | ... | with single links between nodes.
28 | ... | *[Enc] Packet encapsulations:* Eth-dot1ad-IPv4-ICMPv4 or
29 | ... | Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1, Eth-dot1q-IPv4-ICMPv4 or
30 | ... | Eth-dot1q-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv4-ICMPv4 or Eth-IPv6-ICMPv6
31 | ... | on TG-DUT2 for L2 switching of IPv4/IPv6.
32 | ... | *[Cfg] DUT configuration:* DUT1 is configured with bridge domain (L2BD)
33 | ... | switching combined with MAC learning enabled and added VLAN
34 | ... | sub-interface with VLAN tag rewrite translate-2-1 method of interface
35 | ... | towards TG and interface towards DUT2. DUT2 is configured with L2
36 | ... | bridge domain (L2BD) switching between VLAN sub-interface with VLAN tag
37 | ... | rewrite pop-1 method of interface towards DUT1 and interface towards TG.
38 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are
39 | ... | sent from TG on link to DUT1 and received in TG on link form DUT2;
40 | ... | on receive TG verifies packets for correctness and their IPv4 src-addr,
41 | ... | dst-addr and MAC addresses.
42 | ... | *[Ref] Applicable standard specifications:* IEEE 802.1q, IEEE 802.1ad.
43
44 *** Variables ***
45 | ${bd_id1}= | 1
46
47 | ${subid}= | 10
48
49 | ${outer_vlan_id1}= | 110
50 | ${outer_vlan_id2}= | 120
51 | ${outer_vlan_wrong}= | 150
52
53 | ${inner_vlan_id1}= | 210
54
55 | ${src_ip6}= | 3ffe:63::1
56 | ${dst_ip6}= | 3ffe:63::2
57
58 *** Test Cases ***
59 | TC01: DUT1 and DUT2 with L2BD and VLAN translate-2-1 (DUT1) switch ICMPv4 between two TG links
60 | | [Documentation]
61 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1, \
62 | | ... | Eth-dot1q-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2.
63 | | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to
64 | | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite
65 | | ... | translate-2-1 method; on DUT2 configure L2 bridge domain (L2BD) with
66 | | ... | one interface to TG and one VLAN sub-interface towards DUT1 with
67 | | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv4 Echo Req
68 | | ... | tagged with Dot1ad tags from one of its interfaces to another one
69 | | ... | via DUT1 and DUT2; verify that packet is received.
70 | | ... | [Ref] IEEE 802.1q, IEEE 802.1ad
71 | | Given Configure path in 3-node circular topology
72 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
73 | | And Set interfaces in 3-node circular topology up
74 | | ${vlan1_name} | ${vlan1_index}= | When Create tagged sub-interface
75 | | ... | ${dut1_node} | ${dut1_to_tg} | ${subid}
76 | | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1}
77 | | ... | type_subif=two_tags dot1ad
78 | | ${vlan2_name} | ${vlan2_index}= | And Create vlan sub-interface
79 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
80 | | And Configure L2 tag rewrite method on interface | ${dut1_node}
81 | | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_id2}
82 | | And Configure L2 tag rewrite method on interface | ${dut2_node}
83 | | ... | ${vlan2_index} | pop-1
84 | | And Create bridge domain | ${dut1_node} | ${bd_id1}
85 | | And Add interface to bridge domain | ${dut1_node} | ${dut1_to_dut2}
86 | | ...                                     | ${bd_id1}
87 | | And Add interface to bridge domain | ${dut1_node} | ${vlan1_index}
88 | | ...                                     | ${bd_id1}
89 | | And Create bridge domain | ${dut2_node} | ${bd_id1}
90 | | And Add interface to bridge domain | ${dut2_node} | ${dut2_to_tg}
91 | | ...                                     | ${bd_id1}
92 | | And Add interface to bridge domain | ${dut2_node} | ${vlan2_index}
93 | | ...                                     | ${bd_id1}
94 | | Then Send ICMP packet and verify received packet
95 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | encaps=Dot1ad
96 | | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1}
97
98 | TC02: DUT1 and DUT2 with L2BD and VLAN translate-2-1 with wrong tag used (DUT1) switch ICMPv4 between two TG links
99 | | [Documentation]
100 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv4-ICMPv4 on TG-DUT1, \
101 | | ... | Eth-dot1q-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on TG-DUT2.
102 | | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to
103 | | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite
104 | | ... | translate-2-1 method to set tag different from tag set on VLAN
105 | | ... | sub-interface of DUT2; on DUT2 configure L2 bridge domain (L2BD) with
106 | | ... | one interface to TG and one VLAN sub-interface towards DUT1 with
107 | | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv4 Echo Req
108 | | ... | tagged with Dot1ad tags from one of its interfaces to another one
109 | | ... | via DUT1 and DUT2; verify that packet is not received.
110 | | ... | [Ref] IEEE 802.1q, IEEE 802.1ad
111 | | [Tags] | SKIP_PATCH
112 | | Given Configure path in 3-node circular topology
113 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
114 | | And Set interfaces in 3-node circular topology up
115 | | ${vlan1_name} | ${vlan1_index}= | When Create tagged sub-interface
116 | | ... | ${dut1_node} | ${dut1_to_tg} | ${subid}
117 | | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1}
118 | | ... | type_subif=two_tags dot1ad
119 | | ${vlan2_name} | ${vlan2_index}= | And Create vlan sub-interface
120 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
121 | | And Configure L2 tag rewrite method on interface | ${dut1_node}
122 | | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_wrong}
123 | | And Configure L2 tag rewrite method on interface | ${dut2_node}
124 | | ... | ${vlan2_index} | pop-1
125 | | And Create bridge domain | ${dut1_node} | ${bd_id1}
126 | | And Add interface to bridge domain | ${dut1_node} | ${dut1_to_dut2}
127 | | ...                                     | ${bd_id1}
128 | | And Add interface to bridge domain | ${dut1_node} | ${vlan1_index}
129 | | ...                                     | ${bd_id1}
130 | | And Create bridge domain | ${dut2_node} | ${bd_id1}
131 | | And Add interface to bridge domain | ${dut2_node} | ${dut2_to_tg}
132 | | ...                                     | ${bd_id1}
133 | | And Add interface to bridge domain | ${dut2_node} | ${vlan2_index}
134 | | ...                                     | ${bd_id1}
135 | | Then Run Keyword And Expect Error | ICMP echo Rx timeout
136 | | ... | Send ICMP packet and verify received packet | ${tg_node} | ${tg_to_dut1}
137 | | ... | ${tg_to_dut2} | encaps=Dot1ad | vlan1=${outer_vlan_id1}
138 | | ... | vlan2=${inner_vlan_id1}
139
140
141 | TC03: DUT1 and DUT2 with L2BD and VLAN translate-2-1 (DUT1) switch ICMPv6 between two TG links
142 | | [Documentation]
143 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1, \
144 | | ... | Eth-dot1q-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2.
145 | | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to
146 | | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite
147 | | ... | translate-2-1 method; on DUT2 configure L2 bridge domain (L2BD) with
148 | | ... | one interface to TG and one VLAN sub-interface towards DUT1 with
149 | | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv6 Echo Req
150 | | ... | tagged with Dot1ad tags from one of its interfaces to another one
151 | | ... | via DUT1 and DUT2; verify that packet is received.
152 | | ... | [Ref] IEEE 802.1q, IEEE 802.1ad
153 | | Given Configure path in 3-node circular topology
154 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
155 | | And Set interfaces in 3-node circular topology up
156 | | ${vlan1_name} | ${vlan1_index}= | When Create tagged sub-interface
157 | | ... | ${dut1_node} | ${dut1_to_tg} | ${subid}
158 | | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1}
159 | | ... | type_subif=two_tags dot1ad
160 | | ${vlan2_name} | ${vlan2_index}= | And Create vlan sub-interface
161 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
162 | | And Configure L2 tag rewrite method on interface | ${dut1_node}
163 | | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_id2}
164 | | And Configure L2 tag rewrite method on interface | ${dut2_node}
165 | | ... | ${vlan2_index} | pop-1
166 | | And Create bridge domain | ${dut1_node} | ${bd_id1}
167 | | And Add interface to bridge domain | ${dut1_node} | ${dut1_to_dut2}
168 | | ...                                     | ${bd_id1}
169 | | And Add interface to bridge domain | ${dut1_node} | ${vlan1_index}
170 | | ...                                     | ${bd_id1}
171 | | And Create bridge domain | ${dut2_node} | ${bd_id1}
172 | | And Add interface to bridge domain | ${dut2_node} | ${dut2_to_tg}
173 | | ...                                     | ${bd_id1}
174 | | And Add interface to bridge domain | ${dut2_node} | ${vlan2_index}
175 | | ...                                     | ${bd_id1}
176 | | Then Send ICMP packet and verify received packet
177 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2} | src_ip=${src_ip6}
178 | | ... | dst_ip=${dst_ip6} | encaps=Dot1ad | vlan1=${outer_vlan_id1}
179 | | ... | vlan2=${inner_vlan_id1}
180
181 | TC04: DUT1 and DUT2 with L2BD and VLAN translate-2-1 with wrong tag used (DUT1) switch ICMPv6 between two TG links
182 | | [Documentation]
183 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-dot1ad-IPv6-ICMPv6 on TG-DUT1, \
184 | | ... | Eth-dot1q-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on TG-DUT2.
185 | | ... | [Cfg] On DUT1 configure L2 bridge domain (L2BD) with one interface to
186 | | ... | DUT2 and one Dot1ad sub-interface towards TG with VLAN tag rewrite
187 | | ... | translate-2-1 method to set tag different from tag set on VLAN
188 | | ... | sub-interface of DUT2; on DUT2 configure L2 bridge domain (L2BD) with
189 | | ... | one interface to TG and one VLAN sub-interface towards DUT1 with
190 | | ... | VLAN tag rewrite pop-1 method. [Ver] Make TG send ICMPv6 Echo Req
191 | | ... | tagged with Dot1ad tags from one of its interfaces to another one
192 | | ... | via DUT1 and DUT2; verify that packet is not received.
193 | | ... | [Ref] IEEE 802.1q, IEEE 802.1ad
194 | | [Tags] | SKIP_PATCH
195 | | Given Configure path in 3-node circular topology
196 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
197 | | And Set interfaces in 3-node circular topology up
198 | | ${vlan1_name} | ${vlan1_index}= | When Create tagged sub-interface
199 | | ... | ${dut1_node} | ${dut1_to_tg} | ${subid}
200 | | ... | outer_vlan_id=${outer_vlan_id1} | inner_vlan_id=${inner_vlan_id1}
201 | | ... | type_subif=two_tags dot1ad
202 | | ${vlan2_name} | ${vlan2_index}= | And Create vlan sub-interface
203 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${outer_vlan_id2}
204 | | And Configure L2 tag rewrite method on interface | ${dut1_node}
205 | | ... | ${vlan1_index} | translate-2-1 | tag1_id=${outer_vlan_wrong}
206 | | And Configure L2 tag rewrite method on interface | ${dut2_node}
207 | | ... | ${vlan2_index} | pop-1
208 | | And Create bridge domain | ${dut1_node} | ${bd_id1}
209 | | And Add interface to bridge domain | ${dut1_node} | ${dut1_to_dut2}
210 | | ...                                     | ${bd_id1}
211 | | And Add interface to bridge domain | ${dut1_node} | ${vlan1_index}
212 | | ...                                     | ${bd_id1}
213 | | And Create bridge domain | ${dut2_node} | ${bd_id1}
214 | | And Add interface to bridge domain | ${dut2_node} | ${dut2_to_tg}
215 | | ...                                     | ${bd_id1}
216 | | And Add interface to bridge domain | ${dut2_node} | ${vlan2_index}
217 | | ...                                     | ${bd_id1}
218 | | Then Run Keyword And Expect Error | ICMP echo Rx timeout
219 | | ... | Send ICMP packet and verify received packet | ${tg_node} | ${tg_to_dut1}
220 | | ... | ${tg_to_dut2} | src_ip=${src_ip6} | dst_ip=${dst_ip6} | encaps=Dot1ad
221 | | ... | vlan1=${outer_vlan_id1} | vlan2=${inner_vlan_id1}