CSIT-604: Bootstrap file for vpp-csit-verify-master-centos7-nightly
[csit.git] / tests / vpp / func / vm_vhost / l2bd / eth2p-ethip4vxlan-l2bdbasemaclrn--eth-4vhost-2vm-fds-tenant-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 | Resource | resources/libraries/robot/fds/default.robot
22 | Library  | resources.libraries.python.Trace
23 | ...
24 | Force Tags | HW_ENV | VM_ENV | SKIP_PATCH
25 | ...
26 | Test Setup | Set up FDS functional test | ${nodes}
27 | ...
28 | Test Teardown | Tear down FDS functional test | ${nodes}
29 | ... | ${dut1_node} | ${qemu_node1} | ${dut2_node} | ${qemu_node2}
30 | ...
31 | Documentation | *Tenant 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 | ${vni_blue}= | 23
49 | ${vni_red}= | 24
50
51 | ${bid_b}= | 23
52 | ${bid_r}= | 24
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 | L2 test cases with tenant networks (VXLAN)
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 Configure path in 3-node circular topology
81 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
82 | | And Set Interface Address
83 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if_ip} | ${prefix_length}
84 | | And Set Interface Address
85 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_if_ip} | ${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 Configure QEMU vhost and run it | ${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 Configure QEMU vhost and run it | ${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 VXLAN and BD on Dut | ${dut1_node} | ${dut1_if_ip} | ${dut2_if_ip}
133 | | ... | @{dut1_vhosts}
134 | | And Setup VXLAN and BD on Dut | ${dut2_node} | ${dut2_if_ip} | ${dut1_if_ip}
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 VXLAN and BD on Dut
147 | | [Documentation] | Setup VXLAN and bridge domain on specific DUT and
148 | | ... | subsequently interconnect them properly.
149 | | ...
150 | | ... | *Arguments:*
151 | | ... | - dut_node - Node where to setup vxlan and BD. Type: dict
152 | | ... | - src_ip - Source IP for VXLAN. Type: string
153 | | ... | - dst_ip - Destination IP for vxlan. Type: string
154 | | ... | - vhosts - List containing vhost interfaces.
155 | | ...
156 | | ... | *Example:*
157 | | ...
158 | | ... | \| Setup VXLAN and BD on Dut \| ${dut_node} \| 16.0.0.1 \| 16.0.0.1 \
159 | | ... | \| @{vhosts} \|
160 | | ...
161 | | [Arguments] | ${dut_node} | ${src_ip} | ${dst_ip} | @{vhosts}
162 | | Create bridge domain
163 | | ... | ${dut_node} | ${bid_b} | learn=${TRUE}
164 | | Create bridge domain
165 | | ... | ${dut_node} | ${bid_r} | learn=${TRUE}
166 | | ${vxlan1_if}= | Create VXLAN interface | ${dut_node} | ${vni_blue}
167 | | ... | ${src_ip} | ${dst_ip}
168 | | ${vxlan2_if}= | Create VXLAN interface | ${dut_node} | ${vni_red}
169 | | ... | ${src_ip} | ${dst_ip}
170 | | Add interface to bridge domain
171 | | ... | ${dut_node} | ${vxlan1_if} | ${bid_b} | 0
172 | | Add interface to bridge domain
173 | | ... | ${dut_node} | @{vhosts}[0] | ${bid_b} | 0
174 | | Add interface to bridge domain
175 | | ... | ${dut_node} | @{vhosts}[1] | ${bid_b} | 0
176 | | Add interface to bridge domain
177 | | ... | ${dut_node} | ${vxlan2_if} | ${bid_r} | 0
178 | | Add interface to bridge domain
179 | | ... | ${dut_node} | @{vhosts}[2] | ${bid_r} | 0
180 | | Add interface to bridge domain
181 | | ... | ${dut_node} | @{vhosts}[3] | ${bid_r} | 0
182
183 | Positive Scenario Ping From DUT1 - Intra network
184 | | [Documentation] | Send ping packets from specified namespaces to other in
185 | | ... | order to test connectivity.
186 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} | ${namespace1}
187 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} | ${namespace2}
188 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} | ${namespace3}
189 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} | ${namespace4}
190
191 | Positive Scenario Ping From DUT1 - Inter network
192 | | [Documentation] | Send ping packets from specified namespaces to other in
193 | | ... | order to test connectivity.
194 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace1}
195 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace1}
196 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace2}
197 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace2}
198 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace3}
199 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace3}
200 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace4}
201 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace4}
202
203 | Positive Scenario Ping From DUT2 - Intra network
204 | | [Documentation] | Send ping packets from specified namespaces to other in
205 | | ... | order to test connectivity.
206 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} | ${namespace1}
207 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} | ${namespace2}
208 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} | ${namespace3}
209 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} | ${namespace4}
210
211 | Positive Scenario Ping From DUT2 - Inter network
212 | | [Documentation] | Send ping packets from specified namespaces to other in
213 | | ... | order to test connectivity.
214 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace1}
215 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace1}
216 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace2}
217 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace2}
218 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace3}
219 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace3}
220 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace4}
221 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace4}
222
223 | Negative Scenario Ping From DUT1 - Intra network
224 | | [Documentation] | Send ping packets from specified namespaces to other in
225 | | ... | order to test unreachability of namespaces.
226 | | Run keyword and expect error | Ping Not Successful
227 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1}
228 | | ... | ${namespace1}
229 | | Run keyword and expect error | Ping Not Successful
230 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2}
231 | | ... | ${namespace1}
232 | | Run keyword and expect error | Ping Not Successful
233 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1}
234 | | ... | ${namespace2}
235 | | Run keyword and expect error | Ping Not Successful
236 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2}
237 | | ... | ${namespace2}
238 | | Run keyword and expect error | Ping Not Successful
239 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1}
240 | | ... | ${namespace3}
241 | | Run keyword and expect error | Ping Not Successful
242 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2}
243 | | ... | ${namespace3}
244 | | Run keyword and expect error | Ping Not Successful
245 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1}
246 | | ... | ${namespace4}
247 | | Run keyword and expect error | Ping Not Successful
248 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2}
249 | | ... | ${namespace4}
250
251 | Negative Scenario Ping From DUT1 - Inter network
252 | | [Documentation] | Send ping packets from specified namespaces to other in
253 | | ... | order to test unreachability of namespaces.
254 | | Run keyword and expect error | Ping Not Successful
255 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1}
256 | | ... | ${namespace1}
257 | | Run keyword and expect error | Ping Not Successful
258 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2}
259 | | ... | ${namespace1}
260 | | Run keyword and expect error | Ping Not Successful
261 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1}
262 | | ... | ${namespace2}
263 | | Run keyword and expect error | Ping Not Successful
264 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2}
265 | | ... | ${namespace2}
266 | | Run keyword and expect error | Ping Not Successful
267 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1}
268 | | ... | ${namespace3}
269 | | Run keyword and expect error | Ping Not Successful
270 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2}
271 | | ... | ${namespace3}
272 | | Run keyword and expect error | Ping Not Successful
273 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1}
274 | | ... | ${namespace4}
275 | | Run keyword and expect error | Ping Not Successful
276 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2}
277 | | ... | ${namespace4}
278
279 | Negative Scenario Ping From DUT2 - Intra network
280 | | [Documentation] | Send ping packets from specified namespaces to other in
281 | | ... | order to test unreachability of namespaces.
282 | | Run keyword and expect error | Ping Not Successful
283 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1}
284 | | ... | ${namespace1}
285 | | Run keyword and expect error | Ping Not Successful
286 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2}
287 | | ... | ${namespace1}
288 | | Run keyword and expect error | Ping Not Successful
289 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1}
290 | | ... | ${namespace2}
291 | | Run keyword and expect error | Ping Not Successful
292 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2}
293 | | ... | ${namespace2}
294 | | Run keyword and expect error | Ping Not Successful
295 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1}
296 | | ... | ${namespace3}
297 | | Run keyword and expect error | Ping Not Successful
298 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2}
299 | | ... | ${namespace3}
300 | | Run keyword and expect error | Ping Not Successful
301 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1}
302 | | ... | ${namespace4}
303 | | Run keyword and expect error | Ping Not Successful
304 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2}
305 | | ... | ${namespace4}
306
307 | Negative Scenario Ping From DUT2 - Inter network
308 | | [Documentation] | Send ping packets from specified namespaces to other in
309 | | ... | order to test unreachability of namespaces.
310 | | Run keyword and expect error | Ping Not Successful
311 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1}
312 | | ... | ${namespace1}
313 | | Run keyword and expect error | Ping Not Successful
314 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2}
315 | | ... | ${namespace1}
316 | | Run keyword and expect error | Ping Not Successful
317 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1}
318 | | ... | ${namespace2}
319 | | Run keyword and expect error | Ping Not Successful
320 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2}
321 | | ... | ${namespace2}
322 | | Run keyword and expect error | Ping Not Successful
323 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1}
324 | | ... | ${namespace3}
325 | | Run keyword and expect error | Ping Not Successful
326 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2}
327 | | ... | ${namespace3}
328 | | Run keyword and expect error | Ping Not Successful
329 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1}
330 | | ... | ${namespace4}
331 | | Run keyword and expect error | Ping Not Successful
332 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2}
333 | | ... | ${namespace4}