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