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