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