CSIT-662: KWI - KW renaming
[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 | 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 | *Tenant 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 | ${vni_blue}= | 23
52 | ${vni_red}= | 24
53
54 | ${bid_b}= | 23
55 | ${bid_r}= | 24
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 | L2 test cases with tenant networks (VXLAN)
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
84 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
85 | | And Set Interface Address
86 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_if_ip} | ${prefix_length}
87 | | And Set Interface Address
88 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_if_ip} | ${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 VXLAN and BD on Dut | ${dut1_node} | ${dut1_if_ip} | ${dut2_if_ip}
136 | | ... | @{dut1_vhosts}
137 | | And Setup VXLAN and BD on Dut | ${dut2_node} | ${dut2_if_ip} | ${dut1_if_ip}
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 VXLAN and BD on Dut
150 | | [Documentation] | Setup VXLAN and bridge domain on specific DUT and
151 | | ...             | subsequently interconnect them properly.
152 | | ...
153 | | ... | *Arguments:*
154 | | ... | - dut_node - Node where to setup vxlan and BD. Type: dict
155 | | ... | - src_ip - Source IP for VXLAN. Type: string
156 | | ... | - dst_ip - Destination IP for vxlan. Type: string
157 | | ... | - vhosts - List containing vhost interfaces.
158 | | ...
159 | | ... | *Example:*
160 | | ...
161 | | ... | \| Setup VXLAN and BD on Dut \| ${dut_node} \| 16.0.0.1 \| 16.0.0.1 \
162 | | ... | \| @{vhosts} \|
163 | | ...
164 | | [Arguments] | ${dut_node} | ${src_ip} | ${dst_ip} | @{vhosts}
165 | | Create bridge domain
166 | | ... | ${dut_node} | ${bid_b} | learn=${TRUE}
167 | | Create bridge domain
168 | | ... | ${dut_node} | ${bid_r} | learn=${TRUE}
169 | | ${vxlan1_if}= | Create VXLAN interface     | ${dut_node} | ${vni_blue}
170 | |                 | ...  | ${src_ip} | ${dst_ip}
171 | | ${vxlan2_if}= | Create VXLAN interface     | ${dut_node} | ${vni_red}
172 | |                 | ...  | ${src_ip} | ${dst_ip}
173 | | Add interface to bridge domain
174 | | ... | ${dut_node} | ${vxlan1_if} | ${bid_b} | 0
175 | | Add interface to bridge domain
176 | | ... | ${dut_node} | @{vhosts}[0] | ${bid_b} | 0
177 | | Add interface to bridge domain
178 | | ... | ${dut_node} | @{vhosts}[1] | ${bid_b} | 0
179 | | Add interface to bridge domain
180 | | ... | ${dut_node} | ${vxlan2_if} | ${bid_r} | 0
181 | | Add interface to bridge domain
182 | | ... | ${dut_node} | @{vhosts}[2] | ${bid_r} | 0
183 | | Add interface to bridge domain
184 | | ... | ${dut_node} | @{vhosts}[3] | ${bid_r} | 0
185
186 | Positive Scenario Ping From DUT1 - Intra network
187 | | [Documentation] | Send ping packets from specified namespaces to other in
188 | | ...             | order to test connectivity.
189 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2} | ${namespace1}
190 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1} | ${namespace2}
191 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2} | ${namespace3}
192 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1} | ${namespace4}
193
194 | Positive Scenario Ping From DUT1 - Inter 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} | ${dut2_blue1} | ${namespace1}
198 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace1}
199 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue1} | ${namespace2}
200 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_blue2} | ${namespace2}
201 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace3}
202 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace3}
203 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red1} | ${namespace4}
204 | | Send Ping From Node To Dst | ${qemu_node1} | ${dut2_red2} | ${namespace4}
205
206 | Positive Scenario Ping From DUT2 - Intra network
207 | | [Documentation] | Send ping packets from specified namespaces to other in
208 | | ...             | order to test connectivity.
209 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue2} | ${namespace1}
210 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_blue1} | ${namespace2}
211 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red2} | ${namespace3}
212 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut2_red1} | ${namespace4}
213
214 | Positive Scenario Ping From DUT2 - Inter 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} | ${dut1_blue1} | ${namespace1}
218 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace1}
219 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1} | ${namespace2}
220 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2} | ${namespace2}
221 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace3}
222 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace3}
223 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1} | ${namespace4}
224 | | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2} | ${namespace4}
225
226 | Negative Scenario Ping From DUT1 - Intra network
227 | | [Documentation] | Send ping packets from specified namespaces to other in
228 | | ...             | order to test unreachability of namespaces.
229 | | Run keyword and expect error | Ping Not Successful
230 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1}
231 | | ... | ${namespace1}
232 | | Run keyword and expect error | Ping Not Successful
233 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2}
234 | | ... | ${namespace1}
235 | | Run keyword and expect error | Ping Not Successful
236 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red1}
237 | | ... | ${namespace2}
238 | | Run keyword and expect error | Ping Not Successful
239 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_red2}
240 | | ... | ${namespace2}
241 | | Run keyword and expect error | Ping Not Successful
242 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1}
243 | | ... | ${namespace3}
244 | | Run keyword and expect error | Ping Not Successful
245 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2}
246 | | ... | ${namespace3}
247 | | Run keyword and expect error | Ping Not Successful
248 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue1}
249 | | ... | ${namespace4}
250 | | Run keyword and expect error | Ping Not Successful
251 | | ... | Send Ping From Node To Dst | ${qemu_node1} | ${dut1_blue2}
252 | | ... | ${namespace4}
253
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
312 | Negative Scenario Ping From DUT2 - Inter network
313 | | [Documentation] | Send ping packets from specified namespaces to other in
314 | | ...             | order to test unreachability of namespaces.
315 | | Run keyword and expect error | Ping Not Successful
316 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1}
317 | | ... | ${namespace1}
318 | | Run keyword and expect error | Ping Not Successful
319 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2}
320 | | ... | ${namespace1}
321 | | Run keyword and expect error | Ping Not Successful
322 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red1}
323 | | ... | ${namespace2}
324 | | Run keyword and expect error | Ping Not Successful
325 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_red2}
326 | | ... | ${namespace2}
327 | | Run keyword and expect error | Ping Not Successful
328 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1}
329 | | ... | ${namespace3}
330 | | Run keyword and expect error | Ping Not Successful
331 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2}
332 | | ... | ${namespace3}
333 | | Run keyword and expect error | Ping Not Successful
334 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue1}
335 | | ... | ${namespace4}
336 | | Run keyword and expect error | Ping Not Successful
337 | | ... | Send Ping From Node To Dst | ${qemu_node2} | ${dut1_blue2}
338 | | ... | ${namespace4}