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
17 # Same subnet tests are not supported by current topology configuration;
18 # clients and webservers are put in two different subnets
20 Setting Variables for Tenant 1
21 [Documentation] Setting variables for test cases related to tenant 1.
22 Set Test Variables client_switch_ip=${GBP1} client_docker=h35_2 client_ip=10.0.35.2
23 ... client_mac=00:00:00:00:35:02 same_webserver_docker=h36_3 same_webserver_ip=10.0.36.3
24 ... same_webserver_mac=00:00:00:00:36:03 diff_webserver_switch_ip=${GBP3}
25 ... diff_webserver_docker=h36_2 diff_webserver_ip=10.0.36.2
26 ... diff_webserver_mac=00:00:00:00:36:02
28 Tenant 1 Same switch, start SimpleHttpServer on h36_3
29 [Documentation] Same Switch (sw1)
31 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
32 DockerUtils.Start HTTP Service on Docker ${SAME_WEBSERVER_DOCKER} 80
33 SSHLibrary.Close Connection
35 Tenant 1 Same switch, curl once from h35_2 to h36_3
37 [Documentation] Test HTTP req/rest session between docker located on the same switch.
38 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
39 DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
40 SSHLibrary.Close Connection
42 Tenant 1 Same switch, start endless curl from h35_2 to h36_3
44 [Documentation] Init of endless HTTP session between endpoints so that
45 ... HTTP traffic can be inspected.
46 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
47 DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
48 SSHLibrary.Close Connection
50 Tenant 1 Same switch, HTTP request ovs-dpctl output check on sw1
51 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_3
53 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
55 @{matches} Create List
56 @{actions} Create List
57 Append In Port Check ${matches} 4
58 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
59 Append Ether-Type Check ${matches} 0x0800
60 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
61 Append Proto Check ${matches} 6
63 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC}
64 Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
65 Append Proto Check ${actions} 6
66 Append Out Port Check ${actions} 7
68 ${output} Find Flow in DPCTL Output ${matches} ${actions}
70 SSHLibrary.Close Connection
72 Tenant 1 Same switch, HTTP reply ovs-dpctl output check on sw1
73 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_3 to h35_2
75 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
77 @{matches} Create List
78 @{actions} Create List
79 Append In Port Check ${matches} 7
80 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC}
81 Append Ether-Type Check ${matches} 0x0800
82 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
83 Append Proto Check ${matches} 6
85 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
86 Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
87 Append Proto Check ${actions} 6
88 Append Out Port Check ${actions} 4
90 ${output} Find Flow in DPCTL Output ${matches} ${actions}
92 SSHLibrary.Close Connection
94 Tenant 1 Same switch, stop endless curl from h35_2 to h36_3
96 [Documentation] Stopping endless HTTP session after traffic inspection is done.
97 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
98 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
99 SSHLibrary.Close Connection
101 Tenant 1 Same switch, stop SimpleHttpServer on h36_3
103 [Documentation] Stoping HTTP service on docker container.
104 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
105 DockerUtils.Stop HTTP Service on Docker ${SAME_WEBSERVER_DOCKER}
106 SSHLibrary.Close Connection
109 Tenant 1 Different switches, start SimpleHttpServer on h36_2
110 [Documentation] Different switches (sw1 -> sw3)
112 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
113 DockerUtils.Start HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER} 80
114 SSHLibrary.Close Connection
116 Tenant 1 Different switches, curl once from h35_2 to h36_2
118 [Documentation] Test HTTP req/resp between endpoints located on different switches.
119 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
120 DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80
121 SSHLibrary.Close Connection
123 Tenant 1 Different switches, start endless curl from h35_2 to h36_2
125 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
126 DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80
127 SSHLibrary.Close Connection
129 Tenant 1 Different switches, HTTP request ovs-dpctl output check on sw1
130 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_2
132 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
134 @{matches} Create List
135 @{actions} Create List
137 Append In Port Check ${matches} 4
138 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
139 Append Ether-Type Check ${matches} 0x0800
140 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
141 Append Proto Check ${matches} 6
143 Append Tunnel Set Check ${actions}
144 Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC}
145 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
146 Append Proto Check ${actions} 6
147 Append Out Port Check ${actions} 3
149 ${output} Find Flow in DPCTL Output ${matches} ${actions}
151 SSHLibrary.Close Connection
153 Tenant 1 Different switches, HTTP request ovs-dpctl output check on sw3
154 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_2
156 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
158 @{matches} Create List
159 @{actions} Create List
160 Append Tunnel Set Check ${matches}
161 Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP}
162 Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP}
163 Append In Port Check ${matches} 3
164 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC}
165 Append Ether-Type Check ${matches} 0x0800
166 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
167 Append Proto Check ${matches} 6
169 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
170 Append Proto Check ${actions} 6
171 Append Out Port Check ${actions} 6
173 ${output} Find Flow in DPCTL Output ${matches} ${actions}
175 SSHLibrary.Close Connection
177 Tenant 1 Different switches, HTTP reply ovs-dpctl output check on sw3
178 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_2 to h35_2
180 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
182 @{matches} Create List
183 @{actions} Create List
185 Append In Port Check ${matches} 6
186 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC}
187 Append Ether-Type Check ${matches} 0x0800
188 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
189 Append Proto Check ${matches} 6
191 Append Tunnel Set Check ${actions}
192 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
193 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
194 Append Proto Check ${actions} 6
195 Append Out Port Check ${actions} 3
197 ${output} Find Flow in DPCTL Output ${matches} ${actions}
199 SSHLibrary.Close Connection
201 Tenant 1 Different switches, HTTP reply ovs-dpctl output check on sw1
202 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_2 to h35_2
204 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
206 @{matches} Create List
207 @{actions} Create List
208 Append Tunnel Set Check ${matches}
209 Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP}
210 Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP}
211 Append In Port Check ${matches} 3
212 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC}
213 Append Ether-Type Check ${matches} 0x0800
214 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
215 Append Proto Check ${matches} 6
217 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
218 Append Proto Check ${actions} 6
219 Append Out Port Check ${actions} 4
221 ${output} Find Flow in DPCTL Output ${matches} ${actions}
223 SSHLibrary.Close Connection
225 Tenant 1 Different switches, stop endless curl from h35_2 to h36_2
227 [Documentation] Stopping endless HTTP session when traffic inspection finishes.
228 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
229 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
230 SSHLibrary.Close Connection
232 Tenant 1 Different switches, stop SimpleHttpServer on h36_2
234 [Documentation] Terminating HTTP service on docker container.
235 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
236 DockerUtils.Stop HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER}
237 SSHLibrary.Close Connection
240 Setting Variables For Tenant 2
241 [Documentation] Setting variables for test cases related to tenant 1.
242 Set Test Variables client_switch_ip=${GBP1} client_docker=h35_8 client_ip=10.0.35.8
243 ... client_mac=00:00:00:00:35:08 same_webserver_docker=h36_6 same_webserver_ip=10.0.36.6
244 ... same_webserver_mac=00:00:00:00:36:06 diff_webserver_switch_ip=${GBP2}
245 ... diff_webserver_docker=h36_7 diff_webserver_ip=10.0.36.7
246 ... diff_webserver_mac=00:00:00:00:36:07
248 Tenant 2 Same switch, start SimpleHttpServer on h36_6
249 [Documentation] Same Switch (sw1)
251 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
252 DockerUtils.Start HTTP Service on Docker ${SAME_WEBSERVER_DOCKER} 80
253 SSHLibrary.Close Connection
255 Tenant 2 Same switch, curl once from h35_8 to h36_6
257 [Documentation] Test HTTP req/resp between endpoints on the same switch.
258 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
259 DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
260 SSHLibrary.Close Connection
262 Tenant 2 Same switch, start endless curl from h35_8 to h36_6
264 [Documentation] Init if endless HTTP Session between endpoints on the same switch.
265 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
266 DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
267 SSHLibrary.Close Connection
269 Tenant 2 Same switch, HTTP request ovs-dpctl output check on sw1
270 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_6
272 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
274 @{matches} Create List
275 @{actions} Create List
276 Append In Port Check ${matches} 6
277 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
278 Append Ether-Type Check ${matches} 0x0800
279 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
280 Append Proto Check ${matches} 6
282 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC}
283 Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
284 Append Proto Check ${actions} 6
285 Append Out Port Check ${actions} 8
287 ${output} Find Flow in DPCTL Output ${matches} ${actions}
289 SSHLibrary.Close Connection
291 Tenant 2 Same switch, HTTP reply ovs-dpctl output check on sw1
292 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_6 to h35_8
294 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
296 @{matches} Create List
297 @{actions} Create List
298 Append In Port Check ${matches} 8
299 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC}
300 Append Ether-Type Check ${matches} 0x0800
301 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
302 Append Proto Check ${matches} 6
304 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
305 Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
306 Append Proto Check ${actions} 6
307 Append Out Port Check ${actions} 6
309 ${output} Find Flow in DPCTL Output ${matches} ${actions}
311 SSHLibrary.Close Connection
313 Tenant 2 Same switch, stop endless curl from h35_8 to h36_6
315 [Documentation] Terminating endless HTTP session after traffic inspection is done.
316 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
317 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
318 SSHLibrary.Close Connection
320 Tenant 2 Same switch, stop SimpleHttpServer on h36_6
322 [Documentation] Stoping HTTP service on serving docker container.
323 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
324 DockerUtils.Stop HTTP Service on Docker ${SAME_WEBSERVER_DOCKER}
325 SSHLibrary.Close Connection
327 Tenant 2 Different switches, start SimpleHttpServer on h36_7
328 [Documentation] Different switches (sw1 -> sw3)
330 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
331 DockerUtils.Start HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER} 80
332 SSHLibrary.Close Connection
334 Tenant 2 Different switches, curl once from h35_8 to h36_7
336 [Documentation] Test HTTP req/resp between endpoints located on different switches.
337 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
338 DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80
339 SSHLibrary.Close Connection
341 Tenant 2 Different switches, start endless curl from h35_8 to h36_7
343 [Documentation] Starting endless HTTP session so that the traffic can be inspected.
344 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
345 DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80
346 SSHLibrary.Close Connection
348 Tenant 2 Different switches, HTTP request ovs-dpctl output check on sw1
349 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_7
351 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
353 @{matches} Create List
354 @{actions} Create List
356 Append In Port Check ${matches} 6
357 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
358 Append Ether-Type Check ${matches} 0x0800
359 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
360 Append Proto Check ${matches} 6
362 Append Tunnel Set Check ${actions}
363 Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC}
364 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
365 Append Proto Check ${actions} 6
366 Append Out Port Check ${actions} 3
368 ${output} Find Flow in DPCTL Output ${matches} ${actions}
370 SSHLibrary.Close Connection
372 Tenant 2 Different switches, HTTP request ovs-dpctl output check on sw3
373 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_7
375 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
377 @{matches} Create List
378 @{actions} Create List
379 Append Tunnel Set Check ${matches}
380 Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP}
381 Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP}
382 Append In Port Check ${matches} 3
383 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC}
384 Append Ether-Type Check ${matches} 0x0800
385 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
386 Append Proto Check ${matches} 6
388 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
389 Append Proto Check ${actions} 6
390 Append Out Port Check ${actions} 8
392 ${output} Find Flow in DPCTL Output ${matches} ${actions}
394 SSHLibrary.Close Connection
396 Tenant 2 Different switches, HTTP reply ovs-dpctl output check on sw3
397 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_7 to h35_8
399 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
401 @{matches} Create List
402 @{actions} Create List
404 Append In Port Check ${matches} 8
405 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC}
406 Append Ether-Type Check ${matches} 0x0800
407 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
408 Append Proto Check ${matches} 6
410 Append Tunnel Set Check ${actions}
411 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
412 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
413 Append Proto Check ${actions} 6
414 Append Out Port Check ${actions} 3
416 ${output} Find Flow in DPCTL Output ${matches} ${actions}
418 SSHLibrary.Close Connection
420 Tenant 2 Different switches, HTTP reply ovs-dpctl output check on sw1
421 [Documentation] Assert matches and actions on megaflow of HTTP reply from h36_7 to h35_8
423 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
425 @{matches} Create List
426 @{actions} Create List
427 Append Tunnel Set Check ${matches}
428 Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP}
429 Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP}
430 Append In Port Check ${matches} 3
431 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC}
432 Append Ether-Type Check ${matches} 0x0800
433 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
434 Append Proto Check ${matches} 6
436 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
437 Append Proto Check ${actions} 6
438 Append Out Port Check ${actions} 6
440 ${output} Find Flow in DPCTL Output ${matches} ${actions}
442 SSHLibrary.Close Connection
444 Tenant 2 Different switches, stop endless curl from h35_8 to h36_7
446 [Documentation] Terminanting endless HTTP session after traffic inspection
448 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
449 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
450 SSHLibrary.Close Connection
452 Tenant 2 Different switches, stop SimpleHttpServer on h36_7
454 [Documentation] Stopping HTTP service on docker container.
455 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
456 DockerUtils.Stop HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER}
457 SSHLibrary.Close Connection