47728d73c78130cc31ca88f7525513738316b7ad
[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 | 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 | *Tenant 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 | ${vni_blue}= | 23
45 | ${vni_red}= | 24
46
47 | ${bid_b}= | 23
48 | ${bid_r}= | 24
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 | L2 test cases with tenant networks (VXLAN)
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
77 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
78 | | And Set Interface Address
79 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if_ip} | ${prefix_length}
80 | | And Set Interface Address
81 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_if_ip} | ${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 VXLAN and BD on Dut | ${dut1_node} | ${dut1_if_ip} | ${dut2_if_ip}
129 | | ... | @{dut1_vhosts}
130 | | And Setup VXLAN and BD on Dut | ${dut2_node} | ${dut2_if_ip} | ${dut1_if_ip}
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 VXLAN and BD on Dut
143 | | [Documentation] | Setup VXLAN and bridge domain on specific DUT and
144 | | ... | subsequently interconnect them properly.
145 | | ...
146 | | ... | *Arguments:*
147 | | ... | - dut_node - Node where to setup vxlan and BD. Type: dict
148 | | ... | - src_ip - Source IP for VXLAN. Type: string
149 | | ... | - dst_ip - Destination IP for vxlan. Type: string
150 | | ... | - vhosts - List containing vhost interfaces.
151 | | ...
152 | | ... | *Example:*
153 | | ...
154 | | ... | \| Setup VXLAN and BD on Dut \| ${dut_node} \| 16.0.0.1 \| 16.0.0.1 \
155 | | ... | \| @{vhosts} \|
156 | | ...
157 | | [Arguments] | ${dut_node} | ${src_ip} | ${dst_ip} | @{vhosts}
158 | | Create bridge domain
159 | | ... | ${dut_node} | ${bid_b} | learn=${TRUE}
160 | | Create bridge domain
161 | | ... | ${dut_node} | ${bid_r} | learn=${TRUE}
162 | | ${vxlan1_if}= | Create VXLAN interface | ${dut_node} | ${vni_blue}
163 | | ... | ${src_ip} | ${dst_ip}
164 | | ${vxlan2_if}= | Create VXLAN interface | ${dut_node} | ${vni_red}
165 | | ... | ${src_ip} | ${dst_ip}
166 | | Add interface to bridge domain
167 | | ... | ${dut_node} | ${vxlan1_if} | ${bid_b} | 0
168 | | Add interface to bridge domain
169 | | ... | ${dut_node} | @{vhosts}[0] | ${bid_b} | 0
170 | | Add interface to bridge domain
171 | | ... | ${dut_node} | @{vhosts}[1] | ${bid_b} | 0
172 | | Add interface to bridge domain
173 | | ... | ${dut_node} | ${vxlan2_if} | ${bid_r} | 0
174 | | Add interface to bridge domain
175 | | ... | ${dut_node} | @{vhosts}[2] | ${bid_r} | 0
176 | | Add interface to bridge domain
177 | | ... | ${dut_node} | @{vhosts}[3] | ${bid_r} | 0
178
179 | Positive Scenario Ping From DUT1 - Intra network
180 | | [Documentation] | Send ping packets from specified namespaces to other in
181 | | ... | order to test connectivity.
182 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} | ${namespace1}
183 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} | ${namespace2}
184 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} | ${namespace3}
185 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} | ${namespace4}
186
187 | Positive Scenario Ping From DUT1 - Inter 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} | ${dut2_blue1} | ${namespace1}
191 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace1}
192 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace2}
193 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace2}
194 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace3}
195 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace3}
196 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace4}
197 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace4}
198
199 | Positive Scenario Ping From DUT2 - Intra network
200 | | [Documentation] | Send ping packets from specified namespaces to other in
201 | | ... | order to test connectivity.
202 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} | ${namespace1}
203 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} | ${namespace2}
204 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} | ${namespace3}
205 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} | ${namespace4}
206
207 | Positive Scenario Ping From DUT2 - Inter 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} | ${dut1_blue1} | ${namespace1}
211 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace1}
212 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace2}
213 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace2}
214 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace3}
215 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace3}
216 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace4}
217 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace4}
218
219 | Negative Scenario Ping From DUT1 - Intra network
220 | | [Documentation] | Send ping packets from specified namespaces to other in
221 | | ... | order to test unreachability of namespaces.
222 | | Run keyword and expect error | Ping Not Successful
223 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1}
224 | | ... | ${namespace1}
225 | | Run keyword and expect error | Ping Not Successful
226 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2}
227 | | ... | ${namespace1}
228 | | Run keyword and expect error | Ping Not Successful
229 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1}
230 | | ... | ${namespace2}
231 | | Run keyword and expect error | Ping Not Successful
232 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2}
233 | | ... | ${namespace2}
234 | | Run keyword and expect error | Ping Not Successful
235 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1}
236 | | ... | ${namespace3}
237 | | Run keyword and expect error | Ping Not Successful
238 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2}
239 | | ... | ${namespace3}
240 | | Run keyword and expect error | Ping Not Successful
241 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1}
242 | | ... | ${namespace4}
243 | | Run keyword and expect error | Ping Not Successful
244 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2}
245 | | ... | ${namespace4}
246
247 | Negative Scenario Ping From DUT1 - Inter network
248 | | [Documentation] | Send ping packets from specified namespaces to other in
249 | | ... | order to test unreachability of namespaces.
250 | | Run keyword and expect error | Ping Not Successful
251 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1}
252 | | ... | ${namespace1}
253 | | Run keyword and expect error | Ping Not Successful
254 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2}
255 | | ... | ${namespace1}
256 | | Run keyword and expect error | Ping Not Successful
257 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1}
258 | | ... | ${namespace2}
259 | | Run keyword and expect error | Ping Not Successful
260 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2}
261 | | ... | ${namespace2}
262 | | Run keyword and expect error | Ping Not Successful
263 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1}
264 | | ... | ${namespace3}
265 | | Run keyword and expect error | Ping Not Successful
266 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2}
267 | | ... | ${namespace3}
268 | | Run keyword and expect error | Ping Not Successful
269 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1}
270 | | ... | ${namespace4}
271 | | Run keyword and expect error | Ping Not Successful
272 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2}
273 | | ... | ${namespace4}
274
275 | Negative Scenario Ping From DUT2 - Intra network
276 | | [Documentation] | Send ping packets from specified namespaces to other in
277 | | ... | order to test unreachability of namespaces.
278 | | Run keyword and expect error | Ping Not Successful
279 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1}
280 | | ... | ${namespace1}
281 | | Run keyword and expect error | Ping Not Successful
282 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2}
283 | | ... | ${namespace1}
284 | | Run keyword and expect error | Ping Not Successful
285 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1}
286 | | ... | ${namespace2}
287 | | Run keyword and expect error | Ping Not Successful
288 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2}
289 | | ... | ${namespace2}
290 | | Run keyword and expect error | Ping Not Successful
291 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1}
292 | | ... | ${namespace3}
293 | | Run keyword and expect error | Ping Not Successful
294 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2}
295 | | ... | ${namespace3}
296 | | Run keyword and expect error | Ping Not Successful
297 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1}
298 | | ... | ${namespace4}
299 | | Run keyword and expect error | Ping Not Successful
300 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2}
301 | | ... | ${namespace4}
302
303 | Negative Scenario Ping From DUT2 - Inter network
304 | | [Documentation] | Send ping packets from specified namespaces to other in
305 | | ... | order to test unreachability of namespaces.
306 | | Run keyword and expect error | Ping Not Successful
307 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1}
308 | | ... | ${namespace1}
309 | | Run keyword and expect error | Ping Not Successful
310 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2}
311 | | ... | ${namespace1}
312 | | Run keyword and expect error | Ping Not Successful
313 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1}
314 | | ... | ${namespace2}
315 | | Run keyword and expect error | Ping Not Successful
316 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2}
317 | | ... | ${namespace2}
318 | | Run keyword and expect error | Ping Not Successful
319 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1}
320 | | ... | ${namespace3}
321 | | Run keyword and expect error | Ping Not Successful
322 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2}
323 | | ... | ${namespace3}
324 | | Run keyword and expect error | Ping Not Successful
325 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1}
326 | | ... | ${namespace4}
327 | | Run keyword and expect error | Ping Not Successful
328 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2}
329 | | ... | ${namespace4}