VPP in host user-mode, part II
[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 | *Bridge domain test suite.*
25 | ...
26 | ... | Test suite uses 2-node topology TG - DUT1 - TG with two links
27 | ... | between nodes as well as 3-node topology TG - DUT1 - DUT2 - TG
28 | ... | with one link between nodes. Test packets are sent in both directions
29 | ... | and contain Ethernet header, IPv4 header and ICMP message. Ethernet
30 | ... | header MAC addresses are matching MAC addresses of the TG node.
31
32 *** Variables ***
33 | ${bd_id1}= | 1
34 | ${bd_id2}= | 2
35 | ${shg1}= | 3
36 | ${shg2}= | 4
37 | ${sock1}= | /tmp/sock1
38 | ${sock2}= | /tmp/sock2
39
40 *** Test Cases ***
41 | VPP reports interfaces
42 | | [Documentation] | Report VPP interfaces on the given node
43 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | 3_NODE_SINGLE_LINK_TOPO
44 | | VPP reports interfaces on | ${nodes['DUT1']}
45
46 | Vpp forwards packets via L2 bridge domain 2 ports
47 | | [Documentation] | Create bridge domain (learning enabled) on one VPP node,
48 | | ...             | add there two interfaces and check traffic
49 | | ...             | bidirectionally.
50 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO
51 | | Given Path for 2-node testing is set
52 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
53 | | And Interfaces in 2-node path are up
54 | | When Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
55 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
56 | | ...                                     | ${bd_id1}
57 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
58 | | ...                                     | ${bd_id1}
59 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
60 | | ...                                     | ${tg_to_dut_if2}
61
62 | Vpp forwards packets via L2 bridge domain in circular topology
63 | | [Documentation] | Create bridge domains (learning enabled) on two VPP nodes,
64 | | ...             | add two interfaces to each bridge domain and check traffic
65 | | ...             | bidirectionally.
66 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO
67 | | Given Path for 3-node testing is set
68 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
69 | | And Interfaces in 3-node path are up
70 | | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
71 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg}
72 | | ...                                     | ${bd_id1}
73 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
74 | | ...                                     | ${bd_id1}
75 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2}
76 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg}
77 | | ...                                     | ${bd_id2}
78 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1}
79 | | ...                                     | ${bd_id2}
80 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut1}
81 | | ...                                          | ${tg_to_dut2}
82
83 | Vpp forwards packets via L2 bridge domain in circular topology with static L2FIB entries
84 | | [Documentation] | Create bridge domains (learning disabled) on two VPP
85 | | ...             | nodes, add two interfaces to each bridge domain and set
86 | | ...             | static L2FIB entry on each interface and check traffic
87 | | ...             | bidirectionally.
88 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO
89 | | Given Path for 3-node testing is set
90 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
91 | | And Interfaces in 3-node path are up
92 | | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
93 | | ...                                       | learn=${FALSE}
94 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg}
95 | | ...                                     | ${bd_id1}
96 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
97 | | ...                                     | ${bd_id1}
98 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
99 | | ...                                                | ${tg_to_dut1}
100 | | ...                                                | ${dut1_node}
101 | | ...                                                | ${dut1_to_tg}
102 | | ...                                                | ${bd_id1}
103 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
104 | | ...                                                | ${tg_to_dut2}
105 | | ...                                                | ${dut1_node}
106 | | ...                                                | ${dut1_to_dut2}
107 | | ...                                                | ${bd_id1}
108 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2}
109 | | ...                                      | learn=${FALSE}
110 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg}
111 | | ...                                     | ${bd_id2}
112 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1}
113 | | ...                                     | ${bd_id2}
114 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
115 | | ...                                                | ${tg_to_dut1}
116 | | ...                                                | ${dut2_node}
117 | | ...                                                | ${dut2_to_dut1}
118 | | ...                                                | ${bd_id2}
119 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
120 | | ...                                                | ${tg_to_dut2}
121 | | ...                                                | ${dut2_node}
122 | | ...                                                | ${dut2_to_tg}
123 | | ...                                                | ${bd_id2}
124 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut1}
125 | | ...                                          | ${tg_to_dut2}
126
127 | Vpp forwards packets via L2 bridge domain with split-horizon groups set in circular topology
128 | | [Documentation] | Create bridge domains (learning enabled) on two VPP nodes,
129 | | ...             | add interfaces to each bridge domain where both interfaces
130 | | ...             | toward TG are in the same split-horizon group and check
131 | | ...             | traffic bidirectionally.
132 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO
133 | | Given Path for 3-node BD-SHG testing is set | ${nodes['TG']}
134 | | ...                                         | ${nodes['DUT1']}
135 | | ...                                         | ${nodes['DUT2']}
136 | | And Interfaces in 3-node BD-SHG testing are up
137 | | When Bridge domain on DUT node is created | ${dut1_node} | ${bd_id1}
138 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if1}
139 | | ...                                     | ${bd_id1} | ${shg1}
140 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_tg_if2}
141 | | ...                                     | ${bd_id1} | ${shg1}
142 | | And Interface is added to bridge domain | ${dut1_node} | ${dut1_to_dut2}
143 | | ...                                     | ${bd_id1}
144 | | And Bridge domain on DUT node is created | ${dut2_node} | ${bd_id2}
145 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if1}
146 | | ...                                     | ${bd_id2} | ${shg2}
147 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_tg_if2}
148 | | ...                                     | ${bd_id2} | ${shg2}
149 | | And Interface is added to bridge domain | ${dut2_node} | ${dut2_to_dut1}
150 | | ...                                     | ${bd_id2}
151 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node}
152 | | ...                                          | ${tg_to_dut1_if1}
153 | | ...                                          | ${tg_to_dut2_if1}
154 | | And Send and receive ICMPv4 bidirectionally | ${tg_node}
155 | | ...                                         | ${tg_to_dut1_if1}
156 | | ...                                         | ${tg_to_dut2_if2}
157 | | And Send and receive ICMPv4 bidirectionally | ${tg_node}
158 | | ...                                         | ${tg_to_dut1_if2}
159 | | ...                                         | ${tg_to_dut2_if1}
160 | | And Send and receive ICMPv4 bidirectionally | ${tg_node}
161 | | ...                                         | ${tg_to_dut1_if2}
162 | | ...                                         | ${tg_to_dut2_if2}
163 | | And Run Keyword And Expect Error | ICMP echo Rx timeout
164 | | ...                              | Send and receive ICMPv4 bidirectionally
165 | | | ...                            | ${tg_node} | ${tg_to_dut1_if1}
166 | | | ...                            | ${tg_to_dut1_if2}
167 | | And Run Keyword And Expect Error | ICMP echo Rx timeout
168 | | ...                              | Send and receive ICMPv4 bidirectionally
169 | | | ...                            | ${tg_node} | ${tg_to_dut2_if1}
170 | | | ...                            | ${tg_to_dut2_if2}
171
172 | VPP forwards ICMPv4 packets through VM via two L2 bridge domains
173 | | [Documentation] | Setup and run VM connected to VPP via Vhost-User
174 | | ...             | interfaces and check ICMPv4 packet forwarding through VM
175 | | ...             | via two L2 bridge domains with learning enabled.
176 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
177 | | Given Path for 2-node testing is set
178 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
179 | | And Interfaces in 2-node path are up
180 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
181 | | ...                                                     | ${sock1}
182 | | ...                                                     | ${sock2}
183 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
184 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
185 | | ...                                     | ${bd_id1}
186 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
187 | | ...                                     | ${bd_id1}
188 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
189 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
190 | | ...                                     | ${bd_id2}
191 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
192 | | ...                                     | ${bd_id2}
193 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
194 | | ...                                       | ${sock2}
195 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
196 | | ...                                          | ${tg_to_dut_if2}
197 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
198 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}
199
200 | VPP forwards ICMPv6 packets through VM via two L2 bridge domains
201 | | [Documentation] | Setup and run VM connected to VPP via Vhost-User
202 | | ...             | interfaces and check ICMPv6 packet forwarding through VM
203 | | ...             | via two L2 bridge domains with learning enabled.
204 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
205 | | Given Path for 2-node testing is set
206 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
207 | | And Interfaces in 2-node path are up
208 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
209 | | ...                                                     | ${sock1}
210 | | ...                                                     | ${sock2}
211 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
212 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
213 | | ...                                     | ${bd_id1}
214 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
215 | | ...                                     | ${bd_id1}
216 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
217 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
218 | | ...                                     | ${bd_id2}
219 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
220 | | ...                                     | ${bd_id2}
221 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
222 | | ...                                       | ${sock2}
223 | | Then Send and receive ICMPv6 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
224 | | ...                                          | ${tg_to_dut_if2}
225 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
226 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}
227
228 | VPP forwards ICMPv4 packets through VM via two L2 bridge domains with static L2FIB entries
229 | | [Documentation] | Setup and run VM connected to VPP via Vhost-User
230 | | ...             | interfaces and check ICMPv4 packet forwarding through VM
231 | | ...             | via two L2 bridge domains with learning disabled
232 | | ...             | (static L2BFIB entries).
233 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
234 | | Given Path for 2-node testing is set
235 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
236 | | And Interfaces in 2-node path are up
237 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
238 | | ...                                                     | ${sock1}
239 | | ...                                                     | ${sock2}
240 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
241 | | ...                                      | learn=${FALSE}
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 Destination port is added to L2FIB on DUT node | ${tg_node}
247 | | ...                                                | ${tg_to_dut_if1}
248 | | ...                                                | ${dut_node}
249 | | ...                                                | ${dut_to_tg_if1}
250 | | ...                                                | ${bd_id1}
251 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
252 | | ...                                                | ${tg_to_dut_if2}
253 | | ...                                                | ${dut_node}
254 | | ...                                                | ${vhost_if1}
255 | | ...                                                | ${bd_id1}
256 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
257 | | ...                                      | learn=${FALSE}
258 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
259 | | ...                                     | ${bd_id2}
260 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
261 | | ...                                     | ${bd_id2}
262 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
263 | | ...                                                | ${tg_to_dut_if2}
264 | | ...                                                | ${dut_node}
265 | | ...                                                | ${dut_to_tg_if2}
266 | | ...                                                | ${bd_id2}
267 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
268 | | ...                                                | ${tg_to_dut_if1}
269 | | ...                                                | ${dut_node}
270 | | ...                                                | ${vhost_if2}
271 | | ...                                                | ${bd_id2}
272 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
273 | | ...                                       | ${sock2}
274 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
275 | | ...                                          | ${tg_to_dut_if2}
276 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
277 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}
278
279 | VPP forwards ICMPv6 packets through VM via two L2 bridge domains with static L2FIB entries
280 | | [Documentation] | Setup and run VM connected to VPP via Vhost-User
281 | | ...             | interfaces and check ICMPv6 packet forwarding through VM
282 | | ...             | via two L2 bridge domains with learning disabled
283 | | ...             | (static L2BFIB entries).
284 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
285 | | Given Path for 2-node testing is set
286 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
287 | | And Interfaces in 2-node path are up
288 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
289 | | ...                                                     | ${sock1}
290 | | ...                                                     | ${sock2}
291 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id1}
292 | | ...                                      | learn=${FALSE}
293 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
294 | | ...                                     | ${bd_id1}
295 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
296 | | ...                                     | ${bd_id1}
297 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
298 | | ...                                                | ${tg_to_dut_if1}
299 | | ...                                                | ${dut_node}
300 | | ...                                                | ${dut_to_tg_if1}
301 | | ...                                                | ${bd_id1}
302 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
303 | | ...                                                | ${tg_to_dut_if2}
304 | | ...                                                | ${dut_node}
305 | | ...                                                | ${vhost_if1}
306 | | ...                                                | ${bd_id1}
307 | | And Bridge domain on DUT node is created | ${dut_node} | ${bd_id2}
308 | | ...                                      | learn=${FALSE}
309 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if2}
310 | | ...                                     | ${bd_id2}
311 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
312 | | ...                                     | ${bd_id2}
313 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
314 | | ...                                                | ${tg_to_dut_if2}
315 | | ...                                                | ${dut_node}
316 | | ...                                                | ${dut_to_tg_if2}
317 | | ...                                                | ${bd_id2}
318 | | And Destination port is added to L2FIB on DUT node | ${tg_node}
319 | | ...                                                | ${tg_to_dut_if1}
320 | | ...                                                | ${dut_node}
321 | | ...                                                | ${vhost_if2}
322 | | ...                                                | ${bd_id2}
323 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
324 | | ...                                       | ${sock2}
325 | | Then Send and receive ICMPv6 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
326 | | ...                                          | ${tg_to_dut_if2}
327 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
328 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}