2 Documentation Tests for ICMP flow
3 Force Tags multi-tenant icmp 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 tenant 1 related test cases.
18 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
19 ... 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
21 Tenant 1 Same switch, ping once from h35_2 to h36_3
22 [Documentation] Ping between endpoints located on the same switch "sw1".
24 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
25 DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP}
26 SSHLibrary.Close Connection
28 Tenant 1 Same switch, start endless ping from h35_2 to h36_3
29 [Documentation] Start endless ping from h35_2 to h36_4 so that icmp traffic
32 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
33 DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP}
34 SSHLibrary.Close Connection
36 Tenant 1 Same switch, ICMP request ovs-dpctl output check on sw1
37 [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_3
39 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
40 @{matches} Create List
41 @{actions} Create List
42 Append In Port Check ${matches} 4
43 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
44 Append Ether-Type Check ${matches} 0x0800
45 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
46 Append Proto Check ${matches} 1
47 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC}
48 Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
49 Append Proto Check ${actions} 1
50 Append Out Port Check ${actions} 7
51 ${output} Find Flow in DPCTL Output ${matches} ${actions}
52 SSHLibrary.Close Connection
54 Tenant 1 Same switch, ICMP reply ovs-dpctl output check on sw1
55 [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_3 to h35_2.
57 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
58 @{matches} Create List
59 @{actions} Create List
60 Append In Port Check ${matches} 7
61 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC}
62 Append Ether-Type Check ${matches} 0x0800
63 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
64 Append Proto Check ${matches} 1
65 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
66 Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
67 Append Proto Check ${actions} 1
68 Append Out Port Check ${actions} 4
69 ${output} Find Flow in DPCTL Output ${matches} ${actions}
70 SSHLibrary.Close Connection
72 Tenant 1 Same switch, stop endless ping from h35_2 to h36_3
73 [Documentation] Stops endless pinging from h35_8 to h36_6 when traffic inspection finishes.
75 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
76 DockerUtils.Stop Endless Ping from Docker to Address ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP}
77 SSHLibrary.Close Connection
79 Tenant 1 Different switches, ping once from h35_2 to h36_2
80 [Documentation] Different switches (sw1 -> sw3)
82 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
83 DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP}
84 SSHLibrary.Close Connection
86 Tenant 1 Different switches, start endless ping from h35_2 to h36_2
87 [Documentation] Different switches (sw1 -> sw3)
89 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
90 DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP}
91 SSHLibrary.Close Connection
93 Tenant 1 Different switches, ICMP request ovs-dpctl output check on sw1
94 [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_2
96 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
97 @{matches} Create List
98 @{actions} Create List
99 Append In Port Check ${matches} 4
100 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
101 Append Ether-Type Check ${matches} 0x0800
102 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
103 Append Proto Check ${matches} 1
104 Append Tunnel Set Check ${actions}
105 Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC}
106 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
107 Append Proto Check ${actions} 1
108 Append Out Port Check ${actions} 3
109 ${output} Find Flow in DPCTL Output ${matches} ${actions}
110 SSHLibrary.Close Connection
112 Tenant 1 Different switches, ICMP request ovs-dpctl output check on sw3
113 [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_2
114 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
115 @{matches} Create List
116 @{actions} Create List
117 Append Tunnel Set Check ${matches}
118 Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP}
119 Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP}
120 Append In Port Check ${matches} 3
121 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC}
122 Append Ether-Type Check ${matches} 0x0800
123 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
124 Append Proto Check ${matches} 1
125 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
126 Append Proto Check ${actions} 1
127 Append Out Port Check ${actions} 6
128 ${output} Find Flow in DPCTL Output ${matches} ${actions}
129 SSHLibrary.Close Connection
131 Tenant 1 Different switches, ICMP reply ovs-dpctl output check on sw3
132 [Documentation] Assert matches and actions on megaflow of ICMP request from h36_2 to h35_2
134 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
135 @{matches} Create List
136 @{actions} Create List
137 Append In Port Check ${matches} 6
138 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC}
139 Append Ether-Type Check ${matches} 0x0800
140 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
141 Append Proto Check ${matches} 1
142 Append Tunnel Set Check ${actions}
143 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
144 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
145 Append Proto Check ${actions} 1
146 Append Out Port Check ${actions} 3
147 ${output} Find Flow in DPCTL Output ${matches} ${actions}
148 SSHLibrary.Close Connection
150 Tenant 1 Different switches, ICMP reply ovs-dpctl output check on sw1
151 [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_2 to h35_2
152 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
153 @{matches} Create List
154 @{actions} Create List
155 Append Tunnel Set Check ${matches}
156 Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP}
157 Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP}
158 Append In Port Check ${matches} 3
159 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC}
160 Append Ether-Type Check ${matches} 0x0800
161 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
162 Append Proto Check ${matches} 1
163 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
164 Append Proto Check ${actions} 1
165 Append Out Port Check ${actions} 4
166 ${output} Find Flow in DPCTL Output ${matches} ${actions}
167 SSHLibrary.Close Connection
169 Tenant 1 Different switches, stop endless ping from h35_2 to h36_2
170 [Documentation] Stops endless pinging from h35_2 to h36_2 when traffic inspection finishes.
172 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
173 DockerUtils.Stop Endless Ping from Docker to Address ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP}
174 SSHLibrary.Close Connection
176 Setting Variables For Tenant 2
177 [Documentation] Setting variables for tenant 2 related test cases.
178 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
179 ... 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
181 Tenant 2 Same switch, ping once from h35_8 to h36_6
182 [Documentation] Same switch (sw1)
184 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
185 DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP}
186 SSHLibrary.Close Connection
188 Tenant 2 Same switch, start endless ping from h35_8 to h36_6
189 [Documentation] Starting icmp between hosts on the same switch so that
190 ... traffic can be inspected.
192 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
193 DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP}
194 SSHLibrary.Close Connection
196 Tenant 2 Same switch, ICMP request ovs-dpctl output check on sw1
197 [Documentation] Assert matches and actions on megaflow of ICMP request from h35_8 to h36_6
199 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
200 @{matches} Create List
201 @{actions} Create List
202 Append In Port Check ${matches} 6
203 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
204 Append Ether-Type Check ${matches} 0x0800
205 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
206 Append Proto Check ${matches} 1
207 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC}
208 Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
209 Append Proto Check ${actions} 1
210 Append Out Port Check ${actions} 8
211 ${output} Find Flow in DPCTL Output ${matches} ${actions}
212 SSHLibrary.Close Connection
214 Tenant 2 Same switch, ICMP reply ovs-dpctl output check on sw1
215 [Documentation] Assert matches and actions on megaflow of ICMP reply from h35_8 to h36_6
217 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
218 @{matches} Create List
219 @{actions} Create List
220 Append In Port Check ${matches} 8
221 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC}
222 Append Ether-Type Check ${matches} 0x0800
223 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
224 Append Proto Check ${matches} 1
225 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
226 Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
227 Append Proto Check ${actions} 1
228 Append Out Port Check ${actions} 6
229 ${output} Find Flow in DPCTL Output ${matches} ${actions}
230 SSHLibrary.Close Connection
232 Tenant 2 Same switch, stop endless ping from h35_8 to h36_6
233 [Documentation] Stops endless pinging from h35_8 to h36_6 when traffic inspection finishes.
235 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
236 DockerUtils.Stop Endless Ping from Docker to Address ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP}
237 SSHLibrary.Close Connection
239 Tenant 2 Different switches, ping once from h35_8 to h36_7
240 [Documentation] Different switches (sw1 -> sw3)
242 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
243 DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP}
244 SSHLibrary.Close Connection
246 Tenant 2 Different switches, start endless ping from h35_8 to h36_7
247 [Documentation] Different switches (sw1 -> sw3)
249 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
250 DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP}
251 SSHLibrary.Close Connection
253 Tenant 2 Different switches, ICMP request ovs-dpctl output check on sw1
254 [Documentation] Assert matches and actions on megaflow of ICMP request from h35_8 to h36_7
256 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
257 @{matches} Create List
258 @{actions} Create List
259 Append In Port Check ${matches} 6
260 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
261 Append Ether-Type Check ${matches} 0x0800
262 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
263 Append Proto Check ${matches} 1
264 Append Tunnel Set Check ${actions}
265 Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC}
266 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
267 Append Proto Check ${actions} 1
268 Append Out Port Check ${actions} 3
269 ${output} Find Flow in DPCTL Output ${matches} ${actions}
270 SSHLibrary.Close Connection
272 Tenant 2 Different switches, ICMP request ovs-dpctl output check on sw3
273 [Documentation] Assert matches and actions on megaflow of ICMP request from h35_8 to h36_7
274 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
275 @{matches} Create List
276 @{actions} Create List
277 Append Tunnel Set Check ${matches}
278 Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP}
279 Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP}
280 Append In Port Check ${matches} 3
281 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC}
282 Append Ether-Type Check ${matches} 0x0800
283 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
284 Append Proto Check ${matches} 1
285 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
286 Append Proto Check ${actions} 1
287 Append Out Port Check ${actions} 8
288 ${output} Find Flow in DPCTL Output ${matches} ${actions}
289 SSHLibrary.Close Connection
291 Tenant 2 Different switches, ICMP reply ovs-dpctl output check on sw3
292 [Documentation] Assert matches and actions on megaflow of ICMP request from h36_7 to h35_8
294 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
295 @{matches} Create List
296 @{actions} Create List
297 Append In Port Check ${matches} 8
298 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC}
299 Append Ether-Type Check ${matches} 0x0800
300 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
301 Append Proto Check ${matches} 1
302 Append Tunnel Set Check ${actions}
303 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
304 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
305 Append Proto Check ${actions} 1
306 Append Out Port Check ${actions} 3
307 ${output} Find Flow in DPCTL Output ${matches} ${actions}
308 SSHLibrary.Close Connection
310 Tenant 2 Different switches, ICMP reply ovs-dpctl output check on sw1
311 [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_7 to h35_8
312 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
313 @{matches} Create List
314 @{actions} Create List
315 Append Tunnel Set Check ${matches}
316 Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP}
317 Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP}
318 Append In Port Check ${matches} 3
319 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC}
320 Append Ether-Type Check ${matches} 0x0800
321 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
322 Append Proto Check ${matches} 1
323 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
324 Append Proto Check ${actions} 1
325 Append Out Port Check ${actions} 6
326 ${output} Find Flow in DPCTL Output ${matches} ${actions}
327 SSHLibrary.Close Connection
329 Tenant 2 Different switches, stop endless ping from h35_8 to h36_7
330 [Documentation] Stops endless pinging from h35_8 to h36_7 when traffic inspection finishes.
332 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
333 DockerUtils.Stop Endless Ping from Docker to Address ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP}
334 SSHLibrary.Close Connection