2 Documentation Tests for ICMP flow
3 Default Tags single-tenant icmp single-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
11 Suite Setup Set Test Variables client_switch_ip=${GBP1} client_docker=h35_2 client_ip=10.0.35.2
12 ... client_mac=00:00:00:00:35:02 same_webserver_docker=h36_4 same_webserver_ip=10.0.36.4
13 ... same_webserver_mac=00:00:00:00:36:04 diff_webserver_switch_ip=${GBP3}
14 ... diff_webserver_docker=h36_3 diff_webserver_ip=10.0.36.3
15 ... diff_webserver_mac=00:00:00:00:36:03
24 Same switch, ping once from h35_2 to h36_4
25 [Documentation] Ping between endpoints located on the same switch "sw1".
26 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
27 DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP}
28 SSHLibrary.Close Connection
30 Same switch, start endless ping from h35_2 to h36_4
31 [Documentation] Start endless ping from h35_2 to h36_4 so that icmp traffic
33 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
34 DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP}
35 SSHLibrary.Close Connection
37 Same switch, ICMP request ovs-dpctl output check on sw1
38 [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_4
39 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
41 @{matches} Create List
42 @{actions} Create List
43 Append In Port Check ${matches} 4
44 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
45 Append Ether-Type Check ${matches} 0x0800
46 Append Inner IPs Check ${matches} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
47 Append Proto Check ${matches} 1
49 Append Inner MAC Check ${actions} dst_addr=${SAME_WEBSERVER_MAC}
50 Append Inner IPs Check ${actions} ${CLIENT_IP} ${SAME_WEBSERVER_IP}
51 Append Proto Check ${actions} 1
52 Append Out Port Check ${actions} 6
54 ${output} Find Flow in DPCTL Output ${matches} ${actions}
56 SSHLibrary.Close Connection
58 Same switch, ICMP reply ovs-dpctl output check on sw1
59 [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_4 to h35_2
60 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
62 Set Suite Variable @{matches} @{EMPTY}
63 Set Suite Variable @{actions} @{EMPTY}
65 Append In Port Check ${matches} 6
66 Append Inner MAC Check ${matches} src_addr=${SAME_WEBSERVER_MAC}
67 Append Ether-Type Check ${matches} 0x0800
68 Append Inner IPs Check ${matches} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
69 Append Proto Check ${matches} 1
71 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
72 Append Inner IPs Check ${actions} ${SAME_WEBSERVER_IP} ${CLIENT_IP}
73 Append Proto Check ${actions} 1
74 Append Out Port Check ${actions} 4
76 ${output} Find Flow in DPCTL Output ${matches} ${actions}
78 SSHLibrary.Close Connection
80 Same switch, stop endless ping from h35_2 to h36_4
81 [Documentation] Stops endless pinging from h35_2 to h36_4 when traffic inspection finishes.
82 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
83 DockerUtils.Stop Endless Ping from Docker to Address ${CLIENT_DOCKER} ${SAME_WEBSERVER_IP}
84 SSHLibrary.Close Connection
87 Different switches, ping once from h35_2 to h36_3
88 [Documentation] Different switches (sw1 -> sw3)
89 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
90 DockerUtils.Ping From Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP}
91 SSHLibrary.Close Connection
93 Different switches, start endless ping from h35_2 to h36_3
94 [Documentation] Starting icmp session for traffic inspection between endpoints located
95 ... on different switches.
96 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
97 DockerUtils.Start Endless Ping from Docker ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP}
98 SSHLibrary.Close Connection
100 Different switches, ICMP request ovs-dpctl output check on sw1
101 [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_3
102 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
104 @{matches} Create List
105 @{actions} Create List
106 Append In Port Check ${matches} 4
107 Append Inner MAC Check ${matches} src_addr=${CLIENT_MAC}
108 Append Ether-Type Check ${matches} 0x0800
109 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
110 Append Proto Check ${matches} 1
112 Append Tunnel Set Check ${actions}
113 Append Inner MAC Check ${actions} dst_addr=${DIFF_WEBSERVER_MAC}
114 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
115 Append Proto Check ${actions} 1
116 Append Out Port Check ${actions} 3
118 ${output} Find Flow in DPCTL Output ${matches} ${actions}
120 SSHLibrary.Close Connection
122 Different switches, ICMP request ovs-dpctl output check on sw3
123 [Documentation] Assert matches and actions on megaflow of ICMP request from h35_2 to h36_3
124 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
126 @{matches} Create List
127 @{actions} Create List
128 Append Tunnel Set Check ${matches}
129 Append Outer IPs Check ${matches} src_ip=${CLIENT_SWITCH_IP}
130 Append Outer IPs Check ${matches} dst_ip=${DIFF_WEBSERVER_SWITCH_IP}
131 Append In Port Check ${matches} 3
132 Append Inner MAC Check ${matches} dst_addr=${DIFF_WEBSERVER_MAC}
133 Append Ether-Type Check ${matches} 0x0800
134 Append Inner IPs Check ${matches} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
135 Append Proto Check ${matches} 1
137 Append Inner IPs Check ${actions} ${CLIENT_IP} ${DIFF_WEBSERVER_IP}
138 Append Proto Check ${actions} 1
139 Append Out Port Check ${actions} 5
141 ${output} Find Flow in DPCTL Output ${matches} ${actions}
143 SSHLibrary.Close Connection
145 Different switches, ICMP reply ovs-dpctl output check on sw3
146 [Documentation] assert matches and actions on megaflow of ICMP reply from h36_3 to h35_2
147 ConnUtils.Connect and Login ${DIFF_WEBSERVER_SWITCH_IP} timeout=${timeout}
149 @{matches} Create List
150 @{actions} Create List
151 Append In Port Check ${matches} 5
152 Append Inner MAC Check ${matches} src_addr=${DIFF_WEBSERVER_MAC}
153 Append Ether-Type Check ${matches} 0x0800
154 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
155 Append Proto Check ${matches} 1
157 Append Tunnel Set Check ${actions}
158 Append Inner MAC Check ${actions} dst_addr=${CLIENT_MAC}
159 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
160 Append Proto Check ${actions} 1
161 Append Out Port Check ${actions} 3
163 ${output} Find Flow in DPCTL Output ${matches} ${actions}
165 SSHLibrary.Close Connection
167 Different switches, ICMP reply ovs-dpctl output check on sw1
168 [Documentation] Assert matches and actions on megaflow of ICMP reply from h36_3 to h35_2
169 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
171 @{matches} Create List
172 @{actions} Create List
173 Append Tunnel Set Check ${matches}
174 Append Outer IPs Check ${matches} src_ip=${DIFF_WEBSERVER_SWITCH_IP}
175 Append Outer IPs Check ${matches} dst_ip=${CLIENT_SWITCH_IP}
176 Append In Port Check ${matches} 3
177 Append Inner MAC Check ${matches} dst_addr=${CLIENT_MAC}
178 Append Ether-Type Check ${matches} 0x0800
179 Append Inner IPs Check ${matches} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
180 Append Proto Check ${matches} 1
182 Append Inner IPs Check ${actions} ${DIFF_WEBSERVER_IP} ${CLIENT_IP}
183 Append Proto Check ${actions} 1
184 Append Out Port Check ${actions} 4
186 ${output} Find Flow in DPCTL Output ${matches} ${actions}
188 SSHLibrary.Close Connection
190 Different switches, stop endless ping from h35_2 to h36_3
191 [Documentation] Stops endless pinging from h35_2 to h36_3 when traffic inspection finishes.
192 ConnUtils.Connect and Login ${CLIENT_SWITCH_IP} timeout=${timeout}
193 DockerUtils.Stop Endless Ping from Docker to Address ${CLIENT_DOCKER} ${DIFF_WEBSERVER_IP}
194 SSHLibrary.Close Connection