FIX: Tear down FDS functional test
[csit.git] / tests / vpp / func / vm_vhost / l2bd / eth2p-dot1q-l2bdbasemaclrn-eth-4vhost-2vm-fds-provider-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 | *Provider 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 | ${bid_b}= | 23
48 | ${bid_r}= | 24
49
50 | ${vlan_red}= | 50
51 | ${vlan_blue}= | 60
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 | Provider network test cases with provider physical networks (VLAN)
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 | ${nodes['TG']}
80 | | ... | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
81 | | And Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if_ip}
82 | | ... | ${prefix_length}
83 | | And Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${dut2_if_ip}
84 | | ... | ${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 VLAN and BD on Dut | ${dut1_node} | ${dut1_to_dut2}
132 | | ... | @{dut1_vhosts}
133 | | And Setup VLAN and BD on Dut | ${dut2_node} | ${dut2_to_dut1}
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 VLAN and BD on Dut
146 | | [Documentation] | Setup VLAN and bridge domain on specific DUT and
147 | | ... | subsequently interconnect them properly. Also set VLAN tag
148 | | ... | rewrite on vhosts.
149 | | ...
150 | | ... | *Arguments:*
151 | | ... | - dut_node - Node where to setup VLAN and BD. Type: dict
152 | | ... | - interface - Interface where to create VLAN sub-interface.
153 | | ... | Type: string
154 | | ... | - vhosts - List containing vhost interfaces.
155 | | ...
156 | | ... | *Example:*
157 | | ...
158 | | ... | \| Setup VLAN and BD on Dut \| ${dut_node} \| GigabitEthernet0/6/0 \
159 | | ... | \| @{vhosts} \|
160 | | ...
161 | | [Arguments] | ${dut_node} | ${interface} | @{vhosts}
162 | | Create bridge domain | ${dut_node} | ${bid_b} | learn=${TRUE}
163 | | Create bridge domain | ${dut_node} | ${bid_r} | learn=${TRUE}
164 | | ${interface_name}= | Get interface name | ${dut_node} | ${interface}
165 | | ${vlan1_name} | ${vlan1_index}= | Create Vlan Subinterface
166 | | ... | ${dut_node} | ${interface_name} | ${vlan_blue}
167 | | ${vlan2_name} | ${vlan2_index}= | Create Vlan Subinterface
168 | | ... | ${dut_node} | ${interface_name} | ${vlan_red}
169 | | L2 Vlan Tag Rewrite | ${dut_node} | @{vhosts}[0] | push-1
170 | | ... | tag1_id=${vlan_blue}
171 | | L2 Vlan Tag Rewrite | ${dut_node} | @{vhosts}[1] | push-1
172 | | ... | tag1_id=${vlan_blue}
173 | | L2 Vlan Tag Rewrite | ${dut_node} | @{vhosts}[2] | push-1
174 | | ... | tag1_id=${vlan_red}
175 | | L2 Vlan Tag Rewrite | ${dut_node} | @{vhosts}[3] | push-1
176 | | ... | tag1_id=${vlan_red}
177 | | Add interface to bridge domain | ${dut_node}
178 | | ... | ${vlan1_index} | ${bid_b} | 0
179 | | Add interface to bridge domain | ${dut_node}
180 | | ... | @{vhosts}[0] | ${bid_b} | 0
181 | | Add interface to bridge domain | ${dut_node}
182 | | ... | @{vhosts}[1] | ${bid_b} | 0
183 | | Add interface to bridge domain | ${dut_node}
184 | | ... | ${vlan2_index} | ${bid_r} | 0
185 | | Add interface to bridge domain | ${dut_node}
186 | | ... | @{vhosts}[2] | ${bid_r} | 0
187 | | Add interface to bridge domain | ${dut_node}
188 | | ... | @{vhosts}[3] | ${bid_r} | 0
189
190 | Positive Scenario Ping From DUT1 - Intra 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} | ${dut1_blue2} | ${namespace1}
194 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} | ${namespace2}
195 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} | ${namespace3}
196 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} | ${namespace4}
197
198 | Positive Scenario Ping From DUT1 - Inter network
199 | | [Documentation] | Send ping packets from specified namespaces to other in
200 | | ... | order to test connectivity.
201 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace1}
202 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace1}
203 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace2}
204 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace2}
205 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace3}
206 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace3}
207 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace4}
208 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace4}
209
210 | Positive Scenario Ping From DUT2 - Intra 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} | ${dut2_blue2} | ${namespace1}
214 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} | ${namespace2}
215 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} | ${namespace3}
216 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} | ${namespace4}
217
218 | Positive Scenario Ping From DUT2 - Inter network
219 | | [Documentation] | Send ping packets from specified namespaces to other in
220 | | ... | order to test connectivity.
221 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace1}
222 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace1}
223 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace2}
224 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace2}
225 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace3}
226 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace3}
227 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace4}
228 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace4}
229
230 | Negative Scenario Ping From DUT1 - Intra network
231 | | [Documentation] | Send ping packets from specified namespaces to other in
232 | | ... | order to test unreachability of namespaces.
233 | | Run keyword and expect error | Ping Not Successful
234 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1}
235 | | ... | ${namespace1}
236 | | Run keyword and expect error | Ping Not Successful
237 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2}
238 | | ... | ${namespace1}
239 | | Run keyword and expect error | Ping Not Successful
240 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1}
241 | | ... | ${namespace2}
242 | | Run keyword and expect error | Ping Not Successful
243 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2}
244 | | ... | ${namespace2}
245 | | Run keyword and expect error | Ping Not Successful
246 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1}
247 | | ... | ${namespace3}
248 | | Run keyword and expect error | Ping Not Successful
249 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2}
250 | | ... | ${namespace3}
251 | | Run keyword and expect error | Ping Not Successful
252 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1}
253 | | ... | ${namespace4}
254 | | Run keyword and expect error | Ping Not Successful
255 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2}
256 | | ... | ${namespace4}
257
258 | Negative Scenario Ping From DUT1 - Inter network
259 | | [Documentation] | Send ping packets from specified namespaces to other in
260 | | ... | order to test unreachability of namespaces.
261 | | Run keyword and expect error | Ping Not Successful
262 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1}
263 | | ... | ${namespace1}
264 | | Run keyword and expect error | Ping Not Successful
265 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2}
266 | | ... | ${namespace1}
267 | | Run keyword and expect error | Ping Not Successful
268 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1}
269 | | ... | ${namespace2}
270 | | Run keyword and expect error | Ping Not Successful
271 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2}
272 | | ... | ${namespace2}
273 | | Run keyword and expect error | Ping Not Successful
274 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1}
275 | | ... | ${namespace3}
276 | | Run keyword and expect error | Ping Not Successful
277 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2}
278 | | ... | ${namespace3}
279 | | Run keyword and expect error | Ping Not Successful
280 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1}
281 | | ... | ${namespace4}
282 | | Run keyword and expect error | Ping Not Successful
283 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2}
284 | | ... | ${namespace4}
285
286 | Negative Scenario Ping From DUT2 - Intra network
287 | | [Documentation] | Send ping packets from specified namespaces to other in
288 | | ... | order to test unreachability of namespaces.
289 | | Run keyword and expect error | Ping Not Successful
290 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1}
291 | | ... | ${namespace1}
292 | | Run keyword and expect error | Ping Not Successful
293 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2}
294 | | ... | ${namespace1}
295 | | Run keyword and expect error | Ping Not Successful
296 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1}
297 | | ... | ${namespace2}
298 | | Run keyword and expect error | Ping Not Successful
299 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2}
300 | | ... | ${namespace2}
301 | | Run keyword and expect error | Ping Not Successful
302 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1}
303 | | ... | ${namespace3}
304 | | Run keyword and expect error | Ping Not Successful
305 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2}
306 | | ... | ${namespace3}
307 | | Run keyword and expect error | Ping Not Successful
308 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1}
309 | | ... | ${namespace4}
310 | | Run keyword and expect error | Ping Not Successful
311 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2}
312 | | ... | ${namespace4}
313
314 | Negative Scenario Ping From DUT2 - Inter network
315 | | [Documentation] | Send ping packets from specified namespaces to other in
316 | | ... | order to test unreachability of namespaces.
317 | | Run keyword and expect error | Ping Not Successful
318 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1}
319 | | ... | ${namespace1}
320 | | Run keyword and expect error | Ping Not Successful
321 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2}
322 | | ... | ${namespace1}
323 | | Run keyword and expect error | Ping Not Successful
324 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1}
325 | | ... | ${namespace2}
326 | | Run keyword and expect error | Ping Not Successful
327 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2}
328 | | ... | ${namespace2}
329 | | Run keyword and expect error | Ping Not Successful
330 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1}
331 | | ... | ${namespace3}
332 | | Run keyword and expect error | Ping Not Successful
333 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2}
334 | | ... | ${namespace3}
335 | | Run keyword and expect error | Ping Not Successful
336 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1}
337 | | ... | ${namespace4}
338 | | Run keyword and expect error | Ping Not Successful
339 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2}
340 | | ... | ${namespace4}