2 Documentation Test suite to verify packet flows between vm instances.
5 Library OperatingSystem
6 Library RequestsLibrary
8 Resource ../../../libraries/Utils.robot
9 Resource ../../../libraries/OpenStackOperations.robot
10 Resource ../../../libraries/DevstackUtils.robot
11 Resource ../../../libraries/OVSDB.robot
12 Resource ../../../libraries/ClusterOvsdb.robot
13 Resource ../../../libraries/ClusterManagement.robot
14 Resource ../../../libraries/SetupUtils.robot
15 Resource ../../../variables/Variables.robot
16 Resource ../../../variables/netvirt/Variables.robot
18 Suite Setup OpenStackOperations.OpenStack 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} cl2_sg
26 @{NETWORKS} cl2_net_1 cl2_net_2
27 @{SUBNETS} cl2_sub_1 cl2_sub_2
28 @{NET_1_VMS} cl2_net_1_vm_1 cl2_net_1_vm_2 cl2_net_1_vm_3
29 @{NET_2_VMS} cl2_net_2_vm_1 cl2_net_2_vm_2 cl2_net_2_vm_3
30 @{SUBNET_CIDRS} 26.0.0.0/24 27.0.0.0/24
31 @{CLUSTER_DOWN_LIST} ${1} ${2}
35 Create All Controller Sessions
36 [Documentation] Create sessions for all three controllers.
37 ClusterManagement.ClusterManagement Setup
40 [Documentation] Create Network with neutron request.
41 OpenStackOperations.Create Network ${NETWORKS}[0]
43 Create Subnet For net_1
44 [Documentation] Create Sub Net for the Network with neutron request.
45 OpenStackOperations.Create SubNet ${NETWORKS}[0] ${SUBNETS}[0] ${SUBNET_CIDRS}[0]
48 [Documentation] Create Network with neutron request.
49 OpenStackOperations.Create Network ${NETWORKS}[1]
51 Create Subnet For net_2
52 [Documentation] Create Sub Net for the Network with neutron request.
53 OpenStackOperations.Create SubNet ${NETWORKS}[1] ${SUBNETS}[1] ${SUBNET_CIDRS}[1]
55 Add Ssh Allow All Rule
56 [Documentation] Allow all TCP/UDP/ICMP packets for this suite
57 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
59 Create Bridge Manually and Verify Before Fail
60 [Documentation] Create bridge with OVS command and verify it gets applied from all instances.
61 ClusterOvsdb.Create Sample Bridge Manually And Verify ${OS_CNTL_IP}
63 Add Tap Device Manually and Verify Before Fail
64 [Documentation] Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
65 ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify ${OS_CNTL_IP}
67 Delete the Bridge Manually and Verify Before Fail
68 [Documentation] Delete bridge with OVS command and verify it gets deleted from all instances.
69 ClusterOvsdb.Delete Sample Bridge Manually And Verify ${OS_CNTL_IP}
72 [Documentation] Stop the karaf in First Controller
73 ${new_cluster_list} = ClusterManagement.Stop Single Member 1 msg=up: ODL1, ODL2, ODL3, down=none
74 BuiltIn.Set Suite Variable ${new_cluster_list}
76 Create Bridge Manually and Verify After Fail
77 [Documentation] Create bridge with OVS command and verify it gets applied from all instances.
78 ClusterOvsdb.Create Sample Bridge Manually And Verify ${OS_CNTL_IP} ${new_cluster_list}
80 Add Tap Device Manually and Verify After Fail
81 [Documentation] Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
82 ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify ${OS_CNTL_IP} ${new_cluster_list}
84 Delete the Bridge Manually and Verify After Fail
85 [Documentation] Delete bridge with OVS command and verify it gets deleted from all instances.
86 ClusterOvsdb.Delete Sample Bridge Manually And Verify ${OS_CNTL_IP} ${new_cluster_list}
89 [Documentation] Bring up ODL1 again
90 ClusterManagement.Start Single Member 1 msg=up: ODL2, ODL3, down: ODL1
92 Create Bridge Manually and Verify After Recover
93 [Documentation] Create bridge with OVS command and verify it gets applied from all instances.
94 ClusterOvsdb.Create Sample Bridge Manually And Verify ${OS_CNTL_IP}
96 Add Tap Device Manually and Verify After Recover
97 [Documentation] Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
98 ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify ${OS_CNTL_IP}
100 Delete the Bridge Manually and Verify After Recover
101 [Documentation] Delete bridge with OVS command and verify it gets deleted from all instances.
102 ClusterOvsdb.Delete Sample Bridge Manually And Verify ${OS_CNTL_IP}
105 [Documentation] Stop the karaf in Second Controller
106 ClusterManagement.Stop Single Member 2 msg=up: ODL1, ODL2, ODL3, down=none
108 Create Vm Instances For net_1
109 [Documentation] Create Vm instances using flavor and image names for a network.
110 OpenStackOperations.Create Vm Instance On Compute Node
113 ... ${OS_CMP1_HOSTNAME}
114 ... sg=${SECURITY_GROUP}
115 OpenStackOperations.Create Vm Instance On Compute Node
118 ... ${OS_CMP1_HOSTNAME}
119 ... sg=${SECURITY_GROUP}
120 OpenStackOperations.Create Vm Instance On Compute Node
123 ... ${OS_CMP2_HOSTNAME}
124 ... sg=${SECURITY_GROUP}
126 Create Vm Instances For net_2
127 [Documentation] Create Vm instances using flavor and image names for a network.
128 OpenStackOperations.Create Vm Instance On Compute Node
131 ... ${OS_CMP1_HOSTNAME}
132 ... sg=${SECURITY_GROUP}
133 OpenStackOperations.Create Vm Instance On Compute Node
136 ... ${OS_CMP2_HOSTNAME}
137 ... sg=${SECURITY_GROUP}
138 OpenStackOperations.Create Vm Instance On Compute Node
141 ... ${OS_CMP2_HOSTNAME}
142 ... sg=${SECURITY_GROUP}
144 Check Vm Instances Have Ip Address
145 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
146 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
147 BuiltIn.Set Suite Variable @{NET_1_VM_IPS}
148 BuiltIn.Set Suite Variable @{NET_2_VM_IPS}
149 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
150 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
151 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
152 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
153 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS}
154 ... AND OpenStackOperations.Get Test Teardown Debugs
157 [Documentation] Bring up ODL2 again
158 ClusterManagement.Start Single Member 2 msg=up: ODL1, ODL3, down: ODL2
160 Ping Vm Instance1 In net_1
161 [Documentation] Check reachability of vm instances by pinging to them.
162 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_1_VM_IPS}[0]
164 Ping Vm Instance2 In net_1
165 [Documentation] Check reachability of vm instances by pinging to them.
166 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_1_VM_IPS}[1]
168 Ping Vm Instance3 In net_1
169 [Documentation] Check reachability of vm instances by pinging to them.
170 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_1_VM_IPS}[2]
172 Ping Vm Instance1 In net_2
173 [Documentation] Check reachability of vm instances by pinging to them.
174 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_2_VM_IPS}[0]
176 Ping Vm Instance2 In net_2
177 [Documentation] Check reachability of vm instances by pinging to them.
178 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_2_VM_IPS}[1]
180 Ping Vm Instance3 In net_2
181 [Documentation] Check reachability of vm instances by pinging to them.
182 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_2_VM_IPS}[2]
185 [Documentation] Stop the karaf in Third Controller
186 ClusterManagement.Stop Single Member 3 msg=up: ODL1, ODL2, ODL3, down=none
188 Connectivity Tests From Vm Instance1 In net_1
189 [Documentation] Logging to the vm instance using generated key pair.
190 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_VM_IPS}[0] ${NET_1_VM_IPS}
192 Connectivity Tests From Vm Instance2 In net_1
193 [Documentation] Logging to the vm instance using generated key pair.
194 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_VM_IPS}[1] ${NET_1_VM_IPS}
196 Connectivity Tests From Vm Instance3 In net_1
197 [Documentation] Logging to the vm instance using generated key pair.
198 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_VM_IPS}[2] ${NET_1_VM_IPS}
201 [Documentation] Bring up ODL3 again
202 ClusterManagement.Start Single Member 3 msg=up: ODL1, ODL2, down: ODL3
204 Connectivity Tests From Vm Instance1 In net_2 In Healthy Cluster
205 [Documentation] Logging to the vm instance using generated key pair.
206 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_VM_IPS}[0] ${NET_2_VM_IPS}
208 Connectivity Tests From Vm Instance2 In net_2 In Healthy Cluster
209 [Documentation] Logging to the vm instance using generated key pair.
210 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_VM_IPS}[1] ${NET_2_VM_IPS}
212 Connectivity Tests From Vm Instance3 In net_2 In Healthy Cluster
213 [Documentation] Logging to the vm instance using generated key pair.
214 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_VM_IPS}[2] ${NET_2_VM_IPS}
216 Take Down ODL1 and ODL2
217 [Documentation] Stop the karaf in First and Second Controller
218 BuiltIn.Run Keyword And Ignore Error
219 ... ClusterManagement.Stop Single Member
221 ... msg=up: ODL1, ODL2, ODL3, down=none
222 BuiltIn.Run Keyword And Ignore Error ClusterManagement.Stop Single Member 2 msg=up: ODL2, ODL3, down=ODL1
224 Connectivity Tests From Vm Instance1 In net_2 With Two ODLs Down
225 [Documentation] Logging to the vm instance using generated key pair.
226 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_VM_IPS}[0] ${NET_2_VM_IPS}
228 Connectivity Tests From Vm Instance2 In net_2 With Two ODLs Down
229 [Documentation] Logging to the vm instance using generated key pair.
230 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_VM_IPS}[1] ${NET_2_VM_IPS}
232 Connectivity Tests From Vm Instance3 In net_2 With Two ODLs Down
233 [Documentation] Logging to the vm instance using generated key pair.
234 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_VM_IPS}[2] ${NET_2_VM_IPS}
236 Bring Up ODL1 and ODL2
237 [Documentation] Bring up ODL1 and ODL2 again. Do not check for cluster sync until all nodes are
238 ... up. akka will not let nodes join until they are all back up if two were down.
239 ClusterManagement.Start Single Member 1 msg=up: ODL3, down: ODL1, ODL2 wait_for_sync=False
240 ClusterManagement.Start Single Member 2 msg=up: ODL1, ODL3, down: ODL2
243 [Documentation] Delete Vm instances using instance names. Also remove the VM from the
244 ... list so that later cleanup will not try to delete it.
245 OpenStackOperations.Delete Vm Instance ${NET_1_VMS}[0]
246 Remove From List ${NET_1_VMS} 0
248 No Ping For Deleted Vm
249 [Documentation] Check non reachability of deleted vm instances by pinging to them.
250 ${output} = OpenStackOperations.Ping From DHCP Should Not Succeed ${NETWORKS}[0] ${NET_1_VM_IPS}[0]
252 Delete Vm Instances In net_1
253 [Documentation] Delete Vm instances using instance names in network_1.
254 FOR ${vm} IN @{NET_1_VMS}
255 OpenStackOperations.Delete Vm Instance ${vm}
258 Delete Vm Instances In net_2
259 [Documentation] Delete Vm instances using instance names in network_2.
260 FOR ${vm} IN @{NET_2_VMS}
261 OpenStackOperations.Delete Vm Instance ${vm}
264 Delete Sub Networks In net_1
265 [Documentation] Delete Sub Nets for the Networks with neutron request.
266 OpenStackOperations.Delete SubNet ${SUBNETS}[0]
268 Delete Sub Networks In net_2
269 [Documentation] Delete Sub Nets for the Networks with neutron request.
270 OpenStackOperations.Delete SubNet ${SUBNETS}[1]
273 [Documentation] Delete Networks with neutron request.
274 FOR ${network} IN @{NETWORKS}
275 OpenStackOperations.Delete Network ${network}
278 Delete Security Group
279 [Documentation] Delete security groups with neutron request
280 OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
283 [Documentation] Verify that flows have been cleaned up properly after removing all neutron configurations
284 DataModels.Verify Flows Are Cleaned Up On All OpenStack Nodes