2 Documentation Test suite to check connectivity while disrupting connection between cluster nodes
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
17 Suite Setup OpenStackOperations.OpenStack Suite Setup
18 Suite Teardown Close All Connections
19 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
20 Test Teardown OpenStackOperations.Get Test Teardown Debugs
24 ${SECURITY_GROUP} cl3_bp_sg
25 @{NETWORKS} cl3_bp_net_1 cl3_bp_net_2
26 @{SUBNETS} cl3_bp_sub_1 cl3_bp_sub_2
27 @{ROUTERS} cl3_bp_router_1 cl3_bp_router_2 cl3_bp_router_3
28 @{NET_1_VMS} cl3_bp_net_1_vm_1 cl3_bp_net_1_vm_2 cl3_bp_net_1_vm_3
29 @{NET_2_VMS} cl3_bp_net_2_vm_1 cl3_bp_net_2_vm_2 cl3_bp_net_2_vm_3
30 @{SUBNET_CIDRS} 38.0.0.0/24 39.0.0.0/24
31 @{GATEWAY_IPS} 38.0.0.1 39.0.0.1
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 FOR ${network} IN @{NETWORKS}
42 OpenStackOperations.Create Network ${network}
45 Create Subnets For net_1
46 [Documentation] Create Sub Nets for the Networks with neutron request.
47 OpenStackOperations.Create SubNet ${NETWORKS}[0] ${SUBNETS}[0] ${SUBNET_CIDRS}[0]
49 Create Subnets For net_2
50 [Documentation] Create Sub Nets for the Networks with neutron request.
51 OpenStackOperations.Create SubNet ${NETWORKS}[1] ${SUBNETS}[1] ${SUBNET_CIDRS}[1]
53 Add Ssh Allow All Rule
54 [Documentation] Allow all TCP/UDP/ICMP packets for this suite
55 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
58 [Documentation] Block connection on first controller
59 ClusterManagement.Isolate_Member_From_List_Or_All ${1} protocol=tcp port=${ODL_AKKA_PORT}
61 Create Vm Instances For net_1
62 [Documentation] Create Vm instances using flavor and image names for a network.
63 OpenStackOperations.Create Vm Instance On Compute Node
66 ... ${OS_CMP1_HOSTNAME}
67 ... sg=${SECURITY_GROUP}
68 OpenStackOperations.Create Vm Instance On Compute Node
71 ... ${OS_CMP1_HOSTNAME}
72 ... sg=${SECURITY_GROUP}
73 OpenStackOperations.Create Vm Instance On Compute Node
76 ... ${OS_CMP2_HOSTNAME}
77 ... sg=${SECURITY_GROUP}
80 [Documentation] Allow connection on first controller
81 ClusterManagement.Rejoin_Member_From_List_Or_All ${1} protocol=tcp port=${ODL_AKKA_PORT}
84 [Documentation] Block connection on second controller
85 ClusterManagement.Isolate_Member_From_List_Or_All ${2} protocol=tcp port=${ODL_AKKA_PORT}
87 Create Vm Instances For net_2
88 [Documentation] Create Vm instances using flavor and image names for a network.
89 OpenStackOperations.Create Vm Instance On Compute Node
92 ... ${OS_CMP1_HOSTNAME}
93 ... sg=${SECURITY_GROUP}
94 OpenStackOperations.Create Vm Instance On Compute Node
97 ... ${OS_CMP2_HOSTNAME}
98 ... sg=${SECURITY_GROUP}
99 OpenStackOperations.Create Vm Instance On Compute Node
102 ... ${OS_CMP2_HOSTNAME}
103 ... sg=${SECURITY_GROUP}
105 Check Vm Instances Have Ip Address
106 @{NET_1_L3_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
107 @{NET_2_L3_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
108 BuiltIn.Set Suite Variable @{NET_1_L3_VM_IPS}
109 BuiltIn.Set Suite Variable @{NET_2_L3_VM_IPS}
110 BuiltIn.Should Not Contain ${NET_1_L3_VM_IPS} None
111 BuiltIn.Should Not Contain ${NET_2_L3_VM_IPS} None
112 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
113 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
114 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS}
115 ... AND OpenStackOperations.Get Test Teardown Debugs
118 [Documentation] Allow connection on second controller
119 ClusterManagement.Rejoin_Member_From_List_Or_All ${2} protocol=tcp port=${ODL_AKKA_PORT}
122 [Documentation] Block connection on third controller
123 ClusterManagement.Isolate_Member_From_List_Or_All ${3} protocol=tcp port=${ODL_AKKA_PORT}
125 Create Router router_2
126 [Documentation] Create Router and Add Interface to the subnets.
127 OpenStackOperations.Create Router ${ROUTERS}[1]
128 [Teardown] Report_Failure_Due_To_Bug 6117
130 Create Router router_3
131 [Documentation] Create Router and Add Interface to the subnets.
132 OpenStackOperations.Create Router ${ROUTERS}[2]
134 Add Interfaces To Router
135 [Documentation] Add Interfaces
136 FOR ${interface} IN @{SUBNETS}
137 OpenStackOperations.Add Router Interface ${ROUTERS}[2] ${interface}
140 Verify Created Routers
141 [Documentation] Check created routers using northbound rest calls
142 ${data} = Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
144 Should Contain ${data} ${ROUTERS}[2]
147 [Documentation] Allow connection on third controller
148 ClusterManagement.Rejoin_Member_From_List_Or_All ${3} protocol=tcp port=${ODL_AKKA_PORT}
150 Ping Vm Instance1 In net_2 From net_1
151 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
152 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_2_L3_VM_IPS}[0]
154 Ping Vm Instance2 In net_2 From net_1
155 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
156 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_2_L3_VM_IPS}[1]
158 Ping Vm Instance3 In net_2 From net_1
159 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
160 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_2_L3_VM_IPS}[2]
162 Ping Vm Instance1 In net_1 From net_2
163 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
164 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_1_L3_VM_IPS}[0]
166 Ping Vm Instance2 In net_1 From net_2
167 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
168 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_1_L3_VM_IPS}[1]
170 Ping Vm Instance3 In net_1 From net_2
171 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
172 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_1_L3_VM_IPS}[2]
174 Block Port On ODL1 Again
175 [Documentation] Block connection on first controller the second time
176 ClusterManagement.Isolate_Member_From_List_Or_All ${1} protocol=tcp port=${ODL_AKKA_PORT}
177 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
179 Block Port On ODL2 Again
180 [Documentation] Block connection on second controller the second time
181 ClusterManagement.Isolate_Member_From_List_Or_All ${2} protocol=tcp port=${ODL_AKKA_PORT}
182 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
184 Connectivity Tests From Vm Instance1 In net_1
185 [Documentation] ssh to the VM instance and test operations.
186 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
187 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_L3_VM_IPS}[0] ${dst_list}
188 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
190 Connectivity Tests From Vm Instance2 In net_1
191 [Documentation] ssh to the VM instance and test operations.
192 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
193 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_L3_VM_IPS}[1] ${dst_list}
194 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
196 Connectivity Tests From Vm Instance3 In net_1
197 [Documentation] ssh to the VM instance and test operations.
198 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
199 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_L3_VM_IPS}[2] ${dst_list}
200 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
202 Allow Port On ODL1 Again
203 [Documentation] Allow connection on first controller the second time
204 BuiltIn.Run_Keyword_And_Ignore_Error
205 ... ClusterManagement.Rejoin_Member_From_List_Or_All
208 ... port=${ODL_AKKA_PORT}
210 Allow Port On ODL2 Again
211 [Documentation] Allow connection on the second controller the second time
212 ClusterManagement.Rejoin_Member_From_List_Or_All ${2} protocol=tcp port=${ODL_AKKA_PORT}
214 Block Port On ODL2 Finally
215 [Documentation] Block connection on second controller for the last time
216 ClusterManagement.Isolate_Member_From_List_Or_All ${2} protocol=tcp port=${ODL_AKKA_PORT}
217 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
219 Block Port On ODL3 Again
220 [Documentation] Block connection on the third controller for the second time
221 ClusterManagement.Isolate_Member_From_List_Or_All ${3} protocol=tcp port=${ODL_AKKA_PORT}
222 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
224 Connectivity Tests From Vm Instance1 In net_2
225 [Documentation] ssh to the VM instance and test operations.
226 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
227 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_L3_VM_IPS}[0] ${dst_list}
228 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
230 Connectivity Tests From Vm Instance2 In net_2
231 [Documentation] ssh to the VM instance and test operations.
232 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
233 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_L3_VM_IPS}[1] ${dst_list}
234 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
236 Connectivity Tests From Vm Instance3 In net_2
237 [Documentation] ssh to the VM instance and test operations.
238 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
239 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_L3_VM_IPS}[2] ${dst_list}
240 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
242 Allow Port On ODL2 Finally
243 [Documentation] Allow connection on second controller for the last time
244 BuiltIn.Run_Keyword_And_Ignore_Error
245 ... ClusterManagement.Rejoin_Member_From_List_Or_All
248 ... port=${ODL_AKKA_PORT}
250 Allow Port On ODL3 Again
251 [Documentation] Allow connection on the third controller for the second time
252 ClusterManagement.Rejoin_Member_From_List_Or_All ${3} protocol=tcp port=${ODL_AKKA_PORT}
254 Delete Vm Instances In net_1
255 [Documentation] Delete Vm instances using instance names in net_1.
256 FOR ${vm} IN @{NET_1_VMS}
257 OpenStackOperations.Delete Vm Instance ${vm}
260 Delete Vm Instances In net_2
261 [Documentation] Delete Vm instances using instance names in net_2.
262 FOR ${vm} IN @{NET_2_VMS}
263 OpenStackOperations.Delete Vm Instance ${vm}
266 Delete Router Interfaces
267 [Documentation] Remove Interface to the subnets.
268 FOR ${interface} IN @{SUBNETS}
269 OpenStackOperations.Remove Interface ${ROUTERS}[2] ${interface}
273 [Documentation] Delete Router and Interface to the subnets.
274 OpenStackOperations.Delete Router ${ROUTERS}[1]
275 OpenStackOperations.Delete Router ${ROUTERS}[2]
277 Verify Deleted Routers
278 [Documentation] Check deleted routers using northbound rest calls
279 ${data} = Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
281 BuiltIn.Should Not Contain ${data} ${ROUTERS}[2]
283 Delete Sub Network In net_1
284 [Documentation] Delete Sub Nets for the Networks with neutron request.
285 OpenStackOperations.Delete SubNet ${SUBNETS}[0]
287 Delete Sub Network In net_2
288 [Documentation] Delete Sub Nets for the Networks with neutron request.
289 OpenStackOperations.Delete SubNet ${SUBNETS}[1]
292 [Documentation] Delete Networks with neutron request.
293 FOR ${network} IN @{NETWORKS}
294 OpenStackOperations.Delete Network ${network}
297 Delete Security Group
298 [Documentation] Delete security groups with neutron request
299 OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
302 [Documentation] Verify that flows have been cleaned up properly after removing all neutron configurations
303 DataModels.Verify Flows Are Cleaned Up On All OpenStack Nodes