2 Documentation Tests for HTTP flow
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
12 Force Tags multi-tenant http multi-tenant-main
20 Setting Variables for Tenant 1
21 [Documentation] Setting variables for test cases related to tenant 1.
22 # Same subnet tests are not supported by current topology configuration;
23 # clients and webservers are put in two different subnets
25 ... client_switch_ip=${GBP1}
26 ... client_docker=h35_2
27 ... client_ip=10.0.35.2
28 ... client_mac=00:00:00:00:35:02
29 ... same_webserver_docker=h36_3
30 ... same_webserver_ip=10.0.36.3
31 ... same_webserver_mac=00:00:00:00:36:03
32 ... diff_webserver_switch_ip=${GBP3}
33 ... diff_webserver_docker=h36_2
34 ... diff_webserver_ip=10.0.36.2
35 ... diff_webserver_mac=00:00:00:00:36:02
37 Tenant 1 Same switch, start SimpleHttpServer on h36_3
38 [Documentation] Same Switch (sw1)
40 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
41 DockerUtils.Start HTTP Service on Docker ${SAME_WEBSERVER_DOCKER} 80
42 SSHLibrary.Close Connection
44 Tenant 1 Same switch, curl once from h35_2 to h36_3
45 [Documentation] Test HTTP req/rest session between docker located on the same switch.
47 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
48 DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
49 SSHLibrary.Close Connection
51 Tenant 1 Same switch, start endless curl from h35_2 to h36_3
52 [Documentation] Init of endless HTTP session between endpoints so that
53 ... HTTP traffic can be inspected.
55 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
56 DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
57 SSHLibrary.Close Connection
59 Tenant 1 Same switch, HTTP request ovs-dpctl output check on sw1
60 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_3
62 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
63 @{matches} Create List
64 @{actions} Create List
65 Append In Port Check ${matches} 4
66 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
67 Append Ether-Type Check ${matches} 0x0800
68 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
69 Append Proto Check ${matches} 6
70 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC}
71 Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
72 Append Proto Check ${actions} 6
73 Append Out Port Check ${actions} 7
74 ${output} Find Flow in DPCTL Output ${matches} ${actions}
75 SSHLibrary.Close Connection
77 Tenant 1 Same switch, HTTP reply ovs-dpctl output check on sw1
78 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_3 to h35_2
80 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
81 @{matches} Create List
82 @{actions} Create List
83 Append In Port Check ${matches} 7
84 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC}
85 Append Ether-Type Check ${matches} 0x0800
86 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
87 Append Proto Check ${matches} 6
88 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
89 Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
90 Append Proto Check ${actions} 6
91 Append Out Port Check ${actions} 4
92 ${output} Find Flow in DPCTL Output ${matches} ${actions}
93 SSHLibrary.Close Connection
95 Tenant 1 Same switch, stop endless curl from h35_2 to h36_3
96 [Documentation] Stopping endless HTTP session after traffic inspection is done.
98 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
99 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
100 SSHLibrary.Close Connection
102 Tenant 1 Same switch, stop SimpleHttpServer on h36_3
103 [Documentation] Stoping HTTP service on docker container.
105 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
106 DockerUtils.Stop HTTP Service on Docker ${SAME_WEBSERVER_DOCKER}
107 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
117 [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}
133 @{matches} Create List
134 @{actions} Create List
135 Append In Port Check ${matches} 4
136 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
137 Append Ether-Type Check ${matches} 0x0800
138 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
139 Append Proto Check ${matches} 6
140 Append Tunnel Set Check ${actions}
141 Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC}
142 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
143 Append Proto Check ${actions} 6
144 Append Out Port Check ${actions} 3
145 ${output} Find Flow in DPCTL Output ${matches} ${actions}
146 SSHLibrary.Close Connection
148 Tenant 1 Different switches, HTTP request ovs-dpctl output check on sw3
149 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_2 to h36_2
151 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
152 @{matches} Create List
153 @{actions} Create List
154 Append Tunnel Set Check ${matches}
155 Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP}
156 Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP}
157 Append In Port Check ${matches} 3
158 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC}
159 Append Ether-Type Check ${matches} 0x0800
160 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
161 Append Proto Check ${matches} 6
162 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
163 Append Proto Check ${actions} 6
164 Append Out Port Check ${actions} 6
165 ${output} Find Flow in DPCTL Output ${matches} ${actions}
166 SSHLibrary.Close Connection
168 Tenant 1 Different switches, HTTP reply ovs-dpctl output check on sw3
169 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_2 to h35_2
171 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
172 @{matches} Create List
173 @{actions} Create List
174 Append In Port Check ${matches} 6
175 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC}
176 Append Ether-Type Check ${matches} 0x0800
177 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
178 Append Proto Check ${matches} 6
179 Append Tunnel Set Check ${actions}
180 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
181 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
182 Append Proto Check ${actions} 6
183 Append Out Port Check ${actions} 3
184 ${output} Find Flow in DPCTL Output ${matches} ${actions}
185 SSHLibrary.Close Connection
187 Tenant 1 Different switches, HTTP reply ovs-dpctl output check on sw1
188 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_2 to h35_2
190 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
191 @{matches} Create List
192 @{actions} Create List
193 Append Tunnel Set Check ${matches}
194 Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP}
195 Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP}
196 Append In Port Check ${matches} 3
197 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC}
198 Append Ether-Type Check ${matches} 0x0800
199 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
200 Append Proto Check ${matches} 6
201 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
202 Append Proto Check ${actions} 6
203 Append Out Port Check ${actions} 4
204 ${output} Find Flow in DPCTL Output ${matches} ${actions}
205 SSHLibrary.Close Connection
207 Tenant 1 Different switches, stop endless curl from h35_2 to h36_2
208 [Documentation] Stopping endless HTTP session when traffic inspection finishes.
210 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
211 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
212 SSHLibrary.Close Connection
214 Tenant 1 Different switches, stop SimpleHttpServer on h36_2
215 [Documentation] Terminating HTTP service on docker container.
217 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
218 DockerUtils.Stop HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER}
219 SSHLibrary.Close Connection
221 Setting Variables For Tenant 2
222 [Documentation] Setting variables for test cases related to tenant 1.
224 ... client_switch_ip=${GBP1}
225 ... client_docker=h35_8
226 ... client_ip=10.0.35.8
227 ... client_mac=00:00:00:00:35:08
228 ... same_webserver_docker=h36_6
229 ... same_webserver_ip=10.0.36.6
230 ... same_webserver_mac=00:00:00:00:36:06
231 ... diff_webserver_switch_ip=${GBP2}
232 ... diff_webserver_docker=h36_7
233 ... diff_webserver_ip=10.0.36.7
234 ... diff_webserver_mac=00:00:00:00:36:07
236 Tenant 2 Same switch, start SimpleHttpServer on h36_6
237 [Documentation] Same Switch (sw1)
239 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
240 DockerUtils.Start HTTP Service on Docker ${SAME_WEBSERVER_DOCKER} 80
241 SSHLibrary.Close Connection
243 Tenant 2 Same switch, curl once from h35_8 to h36_6
244 [Documentation] Test HTTP req/resp between endpoints on the same switch.
246 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
247 DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
248 SSHLibrary.Close Connection
250 Tenant 2 Same switch, start endless curl from h35_8 to h36_6
251 [Documentation] Init if endless HTTP Session between endpoints on the same switch.
253 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
254 DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP} 80
255 SSHLibrary.Close Connection
257 Tenant 2 Same switch, HTTP request ovs-dpctl output check on sw1
258 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_6
260 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
261 @{matches} Create List
262 @{actions} Create List
263 Append In Port Check ${matches} 6
264 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
265 Append Ether-Type Check ${matches} 0x0800
266 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
267 Append Proto Check ${matches} 6
268 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC}
269 Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
270 Append Proto Check ${actions} 6
271 Append Out Port Check ${actions} 8
272 ${output} Find Flow in DPCTL Output ${matches} ${actions}
273 SSHLibrary.Close Connection
275 Tenant 2 Same switch, HTTP reply ovs-dpctl output check on sw1
276 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_6 to h35_8
278 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
279 @{matches} Create List
280 @{actions} Create List
281 Append In Port Check ${matches} 8
282 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC}
283 Append Ether-Type Check ${matches} 0x0800
284 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
285 Append Proto Check ${matches} 6
286 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
287 Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
288 Append Proto Check ${actions} 6
289 Append Out Port Check ${actions} 6
290 ${output} Find Flow in DPCTL Output ${matches} ${actions}
291 SSHLibrary.Close Connection
293 Tenant 2 Same switch, stop endless curl from h35_8 to h36_6
294 [Documentation] Terminating endless HTTP session after traffic inspection is done.
296 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
297 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
298 SSHLibrary.Close Connection
300 Tenant 2 Same switch, stop SimpleHttpServer on h36_6
301 [Documentation] Stoping HTTP service on serving docker container.
303 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
304 DockerUtils.Stop HTTP Service on Docker ${SAME_WEBSERVER_DOCKER}
305 SSHLibrary.Close Connection
307 Tenant 2 Different switches, start SimpleHttpServer on h36_7
308 [Documentation] Different switches (sw1 -> sw3)
310 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
311 DockerUtils.Start HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER} 80
312 SSHLibrary.Close Connection
314 Tenant 2 Different switches, curl once from h35_8 to h36_7
315 [Documentation] Test HTTP req/resp between endpoints located on different switches.
317 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
318 DockerUtils.Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80
319 SSHLibrary.Close Connection
321 Tenant 2 Different switches, start endless curl from h35_8 to h36_7
322 [Documentation] Starting endless HTTP session so that the traffic can be inspected.
324 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
325 DockerUtils.Start Endless Curl from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP} 80
326 SSHLibrary.Close Connection
328 Tenant 2 Different switches, HTTP request ovs-dpctl output check on sw1
329 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_7
331 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
332 @{matches} Create List
333 @{actions} Create List
334 Append In Port Check ${matches} 6
335 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
336 Append Ether-Type Check ${matches} 0x0800
337 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
338 Append Proto Check ${matches} 6
339 Append Tunnel Set Check ${actions}
340 Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC}
341 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
342 Append Proto Check ${actions} 6
343 Append Out Port Check ${actions} 3
344 ${output} Find Flow in DPCTL Output ${matches} ${actions}
345 SSHLibrary.Close Connection
347 Tenant 2 Different switches, HTTP request ovs-dpctl output check on sw3
348 [Documentation] Assert matches and actions on megaflow of HTTP request from h35_8 to h36_7
350 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
351 @{matches} Create List
352 @{actions} Create List
353 Append Tunnel Set Check ${matches}
354 Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP}
355 Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP}
356 Append In Port Check ${matches} 3
357 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_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
361 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
362 Append Proto Check ${actions} 6
363 Append Out Port Check ${actions} 8
364 ${output} Find Flow in DPCTL Output ${matches} ${actions}
365 SSHLibrary.Close Connection
367 Tenant 2 Different switches, HTTP reply ovs-dpctl output check on sw3
368 [Documentation] Assert matches and actions on megaflow of HTTP request from h36_7 to h35_8
370 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
371 @{matches} Create List
372 @{actions} Create List
373 Append In Port Check ${matches} 8
374 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC}
375 Append Ether-Type Check ${matches} 0x0800
376 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
377 Append Proto Check ${matches} 6
378 Append Tunnel Set Check ${actions}
379 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
380 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
381 Append Proto Check ${actions} 6
382 Append Out Port Check ${actions} 3
383 ${output} Find Flow in DPCTL Output ${matches} ${actions}
384 SSHLibrary.Close Connection
386 Tenant 2 Different switches, HTTP reply ovs-dpctl output check on sw1
387 [Documentation] Assert matches and actions on megaflow of HTTP reply from h36_7 to h35_8
389 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
390 @{matches} Create List
391 @{actions} Create List
392 Append Tunnel Set Check ${matches}
393 Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP}
394 Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP}
395 Append In Port Check ${matches} 3
396 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC}
397 Append Ether-Type Check ${matches} 0x0800
398 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
399 Append Proto Check ${matches} 6
400 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
401 Append Proto Check ${actions} 6
402 Append Out Port Check ${actions} 6
403 ${output} Find Flow in DPCTL Output ${matches} ${actions}
404 SSHLibrary.Close Connection
406 Tenant 2 Different switches, stop endless curl from h35_8 to h36_7
407 [Documentation] Terminanting endless HTTP session after traffic inspection
410 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
411 DockerUtils.Stop Endless Curl from Docker ${CLIENT_DOCKER}
412 SSHLibrary.Close Connection
414 Tenant 2 Different switches, stop SimpleHttpServer on h36_7
415 [Documentation] Stopping HTTP service on docker container.
417 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
418 DockerUtils.Stop HTTP Service on Docker ${DIFF_WEBSERVER_DOCKER}
419 SSHLibrary.Close Connection