2 Documentation Test suite to validate elan service functionality in ODL environment.
3 ... The assumption of this suite is that the environment is already configured with the proper
4 ... integration bridges and vxlan tunnels.
6 Library OperatingSystem
7 Library RequestsLibrary
9 Resource ../../../libraries/KarafKeywords.robot
10 Resource ../../../libraries/Utils.robot
11 Resource ../../../libraries/OVSDB.robot
12 Resource ../../../libraries/OpenStackOperations.robot
13 Resource ../../../libraries/DevstackUtils.robot
14 Resource ../../../libraries/SetupUtils.robot
15 Resource ../../../variables/Variables.robot
16 Resource ../../../variables/netvirt/Variables.robot
18 Suite Setup Suite Setup
19 Suite Teardown OpenStackOperations.OpenStack Suite Teardown
20 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
21 Test Teardown OpenStackOperations.Get Test Teardown Debugs
25 ${SECURITY_GROUP} elan_sg
26 @{NETWORKS} elan_net_1 elan_net_2 elan_net_3
27 @{SUBNETS} elan_sub_1 elan_sub_2 elan_sub_3
28 @{SUBNET_CIDRS} 81.1.1.0/24 82.1.1.0/24 83.1.1.0/24
29 @{NET_1_PORTS} elan_net_1_port_1 elan_net_1_port_2
30 @{NET_2_PORTS} elan_net_2_port_1 elan_net_2_port_2
31 @{NET_3_PORTS} elan_net_3_port_1 elan_net_3_port_2
32 @{NET_1_VMS} elan_net_1_vm_1 elan_net_1_vm_2
33 @{NET_2_VMS} elan_net_2_vm_1 elan_net_2_vm_2
34 @{NET_3_VMS} elan_net_3_vm_1 elan_net_3_vm_2
38 Verify Datapath for Single ELAN with Multiple DPN
39 [Documentation] Verify Flow Table and Datapath
40 ${smac_cn1} = BuiltIn.Create List ${NET_1_MACS}[0]
41 ${smac_cn2} = BuiltIn.Create List ${NET_1_MACS}[1]
42 BuiltIn.Wait Until Keyword Succeeds
45 ... Verify Flows Are Present For ELAN Service
49 BuiltIn.Wait Until Keyword Succeeds
52 ... Verify Flows Are Present For ELAN Service
56 ${output} = OpenStackOperations.Execute Command on VM Instance
58 ... ${NET_1_VM_IPS}[0]
59 ... ping -c 3 ${NET_1_VM_IPS}[1]
60 BuiltIn.Should Contain ${output} ${PING_REGEXP}
61 ${output} = OpenStackOperations.Execute Command on VM Instance
63 ... ${NET_1_VM_IPS}[1]
64 ... ping -c 3 ${NET_1_VM_IPS}[0]
65 BuiltIn.Should Contain ${output} ${PING_REGEXP}
67 Verify Datapath After OVS Restart
68 [Documentation] Verify datapath after OVS restart
69 FOR ${ip} IN @{OS_CMP_IPS}
70 OVSDB.Restart OVSDB ${ip}
72 FOR ${ip} IN @{OS_CMP_IPS}
73 BuiltIn.Wait Until Keyword Succeeds 30s 10s OVSDB.Verify OVS Reports Connected tools_system=${ip}
75 ${smac_cn1} = BuiltIn.Create List ${NET_1_MACS}[0]
76 ${smac_cn2} = BuiltIn.Create List ${NET_1_MACS}[1]
77 BuiltIn.Wait Until Keyword Succeeds
80 ... Verify Flows Are Present For ELAN Service
84 BuiltIn.Wait Until Keyword Succeeds
87 ... Verify Flows Are Present For ELAN Service
91 ${output} = OpenStackOperations.Execute Command on VM Instance
93 ... ${NET_1_VM_IPS}[0]
94 ... ping -c 3 ${NET_1_VM_IPS}[1]
95 BuiltIn.Should Contain ${output} ${PING_REGEXP}
96 ${output} = OpenStackOperations.Execute Command on VM Instance
98 ... ${NET_1_VM_IPS}[1]
99 ... ping -c 3 ${NET_1_VM_IPS}[0]
100 BuiltIn.Should Contain ${output} ${PING_REGEXP}
102 Verify Datapath After Recreate VM Instance
103 [Documentation] Verify datapath after recreating Vm instance
104 OpenStackOperations.Delete Vm Instance ${NET_1_VMS[0]}
105 ${smac_cn1} = BuiltIn.Create List ${NET_1_MACS}[0]
106 BuiltIn.Wait Until Keyword Succeeds
109 ... Verify Flows Are Removed For ELAN Service
112 OpenStackOperations.Remove RSA Key From KnownHosts ${NET_1_VM_IPS}[0]
113 OpenStackOperations.Create Vm Instance With Port On Compute Node
114 ... ${NET_1_PORTS[0]}
116 ... ${OS_CMP1_HOSTNAME}
117 ... sg=${SECURITY_GROUP}
118 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
119 Builtin.Set Suite Variable @{NET_1_VM_IPS}
120 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
121 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
122 BuiltIn.Wait Until Keyword Succeeds
125 ... Verify Flows Are Present For ELAN Service
129 ${output} = OpenStackOperations.Execute Command on VM Instance
131 ... ${NET_1_VM_IPS}[0]
132 ... ping -c 3 ${NET_1_VM_IPS}[1]
133 BuiltIn.Should Contain ${output} ${PING_REGEXP}
134 ${output} = OpenStackOperations.Execute Command on VM Instance
136 ... ${NET_1_VM_IPS}[1]
137 ... ping -c 3 ${NET_1_VM_IPS}[0]
138 BuiltIn.Should Contain ${output} ${PING_REGEXP}
140 Delete All elan_net_1 VM And Verify Flow Table Updated
141 [Documentation] Verify Flow table after all VM instance deleted
142 FOR ${vm} IN @{NET_1_VMS}
143 OpenStackOperations.Delete Vm Instance ${vm}
145 Verify Flows Are Removed For ELAN Service On All compute Nodes ${NET_1_MACS}
147 Verify Datapath for Multiple ELAN with Multiple DPN
148 [Documentation] Verify Flow Table and Data path for Multiple ELAN with Multiple DPN
149 [Setup] BuiltIn.Run Keywords SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
150 ... AND MultipleElan Testsuite Setup
151 ${smac_cn1} = BuiltIn.Create List ${VM_MACAddr_elan_net_2}[0] ${VM_MACAddr_elan_net_3}[0]
152 ${smac_cn2} = BuiltIn.Create List ${VM_MACAddr_elan_net_2}[1] ${VM_MACAddr_elan_net_3}[1]
153 ${MAC_LIST} = BuiltIn.Create List @{VM_MACAddr_elan_net_2} @{VM_MACAddr_elan_net_3}
154 BuiltIn.Wait Until Keyword Succeeds
157 ... Verify Flows Are Present For ELAN Service
161 BuiltIn.Wait Until Keyword Succeeds
164 ... Verify Flows Are Present For ELAN Service
168 ${output} = OpenStackOperations.Execute Command on VM Instance
170 ... ${NET_2_VM_IPS}[0]
171 ... ping -c 3 ${NET_2_VM_IPS[1]}
172 BuiltIn.Should Contain ${output} ${PING_REGEXP}
173 ${output} = OpenStackOperations.Execute Command on VM Instance
175 ... ${NET_3_VM_IPS}[1]
176 ... ping -c 3 ${NET_3_VM_IPS[0]}
177 BuiltIn.Should Contain ${output} ${PING_REGEXP}
178 ${output} = OpenStackOperations.Execute Command on VM Instance
180 ... ${NET_2_VM_IPS}[0]
181 ... ping -c 3 ${NET_3_VM_IPS[0]}
182 BuiltIn.Should Not Contain ${output} ${PING_REGEXP}
183 ${output} = OpenStackOperations.Execute Command on VM Instance
185 ... ${NET_3_VM_IPS}[1]
186 ... ping -c 3 ${NET_2_VM_IPS[1]}
187 BuiltIn.Should Not Contain ${output} ${PING_REGEXP}
188 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
189 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
190 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
191 BuiltIn.Wait Until Keyword Succeeds
194 ... Verify Flows Are Present For ELAN Service
198 ${output} = OpenStackOperations.Execute Command on VM Instance
200 ... ${NET_2_VM_IPS[1]}
201 ... ping -c 3 ${NET_2_VM_IPS}[0]
202 BuiltIn.Should Contain ${output} ${PING_REGEXP}
207 OpenStackOperations.OpenStack Suite Setup
209 OpenStackOperations.Show Debugs @{NET_1_VMS}
210 OpenStackOperations.Get Suite Debugs
213 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
214 OpenStackOperations.Create Network ${NETWORKS}[0]
215 OpenStackOperations.Create SubNet ${NETWORKS}[0] ${SUBNETS}[0] ${SUBNET_CIDRS[0]}
216 OpenStackOperations.Create Port ${NETWORKS}[0] ${NET_1_PORTS[0]} sg=${SECURITY_GROUP}
217 OpenStackOperations.Create Port ${NETWORKS}[0] ${NET_1_PORTS[1]} sg=${SECURITY_GROUP}
218 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_1_PORTS}
219 OpenStackOperations.Create Vm Instance With Port On Compute Node
220 ... ${NET_1_PORTS[0]}
222 ... ${OS_CMP1_HOSTNAME}
223 ... sg=${SECURITY_GROUP}
224 OpenStackOperations.Create Vm Instance With Port On Compute Node
225 ... ${NET_1_PORTS[1]}
227 ... ${OS_CMP2_HOSTNAME}
228 ... sg=${SECURITY_GROUP}
229 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
230 Builtin.Set Suite Variable @{NET_1_VM_IPS}
231 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
232 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
233 @{NET_1_MACS} = BuiltIn.Wait Until Keyword Succeeds
236 ... OpenStackOperations.Get Ports MacAddr
238 Builtin.Set Suite Variable @{NET_1_MACS}
240 MultipleElan Testsuite Setup
241 [Documentation] Create additional ELAN for multipleElan with Multiple DPN test
242 OpenStackOperations.Create Network ${NETWORKS}[1]
243 OpenStackOperations.Create Network ${NETWORKS}[2]
244 OpenStackOperations.Create SubNet ${NETWORKS}[1] ${SUBNETS}[1] ${SUBNET_CIDRS[1]}
245 OpenStackOperations.Create SubNet ${NETWORKS}[2] ${SUBNETS}[2] ${SUBNET_CIDRS[2]}
246 OpenStackOperations.Create Port ${NETWORKS}[1] ${NET_2_PORTS[0]} sg=${SECURITY_GROUP}
247 OpenStackOperations.Create Port ${NETWORKS}[1] ${NET_2_PORTS[1]} sg=${SECURITY_GROUP}
248 OpenStackOperations.Create Port ${NETWORKS}[2] ${NET_3_PORTS[0]} sg=${SECURITY_GROUP}
249 OpenStackOperations.Create Port ${NETWORKS}[2] ${NET_3_PORTS[1]} sg=${SECURITY_GROUP}
250 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_3_PORTS}
251 OpenStackOperations.Create Vm Instance With Port On Compute Node
252 ... ${NET_2_PORTS[0]}
254 ... ${OS_CMP1_HOSTNAME}
255 ... sg=${SECURITY_GROUP}
256 OpenStackOperations.Create Vm Instance With Port On Compute Node
257 ... ${NET_2_PORTS[1]}
259 ... ${OS_CMP2_HOSTNAME}
260 ... sg=${SECURITY_GROUP}
261 OpenStackOperations.Create Vm Instance With Port On Compute Node
262 ... ${NET_3_PORTS[0]}
264 ... ${OS_CMP1_HOSTNAME}
265 ... sg=${SECURITY_GROUP}
266 OpenStackOperations.Create Vm Instance With Port On Compute Node
267 ... ${NET_3_PORTS[1]}
269 ... ${OS_CMP2_HOSTNAME}
270 ... sg=${SECURITY_GROUP}
271 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
272 @{NET_3_VM_IPS} ${NET_3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_3_VMS}
273 Builtin.Set Suite Variable @{NET_2_VM_IPS}
274 Builtin.Set Suite Variable @{NET_3_VM_IPS}
275 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
276 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
277 BuiltIn.Should Not Contain ${NET_3_VM_IPS} None
278 BuiltIn.Should Not Contain ${NET_3_DHCP_IP} None
279 @{VM_MACAddr_elan_net_2} = BuiltIn.Wait Until Keyword Succeeds
282 ... OpenStackOperations.Get Ports MacAddr
284 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_2}
285 @{VM_MACAddr_elan_net_3} = BuiltIn.Wait Until Keyword Succeeds
288 ... OpenStackOperations.Get Ports MacAddr
290 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_3}
291 OpenStackOperations.Show Debugs @{NET_2_VMS} @{NET_3_VMS}
292 OpenStackOperations.Get Suite Debugs
294 Verify Flows Are Present For ELAN Service
295 [Arguments] ${ip} ${smacs} ${dmacs}
296 ${flow_output} = Utils.Run Command On Remote System And Log
298 ... sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
299 BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
300 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
301 Builtin.Log ${smac_output}
302 FOR ${smac} IN @{smacs}
303 ${resp} = BuiltIn.Should Contain ${smac_output} ${smac}
305 BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE}
306 ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
307 Builtin.Log ${dmac_output}
308 FOR ${dmac} IN @{dmacs}
309 ${resp} = BuiltIn.Should Contain ${dmac_output} ${dmac}
311 BuiltIn.Should Contain ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
312 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
313 Builtin.Log ${smac_output}
315 Verify Flows Are Removed For ELAN Service
316 [Arguments] ${ip} ${smacs}
317 ${flow_output} = Utils.Run Command On Remote System And Log
319 ... sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
320 BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
321 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
322 Builtin.Log ${smac_output}
323 FOR ${smac} IN @{smacs}
324 ${resp} = BuiltIn.Should Not Contain ${smac_output} ${smac}
326 BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE}
327 ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
328 Builtin.Log ${dmac_output}
329 FOR ${dmac} IN @{smacs}
330 ${resp} = BuiltIn.Should Not Contain ${dmac_output} ${dmac}
333 Verify Flows Are Removed For ELAN Service On All compute Nodes
335 FOR ${ip} IN @{OS_CMP_IPS}
336 BuiltIn.Wait Until Keyword Succeeds
339 ... Verify Flows Are Removed For ELAN Service