2 Documentation Test suite to check connectivity in L3 using routers.
3 Suite Setup OpenStackOperations.OpenStack Suite Setup
4 Suite Teardown OpenStackOperations.OpenStack Suite Teardown
5 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
6 Test Teardown OpenStackOperations.Get Test Teardown Debugs
8 Library OperatingSystem
9 Library RequestsLibrary
11 Resource ../../../libraries/Utils.robot
12 Resource ../../../libraries/OpenStackOperations.robot
13 Resource ../../../libraries/DevstackUtils.robot
14 Resource ../../../libraries/OVSDB.robot
15 Resource ../../../libraries/ClusterOvsdb.robot
16 Resource ../../../libraries/ClusterManagement.robot
17 Resource ../../../libraries/SetupUtils.robot
18 Resource ../../../variables/Variables.robot
19 Resource ../../../variables/netvirt/Variables.robot
22 ${SECURITY_GROUP} cl3_sg
23 @{NETWORKS} cl3_net_1 cl3_net_2
24 @{SUBNETS} cl3_sub_1 cl3_sub_2
25 @{ROUTERS} cl3_router_1 cl3_router_2 cl3_router_3
26 @{NET_1_VMS} cl3_net_1_vm_1 cl3_net_1_vm_2 cl3_net_1_vm_3
27 @{NET_2_VMS} cl3_net_2_vm_1 cl3_net_2_vm_2 cl3_net_2_vm_3
28 @{SUBNET_CIDRS} 36.0.0.0/24 37.0.0.0/24
29 @{GATEWAY_IPS} 36.0.0.1 37.0.0.1
30 @{ODL_1_AND_2_DOWN} ${1} ${2}
31 @{ODL_2_AND_3_DOWN} ${2} ${3}
34 Create All Controller Sessions
35 [Documentation] Create sessions for all three controllers.
36 ClusterManagement.ClusterManagement Setup
38 Take Down Leader Of Default Shard
39 [Documentation] Stop the karaf on ODL cluster leader
40 ${cluster_leader} ${followers} = ClusterManagement.Get Leader And Followers For Shard shard_type=config
41 BuiltIn.Set Suite Variable ${cluster_leader}
42 ${new_cluster_list} = ClusterManagement.Stop Single Member ${cluster_leader} msg=up: ODL1, ODL2, ODL3, down=none
43 BuiltIn.Set Suite Variable ${new_cluster_list}
46 [Documentation] Create Network with neutron request.
47 : FOR ${NetworkElement} IN @{NETWORKS}
48 \ OpenStackOperations.Create Network ${NetworkElement}
50 Create Subnets For net_1
51 [Documentation] Create Sub Nets for the Networks with neutron request.
52 OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] @{SUBNET_CIDRS}[0]
54 Create Subnets For net_2
55 [Documentation] Create Sub Nets for the Networks with neutron request.
56 OpenStackOperations.Create SubNet @{NETWORKS}[1] @{SUBNETS}[1] @{SUBNET_CIDRS}[1]
58 Bring Up Leader Of Default Shard
59 [Documentation] Bring up on cluster leader
60 ClusterManagement.Start Single Member ${cluster_leader} msg=up: ${new_cluster_list}, down: ${cluster_leader}
62 Add Ssh Allow All Rule
63 [Documentation] Allow all TCP/UDP/ICMP packets for this suite
64 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
67 [Documentation] Stop the karaf in First Controller
68 ClusterManagement.Stop Single Member 1 msg=up: ODL1, ODL2, ODL3, down=none
70 Create Vm Instances For net_1
71 [Documentation] Create Vm instances using flavor and image names for a network.
72 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] @{NET_1_VMS}[0] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
73 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] @{NET_1_VMS}[1] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
74 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] @{NET_1_VMS}[2] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
77 [Documentation] Bring up ODL1 again
78 ClusterManagement.Start Single Member 1 msg=up: ODL2, ODL3, down: ODL1
81 [Documentation] Stop the karaf in Second Controller
82 ClusterManagement.Stop Single Member 2 msg=up: ODL1, ODL2, ODL3, down=none
84 Create Vm Instances For net_2
85 [Documentation] Create Vm instances using flavor and image names for a network.
86 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[1] @{NET_2_VMS}[0] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
87 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[1] @{NET_2_VMS}[1] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
88 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[1] @{NET_2_VMS}[2] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
90 Check Vm Instances Have Ip Address
91 @{NET_1_L3_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
92 @{NET_2_L3_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
93 BuiltIn.Set Suite Variable @{NET_1_L3_VM_IPS}
94 BuiltIn.Set Suite Variable @{NET_2_L3_VM_IPS}
95 BuiltIn.Should Not Contain ${NET_1_L3_VM_IPS} None
96 BuiltIn.Should Not Contain ${NET_2_L3_VM_IPS} None
97 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
98 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
99 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS}
100 ... AND OpenStackOperations.Get Test Teardown Debugs
103 [Documentation] Bring up ODL2 again
104 ClusterManagement.Start Single Member 2 msg=up: ODL1, ODL3, down: ODL2
107 [Documentation] Stop the karaf in Third Controller
108 ClusterManagement.Stop Single Member 3 msg=up: ODL1, ODL2, ODL3, down=none
110 Create Router router_2
111 [Documentation] Create Router and Add Interface to the subnets.
112 OpenStackOperations.Create Router @{ROUTERS}[1]
113 [Teardown] Report_Failure_Due_To_Bug 6117
115 Create Router router_3
116 [Documentation] Create Router and Add Interface to the subnets.
117 OpenStackOperations.Create Router @{ROUTERS}[2]
119 Add Interfaces To Router
120 [Documentation] Add Interfaces
121 : FOR ${interface} IN @{SUBNETS}
122 \ OpenStackOperations.Add Router Interface @{ROUTERS}[2] ${interface}
124 Verify Created Routers
125 [Documentation] Check created routers using northbound rest calls
126 ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
128 Should Contain ${data} @{ROUTERS}[2]
131 [Documentation] Bring up ODL3 again
132 ClusterManagement.Start Single Member 3 msg=up: ODL1, ODL2, down: ODL3
134 Ping Vm Instance1 In net_2 From net_1
135 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
136 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[0]
138 Ping Vm Instance2 In net_2 From net_1
139 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
140 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[1]
142 Ping Vm Instance3 In net_2 From net_1
143 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
144 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[2]
146 Ping Vm Instance1 In net_1 From net_2
147 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
148 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[0]
150 Ping Vm Instance2 In net_1 From net_2
151 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
152 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[1]
154 Ping Vm Instance3 In net_1 From net_2
155 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
156 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[2]
158 Connectivity Tests From Vm Instance1 In net_1 In Healthy Cluster
159 [Documentation] ssh to the VM instance and test operations.
160 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
161 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[0] ${dst_list}
162 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
164 Connectivity Tests From Vm Instance2 In net_1 In Healthy Cluster
165 [Documentation] ssh to the VM instance and test operations.
166 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
167 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[1] ${dst_list}
168 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
170 Connectivity Tests From Vm Instance3 In net_1 In Healthy Cluster
171 [Documentation] ssh to the VM instance and test operations.
172 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
173 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[2] ${dst_list}
174 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
176 Take Down ODL1 and ODL2
177 [Documentation] Stop the karaf in First and Second Controller
178 ClusterManagement.Stop Single Member 1 msg=up: ODL1, ODL2, ODL3, down=none
179 ClusterManagement.Stop Single Member 2 msg=up: ODL2, ODL3, down=ODL1
180 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
182 Connectivity Tests From Vm Instance1 In net_1 With Two ODLs Down
183 [Documentation] ssh to the VM instance and test operations.
184 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
185 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[0] ${dst_list}
186 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
188 Connectivity Tests From Vm Instance2 In net_1 With Two ODLs Down
189 [Documentation] ssh to the VM instance and test operations.
190 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
191 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[1] ${dst_list}
192 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
194 Connectivity Tests From Vm Instance3 In net_1 With Two ODLs Down
195 [Documentation] ssh to the VM instance and test operations.
196 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
197 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[2] ${dst_list}
198 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
200 Bring Up ODL1 and ODL2
201 [Documentation] Bring up ODL1 and ODL2 again. Do not check for cluster sync until all nodes are
202 ... up. akka will not let nodes join until they are all back up if two were down.
203 ClusterManagement.Start Single Member 1 msg=up: ODL3, down: ODL1, ODL2 wait_for_sync=False
204 ClusterManagement.Start Single Member 2 msg=up: ODL1, ODL3, down: ODL2
205 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
207 Take Down ODL2 and ODL3
208 [Documentation] Stop the karaf in First and Second Controller
209 ClusterManagement.Stop Single Member 2 msg=up: ODL1, ODL2, ODL3, down=none
210 ClusterManagement.Stop Single Member 3 msg=up: ODL1, ODL3, down=ODL2
211 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
213 Connectivity Tests From Vm Instance1 In net_2
214 [Documentation] ssh to the VM instance and test operations.
215 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
216 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_L3_VM_IPS}[0] ${dst_list}
217 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
219 Connectivity Tests From Vm Instance2 In net_2
220 [Documentation] ssh to the VM instance and test operations.
221 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
222 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_L3_VM_IPS}[1] ${dst_list}
223 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
225 Connectivity Tests From Vm Instance3 In net_2
226 [Documentation] ssh to the VM instance and test operations.
227 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
228 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_L3_VM_IPS}[2] ${dst_list}
229 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
231 Bring Up ODL2 and ODL3
232 [Documentation] Bring up ODL2 and ODL3 again. Do not check for cluster sync until all nodes are
233 ... up. akka will not let nodes join until they are all back up if two were down.
234 ClusterManagement.Start Single Member 2 msg=up: ODL1, down: ODL2, ODL3 wait_for_sync=False
235 ClusterManagement.Start Single Member 3 msg=up: ODL1, ODL2, down: ODL3
236 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
238 Take Down All Instances
239 [Documentation] Stop karaf on all controllers
240 ClusterManagement.Stop Single Member 1 msg=up: ODL1, ODL2, ODL3, down=none
241 ClusterManagement.Stop Single Member 2 msg=up: ODL2, ODL3, down=ODL1
242 ClusterManagement.Stop Single Member 3 msg=up: ODL3, down=ODL1, ODL2
243 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
245 Bring Up All Instances
246 [Documentation] Bring up all controllers. Do not check for cluster sync until all nodes are
247 ... up. akka will not let nodes join until they are all back up if two were down.
248 ClusterManagement.Start Single Member 1 msg=up: none, down: ODL1, ODL2, ODL3 wait_for_sync=False
249 ClusterManagement.Start Single Member 2 msg=up: ~ODL1, down: ODL2, ODL3 wait_for_sync=False
250 ClusterManagement.Start Single Member 3 msg=up: ~ODL1, ~ODL2, down: ODL3
251 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
253 Connectivity Tests From Vm Instance2 In net_2 after recovering all nodes
254 [Documentation] ssh to the VM instance and test operations.
255 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
256 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_L3_VM_IPS}[1] ${dst_list}
257 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
259 Connectivity Tests From Vm Instance3 In net_2 after recovering all nodes
260 [Documentation] ssh to the VM instance and test operations.
261 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
262 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_L3_VM_IPS}[2] ${dst_list}
263 [Teardown] OpenStackOperations.Get Test Teardown Debugs fail=False
265 Delete Vm Instances In net_1
266 [Documentation] Delete Vm instances using instance names in net_1.
267 : FOR ${vm} IN @{NET_1_VMS}
268 \ OpenStackOperations.Delete Vm Instance ${vm}
270 Delete Vm Instances In net_2
271 [Documentation] Delete Vm instances using instance names in net_2.
272 : FOR ${vm} IN @{NET_2_VMS}
273 \ OpenStackOperations.Delete Vm Instance ${vm}
275 Delete Router Interfaces
276 [Documentation] Remove Interface to the subnets.
277 : FOR ${interface} IN @{SUBNETS}
278 \ OpenStackOperations.Remove Interface @{ROUTERS}[2] ${interface}
281 [Documentation] Delete Router and Interface to the subnets.
282 OpenStackOperations.Delete Router @{ROUTERS}[1]
283 OpenStackOperations.Delete Router @{ROUTERS}[2]
285 Verify Deleted Routers
286 [Documentation] Check deleted routers using northbound rest calls
287 ${data} = Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
289 BuiltIn.Should Not Contain ${data} @{ROUTERS}[2]
291 Delete Sub Network In net_1
292 [Documentation] Delete Sub Nets for the Networks with neutron request.
293 OpenStackOperations.Delete SubNet @{SUBNETS}[0]
295 Delete Sub Network In net_2
296 [Documentation] Delete Sub Nets for the Networks with neutron request.
297 OpenStackOperations.Delete SubNet @{SUBNETS}[1]
300 [Documentation] Delete Networks with neutron request.
301 : FOR ${network} IN @{NETWORKS}
302 \ OpenStackOperations.Delete Network ${network}
304 Delete Security Group
305 [Documentation] Delete security groups with neutron request
306 OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
309 [Documentation] Verify that flows have been cleaned up properly after removing all neutron configurations
310 DataModels.Verify Flows Are Cleaned Up On All OpenStack Nodes