FIX: Tear down FDS functional test
[csit.git] / tests / vpp / func / vm_vhost / l2bd / eth2p-ethip4vxlan-l2bdbasemaclrn--eth-4vhost-2vm-fds-tenant-nets-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/shared/default.robot
16 | Resource | resources/libraries/robot/ip/ip4.robot
17 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
18 | Resource | resources/libraries/robot/shared/testing_path.robot
19 | Resource | resources/libraries/robot/vm/double_qemu_setup.robot
20 | Resource | resources/libraries/robot/vm/qemu.robot
21 | Library  | resources.libraries.python.Trace
22 | ...
23 | Force Tags | HW_ENV | VM_ENV | SKIP_PATCH
24 | ...
25 | Test Setup | Set up functional test
26 | ...
27 | Test Teardown | Tear down FDS functional test | ${dut1_node} | ${qemu_node1}
28 | ... | ${dut2_node} | ${qemu_node2}
29 | ...
30 | Documentation | *Tenant network FDS related.*
31 | ...
32 | ... | Test suite uses 3-node topology TG - DUT1 - DUT2 - TG
33 | ... | with one link between nodes. Test packets are sent in both directions
34 | ... | between namespaces in DUT1 and DUT2 with both positive and negative
35 | ... | scenarios tested.
36
37 *** Variables ***
38 | ${bd_id1}= | 1
39 | ${bd_id2}= | 2
40 | ${shg1}= | 3
41 | ${shg2}= | 4
42 | ${sock1}= | /tmp/sock1
43 | ${sock2}= | /tmp/sock2
44 | ${sock3}= | /tmp/sock3
45 | ${sock4}= | /tmp/sock4
46
47 | ${vni_blue}= | 23
48 | ${vni_red}= | 24
49
50 | ${bid_b}= | 23
51 | ${bid_r}= | 24
52
53 | ${dut1_if_ip}= | 16.0.0.1
54 | ${dut2_if_ip}= | 16.0.0.2
55
56 | ${dut1_blue1}= | 16.0.10.1
57 | ${dut1_blue2}= | 16.0.10.2
58 | ${dut1_red1}= | 16.0.10.3
59 | ${dut1_red2}= | 16.0.10.4
60
61 | ${dut2_blue1}= | 16.0.20.1
62 | ${dut2_blue2}= | 16.0.20.2
63 | ${dut2_red1}= | 16.0.20.3
64 | ${dut2_red2}= | 16.0.20.4
65
66 | ${namespace1}= | nmspace1
67 | ${namespace2}= | nmspace2
68 | ${namespace3}= | nmspace3
69 | ${namespace4}= | nmspace4
70
71 | ${prefix_length}= | 16
72
73 *** Test Cases ***
74 | L2 test cases with tenant networks (VXLAN)
75 | | [Documentation] | Ping among all ports inside the same network should pass.
76 | | ... | a) test l2 connectivity inside every network
77 | | ... | b) test l2 connectivity between networks
78 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
79 | | Given Configure path in 3-node circular topology
80 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
81 | | And Set Interface Address
82 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if_ip} | ${prefix_length}
83 | | And Set Interface Address
84 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_if_ip} | ${prefix_length}
85 | | And Set Interface State | ${dut1_node} | ${dut1_to_dut2} | up
86 | | And Set Interface State | ${dut2_node} | ${dut2_to_dut1} | up
87 | | ${vhost_if1_DUT1}= | And Vpp Create Vhost User Interface
88 | | ... | ${dut1_node} | ${sock1}
89 | | ${vhost_if2_DUT1}= | And Vpp Create Vhost User Interface
90 | | ... | ${dut1_node} | ${sock2}
91 | | ${vhost_if3_DUT1}= | And Vpp Create Vhost User Interface
92 | | ... | ${dut1_node} | ${sock3}
93 | | ${vhost_if4_DUT1}= | And Vpp Create Vhost User Interface
94 | | ... | ${dut1_node} | ${sock4}
95 | | ${dut1_vhosts}= | And Create List | ${vhost_if1_DUT1} | ${vhost_if2_DUT1}
96 | | ... | ${vhost_if3_DUT1} | ${vhost_if4_DUT1}
97 | | ${vhost_if1_DUT2}= | And Vpp Create Vhost User Interface
98 | | ... | ${dut2_node} | ${sock1}
99 | | ${vhost_if2_DUT2}= | And Vpp Create Vhost User Interface
100 | | ... | ${dut2_node} | ${sock2}
101 | | ${vhost_if3_DUT2}= | And Vpp Create Vhost User Interface
102 | | ... | ${dut2_node} | ${sock3}
103 | | ${vhost_if4_DUT2}= | And Vpp Create Vhost User Interface
104 | | ... | ${dut2_node} | ${sock4}
105 | | ${dut2_vhosts}= | And Create List | ${vhost_if1_DUT2} | ${vhost_if2_DUT2}
106 | | ... | ${vhost_if3_DUT2} | ${vhost_if4_DUT2}
107 | | When Configure QEMU vhost and run it | ${dut1_node}
108 | | ... | ${sock1}
109 | | ... | ${sock2}
110 | | ... | ${sock3}
111 | | ... | ${sock4}
112 | | ... | ${dut1_blue1}
113 | | ... | ${dut1_blue2}
114 | | ... | ${dut1_red1}
115 | | ... | ${dut1_red2}
116 | | ... | ${prefix_length}
117 | | ... | qemu_node1
118 | | ... | 04
119 | | And Configure QEMU vhost and run it | ${dut2_node}
120 | | ... | ${sock1}
121 | | ... | ${sock2}
122 | | ... | ${sock3}
123 | | ... | ${sock4}
124 | | ... | ${dut2_blue1}
125 | | ... | ${dut2_blue2}
126 | | ... | ${dut2_red1}
127 | | ... | ${dut2_red2}
128 | | ... | ${prefix_length}
129 | | ... | qemu_node2
130 | | ... | 06
131 | | And Setup VXLAN and BD on Dut | ${dut1_node} | ${dut1_if_ip} | ${dut2_if_ip}
132 | | ... | @{dut1_vhosts}
133 | | And Setup VXLAN and BD on Dut | ${dut2_node} | ${dut2_if_ip} | ${dut1_if_ip}
134 | | ... | @{dut2_vhosts}
135 | | Then Positive Scenario Ping From DUT1 - Intra network
136 | | And Positive Scenario Ping From DUT1 - Inter network
137 | | And Positive Scenario Ping From DUT2 - Intra network
138 | | And Positive Scenario Ping From DUT2 - Inter network
139 | | And Negative Scenario Ping From DUT1 - Intra network
140 | | And Negative Scenario Ping From DUT1 - Inter network
141 | | And Negative Scenario Ping From DUT2 - Intra network
142 | | And Negative Scenario Ping From DUT2 - Inter network
143
144 *** Keywords ***
145 | Setup VXLAN and BD on Dut
146 | | [Documentation] | Setup VXLAN and bridge domain on specific DUT and
147 | | ... | subsequently interconnect them properly.
148 | | ...
149 | | ... | *Arguments:*
150 | | ... | - dut_node - Node where to setup vxlan and BD. Type: dict
151 | | ... | - src_ip - Source IP for VXLAN. Type: string
152 | | ... | - dst_ip - Destination IP for vxlan. Type: string
153 | | ... | - vhosts - List containing vhost interfaces.
154 | | ...
155 | | ... | *Example:*
156 | | ...
157 | | ... | \| Setup VXLAN and BD on Dut \| ${dut_node} \| 16.0.0.1 \| 16.0.0.1 \
158 | | ... | \| @{vhosts} \|
159 | | ...
160 | | [Arguments] | ${dut_node} | ${src_ip} | ${dst_ip} | @{vhosts}
161 | | Create bridge domain
162 | | ... | ${dut_node} | ${bid_b} | learn=${TRUE}
163 | | Create bridge domain
164 | | ... | ${dut_node} | ${bid_r} | learn=${TRUE}
165 | | ${vxlan1_if}= | Create VXLAN interface | ${dut_node} | ${vni_blue}
166 | | ... | ${src_ip} | ${dst_ip}
167 | | ${vxlan2_if}= | Create VXLAN interface | ${dut_node} | ${vni_red}
168 | | ... | ${src_ip} | ${dst_ip}
169 | | Add interface to bridge domain
170 | | ... | ${dut_node} | ${vxlan1_if} | ${bid_b} | 0
171 | | Add interface to bridge domain
172 | | ... | ${dut_node} | @{vhosts}[0] | ${bid_b} | 0
173 | | Add interface to bridge domain
174 | | ... | ${dut_node} | @{vhosts}[1] | ${bid_b} | 0
175 | | Add interface to bridge domain
176 | | ... | ${dut_node} | ${vxlan2_if} | ${bid_r} | 0
177 | | Add interface to bridge domain
178 | | ... | ${dut_node} | @{vhosts}[2] | ${bid_r} | 0
179 | | Add interface to bridge domain
180 | | ... | ${dut_node} | @{vhosts}[3] | ${bid_r} | 0
181
182 | Positive Scenario Ping From DUT1 - Intra network
183 | | [Documentation] | Send ping packets from specified namespaces to other in
184 | | ... | order to test connectivity.
185 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} | ${namespace1}
186 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} | ${namespace2}
187 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} | ${namespace3}
188 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} | ${namespace4}
189
190 | Positive Scenario Ping From DUT1 - Inter network
191 | | [Documentation] | Send ping packets from specified namespaces to other in
192 | | ... | order to test connectivity.
193 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace1}
194 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace1}
195 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace2}
196 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace2}
197 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace3}
198 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace3}
199 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace4}
200 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace4}
201
202 | Positive Scenario Ping From DUT2 - Intra network
203 | | [Documentation] | Send ping packets from specified namespaces to other in
204 | | ... | order to test connectivity.
205 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} | ${namespace1}
206 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} | ${namespace2}
207 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} | ${namespace3}
208 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} | ${namespace4}
209
210 | Positive Scenario Ping From DUT2 - Inter network
211 | | [Documentation] | Send ping packets from specified namespaces to other in
212 | | ... | order to test connectivity.
213 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace1}
214 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace1}
215 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace2}
216 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace2}
217 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace3}
218 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace3}
219 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace4}
220 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace4}
221
222 | Negative Scenario Ping From DUT1 - Intra network
223 | | [Documentation] | Send ping packets from specified namespaces to other in
224 | | ... | order to test unreachability of namespaces.
225 | | Run keyword and expect error | Ping Not Successful
226 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1}
227 | | ... | ${namespace1}
228 | | Run keyword and expect error | Ping Not Successful
229 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2}
230 | | ... | ${namespace1}
231 | | Run keyword and expect error | Ping Not Successful
232 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1}
233 | | ... | ${namespace2}
234 | | Run keyword and expect error | Ping Not Successful
235 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2}
236 | | ... | ${namespace2}
237 | | Run keyword and expect error | Ping Not Successful
238 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1}
239 | | ... | ${namespace3}
240 | | Run keyword and expect error | Ping Not Successful
241 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2}
242 | | ... | ${namespace3}
243 | | Run keyword and expect error | Ping Not Successful
244 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1}
245 | | ... | ${namespace4}
246 | | Run keyword and expect error | Ping Not Successful
247 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2}
248 | | ... | ${namespace4}
249
250 | Negative Scenario Ping From DUT1 - Inter network
251 | | [Documentation] | Send ping packets from specified namespaces to other in
252 | | ... | order to test unreachability of namespaces.
253 | | Run keyword and expect error | Ping Not Successful
254 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1}
255 | | ... | ${namespace1}
256 | | Run keyword and expect error | Ping Not Successful
257 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2}
258 | | ... | ${namespace1}
259 | | Run keyword and expect error | Ping Not Successful
260 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1}
261 | | ... | ${namespace2}
262 | | Run keyword and expect error | Ping Not Successful
263 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2}
264 | | ... | ${namespace2}
265 | | Run keyword and expect error | Ping Not Successful
266 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1}
267 | | ... | ${namespace3}
268 | | Run keyword and expect error | Ping Not Successful
269 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2}
270 | | ... | ${namespace3}
271 | | Run keyword and expect error | Ping Not Successful
272 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1}
273 | | ... | ${namespace4}
274 | | Run keyword and expect error | Ping Not Successful
275 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2}
276 | | ... | ${namespace4}
277
278 | Negative Scenario Ping From DUT2 - Intra network
279 | | [Documentation] | Send ping packets from specified namespaces to other in
280 | | ... | order to test unreachability of namespaces.
281 | | Run keyword and expect error | Ping Not Successful
282 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1}
283 | | ... | ${namespace1}
284 | | Run keyword and expect error | Ping Not Successful
285 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2}
286 | | ... | ${namespace1}
287 | | Run keyword and expect error | Ping Not Successful
288 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1}
289 | | ... | ${namespace2}
290 | | Run keyword and expect error | Ping Not Successful
291 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2}
292 | | ... | ${namespace2}
293 | | Run keyword and expect error | Ping Not Successful
294 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1}
295 | | ... | ${namespace3}
296 | | Run keyword and expect error | Ping Not Successful
297 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2}
298 | | ... | ${namespace3}
299 | | Run keyword and expect error | Ping Not Successful
300 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1}
301 | | ... | ${namespace4}
302 | | Run keyword and expect error | Ping Not Successful
303 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2}
304 | | ... | ${namespace4}
305
306 | Negative Scenario Ping From DUT2 - Inter network
307 | | [Documentation] | Send ping packets from specified namespaces to other in
308 | | ... | order to test unreachability of namespaces.
309 | | Run keyword and expect error | Ping Not Successful
310 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1}
311 | | ... | ${namespace1}
312 | | Run keyword and expect error | Ping Not Successful
313 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2}
314 | | ... | ${namespace1}
315 | | Run keyword and expect error | Ping Not Successful
316 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1}
317 | | ... | ${namespace2}
318 | | Run keyword and expect error | Ping Not Successful
319 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2}
320 | | ... | ${namespace2}
321 | | Run keyword and expect error | Ping Not Successful
322 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1}
323 | | ... | ${namespace3}
324 | | Run keyword and expect error | Ping Not Successful
325 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2}
326 | | ... | ${namespace3}
327 | | Run keyword and expect error | Ping Not Successful
328 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1}
329 | | ... | ${namespace4}
330 | | Run keyword and expect error | Ping Not Successful
331 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2}
332 | | ... | ${namespace4}