Suite:bridge_domain
[csit.git] / tests / suites / bridge_domain / bridge_domain_untagged.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/qemu.robot
19 | Library  | resources.libraries.python.Trace
20 | Force Tags | HW_ENV | VM_ENV
21 | Test Setup | Run Keywords | Setup all DUTs before test
22 | ...        | AND          | Setup all TGs before traffic script
23 | Test Teardown | Show Packet Trace on All DUTs | ${nodes}
24 | Documentation | *L2 bridge-domain test cases*
25 | ...
26 | ... | *(Top) Network Topologies:* TG=DUT1 2-node topology with two links
27 | ... | between nodes; TG-DUT1-DUT2-TG 3-node circular topology with
28 | ... | single links between nodes; TG=DUT1=DUT2=TG 3-node circular
29 | ... | topology with double parallel links and TG=DUT=VM 3-node topology
30 | ... | with VM and double parallel links.
31 | ... | *(Enc) Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of
32 | ... | IPv4; Eth-IPv6-ICMPv6 for L2 switching of IPv6 use. Both apply
33 | ... | to all links.
34 | ... | *(Cfg) DUT configuration:* DUT1 and DUT2 are configured with L2
35 | ... | bridge-domain (L2BD) switching combined with static MACs; MAC
36 | ... | learning enabled and Split Horizon Groups (SHG) depending on
37 | ... | test case.
38 | ... | *(Ver) TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets
39 | ... | are sent in both directions by TG on links to DUT1 and DUT2; on
40 | ... | receive TG verifies packets for correctness and their IPv4 (IPv6)
41 | ... | src-addr, dst-addr and MAC addresses.
42 | ... | *(Ref) Applicable standard specifications:*
43
44 *** Variables ***
45 | ${bd_id1}= | 1
46 | ${bd_id2}= | 2
47 | ${shg1}= | 3
48 | ${shg2}= | 4
49 | ${sock1}= | /tmp/sock1
50 | ${sock2}= | /tmp/sock2
51
52 *** Test Cases ***
53 | TC01: DUT reports active interfaces
54 | | [Documentation]
55 | | ... | (Top) TG=DUT1; TG-DUT1-DUT2-TG. (Enc) None. (Cfg) Discovered
56 | | ... | active interfaces. (Ver) Report active interfaces on DUT. (Ref)
57 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | 3_NODE_SINGLE_LINK_TOPO
58 | | VPP reports interfaces on | ${nodes['DUT1']}
59
60 | TC02: DUT with L2BD (MAC learning) switch ICMPv4 between two TG links
61 | | [Documentation]
62 | | ... | (Top) TG=DUT1. (Enc) Eth-IPv4-ICMPv4. (Cfg) On DUT1 configure
63 | | ... | two i/fs into L2BD with MAC learning. (Ver) Make TG verify
64 | | ... | ICMPv4 Echo Req pkts are switched thru DUT1 in both directions
65 | | ... | and are correct on receive. (Ref)
66 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO
67 | | Given Path for 2-node testing is set
68 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
69 | | And Interfaces in 2-node path are up
70 | | When Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
71 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
72 | | ...                                     | ${bd_id1}
73 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
74 | | ...                                     | ${bd_id1}
75 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
76 | | ...                                     | ${tg_to_dut_if2}
77
78 | TC03: DUT1 and DUT2 with L2BD (MAC learning) switch between two TG links
79 | | [Documentation]
80 | | ... | (Top) TG-DUT1-DUT2-TG. (Enc) Eth-IPv4-ICMPv4. (Cfg) On DUT1 and DUT2
81 | | ... | configure two i/fs into L2BD with MAC learning. (Ver) Make TG
82 | | ... | verify ICMPv4 Echo Req pkts are switched thru DUT1 and DUT2 in
83 | | ... | both directions and are correct on receive. (Ref)
84 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO
85 | | Given Path for 3-node testing is set
86 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
87 | | And Interfaces in 3-node path are up
88 | | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
89 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg}
90 | | ...                                     | ${bd_id1}
91 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
92 | | ...                                     | ${bd_id1}
93 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2}
94 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg}
95 | | ...                                     | ${bd_id2}
96 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1}
97 | | ...                                     | ${bd_id2}
98 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut1}
99 | | ...                                          | ${tg_to_dut2}
100
101 | TC04: DUT1 and DUT2 with L2BD (static MACs) switch between two TG links
102 | | [Documentation]
103 | | ... | (Top) TG-DUT1-DUT2-TG. (Enc) Eth-IPv4-ICMPv4. (Cfg) On DUT1 and
104 | | ... | DUT2 configure two i/fs into L2BD with static MACs. (Ver) Make
105 | | ... | TG verify ICMPv4 Echo Req pkts are switched thru DUT1 and DUT2
106 | | ... | in both directions and are correct on receive. (Ref)
107 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO
108 | | Given Path for 3-node testing is set
109 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
110 | | And Interfaces in 3-node path are up
111 | | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
112 | | ...                                       | learn=${FALSE}
113 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg}
114 | | ...                                     | ${bd_id1}
115 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
116 | | ...                                     | ${bd_id1}
117 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
118 | | ...                                                | ${tg_to_dut1}
119 | | ...                                                | ${dut1_node}
120 | | ...                                                | ${dut1_to_tg}
121 | | ...                                                | ${bd_id1}
122 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
123 | | ...                                                | ${tg_to_dut2}
124 | | ...                                                | ${dut1_node}
125 | | ...                                                | ${dut1_to_dut2}
126 | | ...                                                | ${bd_id1}
127 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2}
128 | | ...                                      | learn=${FALSE}
129 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg}
130 | | ...                                     | ${bd_id2}
131 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1}
132 | | ...                                     | ${bd_id2}
133 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
134 | | ...                                                | ${tg_to_dut1}
135 | | ...                                                | ${dut2_node}
136 | | ...                                                | ${dut2_to_dut1}
137 | | ...                                                | ${bd_id2}
138 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
139 | | ...                                                | ${tg_to_dut2}
140 | | ...                                                | ${dut2_node}
141 | | ...                                                | ${dut2_to_tg}
142 | | ...                                                | ${bd_id2}
143 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut1}
144 | | ...                                          | ${tg_to_dut2}
145
146 | TC05: DUT1 and DUT2 with L2BD (MAC learn) and SHG switch between four TG links
147 | | [Documentation]
148 | | ... | (Top) TG=DUT1=DUT2=TG. (Enc) Eth-IPv4-ICMPv4. (Cfg) On DUT1 and
149 | | ... | DUT2 configure four i/fs into L2BD with MAC learning and the
150 | | ... | same SHG on i/fs towards TG. (Ver) Make TG verify ICMPv4 Echo
151 | | ... | Req pkts are switched thru DUT1 and DUT2 in both directions and
152 | | ... | are correct on receive; verify no pkts are switched thru SHG
153 | | ... | isolated interfaces. (Ref)
154 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO
155 | | Given Path for 3-node BD-SHG testing is set | ${nodes['TG']}
156 | | ...                                         | ${nodes['DUT1']}
157 | | ...                                         | ${nodes['DUT2']}
158 | | And Interfaces in 3-node BD-SHG testing are up
159 | | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
160 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if1}
161 | | ...                                     | ${bd_id1} | ${shg1}
162 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if2}
163 | | ...                                     | ${bd_id1} | ${shg1}
164 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
165 | | ...                                     | ${bd_id1}
166 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2}
167 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if1}
168 | | ...                                     | ${bd_id2} | ${shg2}
169 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if2}
170 | | ...                                     | ${bd_id2} | ${shg2}
171 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1}
172 | | ...                                     | ${bd_id2}
173 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node}
174 | | ...                                          | ${tg_to_dut1_if1}
175 | | ...                                          | ${tg_to_dut2_if1}
176 | | And Send and receive ICMPv4 bidirectionally | ${tg_node}
177 | | ...                                         | ${tg_to_dut1_if1}
178 | | ...                                         | ${tg_to_dut2_if2}
179 | | And Send and receive ICMPv4 bidirectionally | ${tg_node}
180 | | ...                                         | ${tg_to_dut1_if2}
181 | | ...                                         | ${tg_to_dut2_if1}
182 | | And Send and receive ICMPv4 bidirectionally | ${tg_node}
183 | | ...                                         | ${tg_to_dut1_if2}
184 | | ...                                         | ${tg_to_dut2_if2}
185 | | And Run Keyword And Expect Error | ICMP echo Rx timeout
186 | | ...                              | Send and receive ICMPv4 bidirectionally
187 | | | ...                            | ${tg_node} | ${tg_to_dut1_if1}
188 | | | ...                            | ${tg_to_dut1_if2}
189 | | And Run Keyword And Expect Error | ICMP echo Rx timeout
190 | | ...                              | Send and receive ICMPv4 bidirectionally
191 | | | ...                            | ${tg_node} | ${tg_to_dut2_if1}
192 | | | ...                            | ${tg_to_dut2_if2}
193
194 | TC06: DUT with two L2BDs (MAC learn) switches ICMPv4 between TG and VM links
195 | | [Documentation]
196 | | ... | (Top) TG=DUT=VM. (Enc) Eth-IPv4-ICMPv4. (Cfg) On DUT1 configure
197 | | ... | two L2BDs with MAC learning, each with vhost-user i/f to local
198 | | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two
199 | | ... | virtio i/fs. (Ver) Make TG verify ICMPv4 Echo Req pkts are
200 | | ... | switched thru DUT1 and VM in both directions and are correct on
201 | | ... | receive. (Ref)
202 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
203 | | Given Path for 2-node testing is set
204 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
205 | | And Interfaces in 2-node path are up
206 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
207 | | ...                                                     | ${sock1}
208 | | ...                                                     | ${sock2}
209 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
210 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
211 | | ...                                     | ${bd_id1}
212 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
213 | | ...                                     | ${bd_id1}
214 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
215 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
216 | | ...                                     | ${bd_id2}
217 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
218 | | ...                                     | ${bd_id2}
219 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
220 | | ...                                       | ${sock2}
221 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
222 | | ...                                          | ${tg_to_dut_if2}
223 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
224 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}
225
226 | TC07: DUT with two L2BDs (MAC learn) switches ICMPv6 between TG and VM links
227 | | [Documentation]
228 | | ... | (Top) TG=DUT=VM. (Enc) Eth-IPv6-ICMPv6. (Cfg) On DUT1 configure
229 | | ... | two L2BDs with MAC learning, each with vhost-user i/f to local
230 | | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two
231 | | ... | virtio i/fs. (Ver) Make TG verify ICMPv6 Echo Req pkts are
232 | | ... | switched thru DUT1 and VM in both directions and are correct on
233 | | ... | receive. (Ref)
234 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
235 | | Given Path for 2-node testing is set
236 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
237 | | And Interfaces in 2-node path are up
238 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
239 | | ...                                                     | ${sock1}
240 | | ...                                                     | ${sock2}
241 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
242 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
243 | | ...                                     | ${bd_id1}
244 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
245 | | ...                                     | ${bd_id1}
246 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
247 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
248 | | ...                                     | ${bd_id2}
249 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
250 | | ...                                     | ${bd_id2}
251 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
252 | | ...                                       | ${sock2}
253 | | Then Send and receive ICMPv6 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
254 | | ...                                          | ${tg_to_dut_if2}
255 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
256 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}
257
258 | TC08: DUT with two L2BDs (static MACs) switches ICMPv4 between TG and VM links
259 | | [Documentation]
260 | | ... | (Top) TG=DUT=VM. (Enc) Eth-IPv4-ICMPv4. (Cfg) On DUT1 configure
261 | | ... | two L2BDs with static MACs, each with vhost-user i/f to local VM
262 | | ... | and i/f to TG; configure VM to loop pkts back betwen its two
263 | | ... | virtio i/fs. (Ver) Make TG verify ICMPv4 Echo Req pkts are
264 | | ... | switched thru DUT1 and VM in both directions and are correct on
265 | | ... | receive. (Ref)
266 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
267 | | Given Path for 2-node testing is set
268 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
269 | | And Interfaces in 2-node path are up
270 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
271 | | ...                                                     | ${sock1}
272 | | ...                                                     | ${sock2}
273 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
274 | | ...                                      | learn=${FALSE}
275 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
276 | | ...                                     | ${bd_id1}
277 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
278 | | ...                                     | ${bd_id1}
279 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
280 | | ...                                                | ${tg_to_dut_if1}
281 | | ...                                                | ${dut_node}
282 | | ...                                                | ${dut_to_tg_if1}
283 | | ...                                                | ${bd_id1}
284 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
285 | | ...                                                | ${tg_to_dut_if2}
286 | | ...                                                | ${dut_node}
287 | | ...                                                | ${vhost_if1}
288 | | ...                                                | ${bd_id1}
289 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
290 | | ...                                      | learn=${FALSE}
291 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
292 | | ...                                     | ${bd_id2}
293 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
294 | | ...                                     | ${bd_id2}
295 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
296 | | ...                                                | ${tg_to_dut_if2}
297 | | ...                                                | ${dut_node}
298 | | ...                                                | ${dut_to_tg_if2}
299 | | ...                                                | ${bd_id2}
300 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
301 | | ...                                                | ${tg_to_dut_if1}
302 | | ...                                                | ${dut_node}
303 | | ...                                                | ${vhost_if2}
304 | | ...                                                | ${bd_id2}
305 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
306 | | ...                                       | ${sock2}
307 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
308 | | ...                                          | ${tg_to_dut_if2}
309 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
310 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}
311
312 | TC09: DUT with two L2BDs (static MACs) switches ICMPv6 between TG and VM links
313 | | [Documentation]
314 | | ... | (Top) TG=DUT=VM. (Enc) Eth-IPv6-ICMPv6. (Cfg) On DUT1 configure
315 | | ... | two L2BDs with static MACs, each with vhost-user i/f to local VM
316 | | ... | and i/f to TG; configure VM to loop pkts back betwen its two
317 | | ... | virtio i/fs. (Ver) Make TG verify ICMPv6 Echo Req pkts are
318 | | ... | switched thru DUT1 and VM in both directions and are correct on
319 | | ... | receive. (Ref)
320 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
321 | | Given Path for 2-node testing is set
322 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
323 | | And Interfaces in 2-node path are up
324 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
325 | | ...                                                     | ${sock1}
326 | | ...                                                     | ${sock2}
327 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
328 | | ...                                      | learn=${FALSE}
329 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
330 | | ...                                     | ${bd_id1}
331 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
332 | | ...                                     | ${bd_id1}
333 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
334 | | ...                                                | ${tg_to_dut_if1}
335 | | ...                                                | ${dut_node}
336 | | ...                                                | ${dut_to_tg_if1}
337 | | ...                                                | ${bd_id1}
338 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
339 | | ...                                                | ${tg_to_dut_if2}
340 | | ...                                                | ${dut_node}
341 | | ...                                                | ${vhost_if1}
342 | | ...                                                | ${bd_id1}
343 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
344 | | ...                                      | learn=${FALSE}
345 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
346 | | ...                                     | ${bd_id2}
347 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
348 | | ...                                     | ${bd_id2}
349 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
350 | | ...                                                | ${tg_to_dut_if2}
351 | | ...                                                | ${dut_node}
352 | | ...                                                | ${dut_to_tg_if2}
353 | | ...                                                | ${bd_id2}
354 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
355 | | ...                                                | ${tg_to_dut_if1}
356 | | ...                                                | ${dut_node}
357 | | ...                                                | ${vhost_if2}
358 | | ...                                                | ${bd_id2}
359 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
360 | | ...                                       | ${sock2}
361 | | Then Send and receive ICMPv6 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
362 | | ...                                          | ${tg_to_dut_if2}
363 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
364 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}