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