2 Documentation Tests for HTTP flow
3 Force Tags multi-tenant http multi-tenant-main
5 Resource ../../../../../libraries/Utils.robot
6 Resource ../../../../../libraries/GBP/ConnUtils.robot
7 Resource ../../../../../libraries/GBP/DockerUtils.robot
8 Resource ../../../../../libraries/GBP/OpenFlowUtils.robot
9 Variables ../../../../../variables/Variables.py
10 Resource ../Variables.robot
16 Setting Variables for Tenant 1
17 [Documentation] Setting variables for test cases related to tenant 1.
18 # Same subnet tests are not supported by current topology configuration;
19 # clients and webservers are put in two different subnets
20 Set Test Variables client_switch_ip=${GBP1} client_docker=h35_2 client_ip=10.0.35.2 client_mac=00:00:00:00:35:02 same_webserver_docker=h36_3 same_webserver_ip=10.0.36.3
21 ... same_webserver_mac=00:00:00:00:36:03 diff_webserver_switch_ip=${GBP3} diff_webserver_docker=h36_2 diff_webserver_ip=10.0.36.2 diff_webserver_mac=00:00:00:00:36:02
23 Tenant 1 Same switch, start SimpleHttpServer on h36_3
24 [Documentation] Same Switch (sw1)
26 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
27 DockerUtils.Start HTTP Service on Docker ${SAME_WEBSERVER_DOCKER} 80
28 SSHLibrary.Close Connection
30 Tenant 1 Same switch, curl once from h35_2 to h36_3
31 [Documentation] Test HTTP req/rest session between docker located on the same switch.
33 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
34 DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
35 SSHLibrary.Close Connection
37 Tenant 1 Same switch, start endless curl from h35_2 to h36_3
38 [Documentation] Init of endless HTTP session between endpoints so that
39 ... HTTP traffic can be inspected.
41 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
42 DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
43 SSHLibrary.Close Connection
45 Tenant 1 Same switch, HTTP request ovs-dpctl output check on sw1
46 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_3
48 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
49 @{matches} Create List
50 @{actions} Create List
51 Append In Port Check ${matches} 4
52 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
53 Append Ether-Type Check ${matches} 0x0800
54 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
55 Append Proto Check ${matches} 6
56 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC}
57 Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
58 Append Proto Check ${actions} 6
59 Append Out Port Check ${actions} 7
60 ${output} Find Flow in DPCTL Output ${matches} ${actions}
61 SSHLibrary.Close Connection
63 Tenant 1 Same switch, HTTP reply ovs-dpctl output check on sw1
64 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_3 to h35_2
66 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
67 @{matches} Create List
68 @{actions} Create List
69 Append In Port Check ${matches} 7
70 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC}
71 Append Ether-Type Check ${matches} 0x0800
72 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
73 Append Proto Check ${matches} 6
74 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
75 Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
76 Append Proto Check ${actions} 6
77 Append Out Port Check ${actions} 4
78 ${output} Find Flow in DPCTL Output ${matches} ${actions}
79 SSHLibrary.Close Connection
81 Tenant 1 Same switch, stop endless curl from h35_2 to h36_3
82 [Documentation] Stopping endless HTTP session after traffic inspection is done.
84 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
85 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
86 SSHLibrary.Close Connection
88 Tenant 1 Same switch, stop SimpleHttpServer on h36_3
89 [Documentation] Stoping HTTP service on docker container.
91 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
92 DockerUtils.Stop HTTP Service on Docker ${SAME_WEBSERVER_DOCKER}
93 SSHLibrary.Close Connection
95 Tenant 1 Different switches, start SimpleHttpServer on h36_2
96 [Documentation] Different switches (sw1 -> sw3)
98 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
99 DockerUtils.Start HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER} 80
100 SSHLibrary.Close Connection
102 Tenant 1 Different switches, curl once from h35_2 to h36_2
103 [Documentation] Test HTTP req/resp between endpoints located on different switches.
105 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
106 DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80
107 SSHLibrary.Close Connection
109 Tenant 1 Different switches, start endless curl from h35_2 to h36_2
111 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
112 DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80
113 SSHLibrary.Close Connection
115 Tenant 1 Different switches, HTTP request ovs-dpctl output check on sw1
116 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_2
118 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
119 @{matches} Create List
120 @{actions} Create List
121 Append In Port Check ${matches} 4
122 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
123 Append Ether-Type Check ${matches} 0x0800
124 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
125 Append Proto Check ${matches} 6
126 Append Tunnel Set Check ${actions}
127 Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC}
128 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
129 Append Proto Check ${actions} 6
130 Append Out Port Check ${actions} 3
131 ${output} Find Flow in DPCTL Output ${matches} ${actions}
132 SSHLibrary.Close Connection
134 Tenant 1 Different switches, HTTP request ovs-dpctl output check on sw3
135 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_2
137 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
138 @{matches} Create List
139 @{actions} Create List
140 Append Tunnel Set Check ${matches}
141 Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP}
142 Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP}
143 Append In Port Check ${matches} 3
144 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC}
145 Append Ether-Type Check ${matches} 0x0800
146 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
147 Append Proto Check ${matches} 6
148 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
149 Append Proto Check ${actions} 6
150 Append Out Port Check ${actions} 6
151 ${output} Find Flow in DPCTL Output ${matches} ${actions}
152 SSHLibrary.Close Connection
154 Tenant 1 Different switches, HTTP reply ovs-dpctl output check on sw3
155 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_2 to h35_2
157 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
158 @{matches} Create List
159 @{actions} Create List
160 Append In Port Check ${matches} 6
161 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC}
162 Append Ether-Type Check ${matches} 0x0800
163 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
164 Append Proto Check ${matches} 6
165 Append Tunnel Set Check ${actions}
166 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
167 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
168 Append Proto Check ${actions} 6
169 Append Out Port Check ${actions} 3
170 ${output} Find Flow in DPCTL Output ${matches} ${actions}
171 SSHLibrary.Close Connection
173 Tenant 1 Different switches, HTTP reply ovs-dpctl output check on sw1
174 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_2 to h35_2
176 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
177 @{matches} Create List
178 @{actions} Create List
179 Append Tunnel Set Check ${matches}
180 Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP}
181 Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP}
182 Append In Port Check ${matches} 3
183 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC}
184 Append Ether-Type Check ${matches} 0x0800
185 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
186 Append Proto Check ${matches} 6
187 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
188 Append Proto Check ${actions} 6
189 Append Out Port Check ${actions} 4
190 ${output} Find Flow in DPCTL Output ${matches} ${actions}
191 SSHLibrary.Close Connection
193 Tenant 1 Different switches, stop endless curl from h35_2 to h36_2
194 [Documentation] Stopping endless HTTP session when traffic inspection finishes.
196 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
197 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
198 SSHLibrary.Close Connection
200 Tenant 1 Different switches, stop SimpleHttpServer on h36_2
201 [Documentation] Terminating HTTP service on docker container.
203 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
204 DockerUtils.Stop HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER}
205 SSHLibrary.Close Connection
207 Setting Variables For Tenant 2
208 [Documentation] Setting variables for test cases related to tenant 1.
209 Set Test Variables client_switch_ip=${GBP1} client_docker=h35_8 client_ip=10.0.35.8 client_mac=00:00:00:00:35:08 same_webserver_docker=h36_6 same_webserver_ip=10.0.36.6
210 ... same_webserver_mac=00:00:00:00:36:06 diff_webserver_switch_ip=${GBP2} diff_webserver_docker=h36_7 diff_webserver_ip=10.0.36.7 diff_webserver_mac=00:00:00:00:36:07
212 Tenant 2 Same switch, start SimpleHttpServer on h36_6
213 [Documentation] Same Switch (sw1)
215 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
216 DockerUtils.Start HTTP Service on Docker ${SAME_WEBSERVER_DOCKER} 80
217 SSHLibrary.Close Connection
219 Tenant 2 Same switch, curl once from h35_8 to h36_6
220 [Documentation] Test HTTP req/resp between endpoints on the same switch.
222 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
223 DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
224 SSHLibrary.Close Connection
226 Tenant 2 Same switch, start endless curl from h35_8 to h36_6
227 [Documentation] Init if endless HTTP Session between endpoints on the same switch.
229 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
230 DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
231 SSHLibrary.Close Connection
233 Tenant 2 Same switch, HTTP request ovs-dpctl output check on sw1
234 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_6
236 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
237 @{matches} Create List
238 @{actions} Create List
239 Append In Port Check ${matches} 6
240 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
241 Append Ether-Type Check ${matches} 0x0800
242 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
243 Append Proto Check ${matches} 6
244 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC}
245 Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
246 Append Proto Check ${actions} 6
247 Append Out Port Check ${actions} 8
248 ${output} Find Flow in DPCTL Output ${matches} ${actions}
249 SSHLibrary.Close Connection
251 Tenant 2 Same switch, HTTP reply ovs-dpctl output check on sw1
252 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_6 to h35_8
254 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
255 @{matches} Create List
256 @{actions} Create List
257 Append In Port Check ${matches} 8
258 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC}
259 Append Ether-Type Check ${matches} 0x0800
260 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
261 Append Proto Check ${matches} 6
262 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
263 Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
264 Append Proto Check ${actions} 6
265 Append Out Port Check ${actions} 6
266 ${output} Find Flow in DPCTL Output ${matches} ${actions}
267 SSHLibrary.Close Connection
269 Tenant 2 Same switch, stop endless curl from h35_8 to h36_6
270 [Documentation] Terminating endless HTTP session after traffic inspection is done.
272 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
273 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
274 SSHLibrary.Close Connection
276 Tenant 2 Same switch, stop SimpleHttpServer on h36_6
277 [Documentation] Stoping HTTP service on serving docker container.
279 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
280 DockerUtils.Stop HTTP Service on Docker ${SAME_WEBSERVER_DOCKER}
281 SSHLibrary.Close Connection
283 Tenant 2 Different switches, start SimpleHttpServer on h36_7
284 [Documentation] Different switches (sw1 -> sw3)
286 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
287 DockerUtils.Start HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER} 80
288 SSHLibrary.Close Connection
290 Tenant 2 Different switches, curl once from h35_8 to h36_7
291 [Documentation] Test HTTP req/resp between endpoints located on different switches.
293 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
294 DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80
295 SSHLibrary.Close Connection
297 Tenant 2 Different switches, start endless curl from h35_8 to h36_7
298 [Documentation] Starting endless HTTP session so that the traffic can be inspected.
300 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
301 DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80
302 SSHLibrary.Close Connection
304 Tenant 2 Different switches, HTTP request ovs-dpctl output check on sw1
305 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_7
307 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
308 @{matches} Create List
309 @{actions} Create List
310 Append In Port Check ${matches} 6
311 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
312 Append Ether-Type Check ${matches} 0x0800
313 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
314 Append Proto Check ${matches} 6
315 Append Tunnel Set Check ${actions}
316 Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC}
317 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
318 Append Proto Check ${actions} 6
319 Append Out Port Check ${actions} 3
320 ${output} Find Flow in DPCTL Output ${matches} ${actions}
321 SSHLibrary.Close Connection
323 Tenant 2 Different switches, HTTP request ovs-dpctl output check on sw3
324 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_7
326 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
327 @{matches} Create List
328 @{actions} Create List
329 Append Tunnel Set Check ${matches}
330 Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP}
331 Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP}
332 Append In Port Check ${matches} 3
333 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC}
334 Append Ether-Type Check ${matches} 0x0800
335 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
336 Append Proto Check ${matches} 6
337 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
338 Append Proto Check ${actions} 6
339 Append Out Port Check ${actions} 8
340 ${output} Find Flow in DPCTL Output ${matches} ${actions}
341 SSHLibrary.Close Connection
343 Tenant 2 Different switches, HTTP reply ovs-dpctl output check on sw3
344 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_7 to h35_8
346 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
347 @{matches} Create List
348 @{actions} Create List
349 Append In Port Check ${matches} 8
350 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC}
351 Append Ether-Type Check ${matches} 0x0800
352 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
353 Append Proto Check ${matches} 6
354 Append Tunnel Set Check ${actions}
355 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
356 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
357 Append Proto Check ${actions} 6
358 Append Out Port Check ${actions} 3
359 ${output} Find Flow in DPCTL Output ${matches} ${actions}
360 SSHLibrary.Close Connection
362 Tenant 2 Different switches, HTTP reply ovs-dpctl output check on sw1
363 [Documentation] Assert matches and actions on megaflow of HTTP reply from h36_7 to h35_8
365 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
366 @{matches} Create List
367 @{actions} Create List
368 Append Tunnel Set Check ${matches}
369 Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP}
370 Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP}
371 Append In Port Check ${matches} 3
372 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC}
373 Append Ether-Type Check ${matches} 0x0800
374 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
375 Append Proto Check ${matches} 6
376 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
377 Append Proto Check ${actions} 6
378 Append Out Port Check ${actions} 6
379 ${output} Find Flow in DPCTL Output ${matches} ${actions}
380 SSHLibrary.Close Connection
382 Tenant 2 Different switches, stop endless curl from h35_8 to h36_7
383 [Documentation] Terminanting endless HTTP session after traffic inspection
386 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
387 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
388 SSHLibrary.Close Connection
390 Tenant 2 Different switches, stop SimpleHttpServer on h36_7
391 [Documentation] Stopping HTTP service on docker container.
393 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
394 DockerUtils.Stop HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER}
395 SSHLibrary.Close Connection