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