2 Documentation Test suite to check connectivity in L3 using routers.
3 Suite Setup OpenStackOperations.OpenStack Suite Setup
4 Suite Teardown Close All Connections
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
21 ${SECURITY_GROUP} cl3_sg
22 @{NETWORKS} cl3_net_1 cl3_net_2
23 @{SUBNETS} cl3_sub_1 cl3_sub_2
24 @{ROUTERS} cl3_router_1 cl3_router_2 cl3_router_3
25 @{NET_1_VMS} cl3_net_1_vm_1 cl3_net_1_vm_2 cl3_net_1_vm_3
26 @{NET_2_VMS} cl3_net_2_vm_1 cl3_net_2_vm_2 cl3_net_2_vm_3
27 @{SUBNET_CIDRS} 36.0.0.0/24 37.0.0.0/24
28 @{GATEWAY_IPS} 36.0.0.1 37.0.0.1
29 @{ODL_1_AND_2_DOWN} ${1} ${2}
30 @{ODL_2_AND_3_DOWN} ${2} ${3}
33 Create All Controller Sessions
34 [Documentation] Create sessions for all three controllers.
35 ClusterManagement.ClusterManagement Setup
37 Take Down Leader Of Default Shard
38 [Documentation] Kill the karaf on ODL cluster leader
39 ${cluster_leader} ${followers} = ClusterManagement.Get Leader And Followers For Shard shard_type=config
40 BuiltIn.Set Suite Variable ${cluster_leader}
41 ClusterManagement.Kill Single Member ${cluster_leader}
44 [Documentation] Create Network with neutron request.
45 : FOR ${NetworkElement} IN @{NETWORKS}
46 \ OpenStackOperations.Create Network ${NetworkElement}
48 Create Subnets For net_1
49 [Documentation] Create Sub Nets for the Networks with neutron request.
50 OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] @{SUBNET_CIDRS}[0]
52 Create Subnets For net_2
53 [Documentation] Create Sub Nets for the Networks with neutron request.
54 OpenStackOperations.Create SubNet @{NETWORKS}[1] @{SUBNETS}[1] @{SUBNET_CIDRS}[1]
56 Bring Up Leader Of Default Shard
57 [Documentation] Bring up on cluster leader
58 ClusterManagement.Start Single Member ${cluster_leader}
60 Add Ssh Allow All Rule
61 [Documentation] Allow all TCP/UDP/ICMP packets for this suite
62 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
65 [Documentation] Kill the karaf in First Controller
66 ClusterManagement.Kill Single Member 1
68 Create Vm Instances For net_1
69 [Documentation] Create Vm instances using flavor and image names for a network.
70 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] @{NET_1_VMS}[0] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
71 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] @{NET_1_VMS}[1] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
72 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] @{NET_1_VMS}[2] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
75 [Documentation] Bring up ODL1 again
76 ClusterManagement.Start Single Member 1
79 [Documentation] Kill the karaf in Second Controller
80 ClusterManagement.Kill Single Member 2
82 Create Vm Instances For net_2
83 [Documentation] Create Vm instances using flavor and image names for a network.
84 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[1] @{NET_2_VMS}[0] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
85 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[1] @{NET_2_VMS}[1] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
86 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[1] @{NET_2_VMS}[2] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
88 Check Vm Instances Have Ip Address
89 @{NET_1_L3_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
90 @{NET_2_L3_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
91 BuiltIn.Set Suite Variable @{NET_1_L3_VM_IPS}
92 BuiltIn.Set Suite Variable @{NET_2_L3_VM_IPS}
93 BuiltIn.Should Not Contain ${NET_1_L3_VM_IPS} None
94 BuiltIn.Should Not Contain ${NET_2_L3_VM_IPS} None
95 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
96 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
97 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS}
98 ... AND OpenStackOperations.Get Test Teardown Debugs
101 [Documentation] Bring up ODL2 again
102 ClusterManagement.Start Single Member 2
105 [Documentation] Kill the karaf in Third Controller
106 ClusterManagement.Kill Single Member 3
108 Create Router router_2
109 [Documentation] Create Router and Add Interface to the subnets.
110 OpenStackOperations.Create Router @{ROUTERS}[1]
111 [Teardown] Report_Failure_Due_To_Bug 6117
113 Create Router router_3
114 [Documentation] Create Router and Add Interface to the subnets.
115 OpenStackOperations.Create Router @{ROUTERS}[2]
117 Add Interfaces To Router
118 [Documentation] Add Interfaces
119 : FOR ${interface} IN @{SUBNETS}
120 \ OpenStackOperations.Add Router Interface @{ROUTERS}[2] ${interface}
122 Verify Created Routers
123 [Documentation] Check created routers using northbound rest calls
124 ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
126 Should Contain ${data} @{ROUTERS}[2]
129 [Documentation] Bring up ODL3 again
130 ClusterManagement.Start Single Member 3
132 Ping Vm Instance1 In net_2 From net_1
133 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
134 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[0]
136 Ping Vm Instance2 In net_2 From net_1
137 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
138 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[1]
140 Ping Vm Instance3 In net_2 From net_1
141 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
142 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[2]
144 Ping Vm Instance1 In net_1 From net_2
145 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
146 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[0]
148 Ping Vm Instance2 In net_1 From net_2
149 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
150 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[1]
152 Ping Vm Instance3 In net_1 From net_2
153 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
154 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[2]
156 Take Down ODL1 and ODL2
157 [Documentation] Kill the karaf in First and Second Controller
158 ClusterManagement.Kill Members From List Or All ${ODL_1_AND_2_DOWN}
159 [Teardown] OpenStackOperations.Get OvsDebugInfo
161 Connectivity Tests From Vm Instance1 In net_1
162 [Documentation] ssh to the VM instance and test operations.
163 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
164 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[0] ${dst_list}
165 [Teardown] OpenStackOperations.Get OvsDebugInfo
167 Connectivity Tests From Vm Instance2 In net_1
168 [Documentation] ssh to the VM instance and test operations.
169 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
170 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[1] ${dst_list}
171 [Teardown] OpenStackOperations.Get OvsDebugInfo
173 Connectivity Tests From Vm Instance3 In net_1
174 [Documentation] ssh to the VM instance and test operations.
175 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
176 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[2] ${dst_list}
177 [Teardown] OpenStackOperations.Get OvsDebugInfo
179 Bring Up ODL1 and ODL2
180 [Documentation] Bring up ODL1 and ODL2 again
181 ClusterManagement.Start Members From List Or All ${ODL_1_AND_2_DOWN}
183 Take Down ODL2 and ODL3
184 [Documentation] Kill the karaf in First and Second Controller
185 ClusterManagement.Kill Members From List Or All ${ODL_2_AND_3_DOWN}
186 [Teardown] OpenStackOperations.Get OvsDebugInfo
188 Connectivity Tests From Vm Instance1 In net_2
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}[1] @{NET_2_L3_VM_IPS}[0] ${dst_list}
192 [Teardown] OpenStackOperations.Get OvsDebugInfo
194 Connectivity Tests From Vm Instance2 In net_2
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}[1] @{NET_2_L3_VM_IPS}[1] ${dst_list}
198 [Teardown] OpenStackOperations.Get OvsDebugInfo
200 Connectivity Tests From Vm Instance3 In net_2
201 [Documentation] ssh to the VM instance and test operations.
202 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
203 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_L3_VM_IPS}[2] ${dst_list}
204 [Teardown] OpenStackOperations.Get OvsDebugInfo
206 Bring Up ODL2 and ODL3
207 [Documentation] Bring up ODL2 and ODL3 again.
208 ClusterManagement.Start Members From List Or All ${ODL_2_AND_3_DOWN}
210 Take Down All Instances
211 [Documentation] Stop karaf on all controllers
212 ClusterManagement.Kill Members From List Or All
214 Bring Up All Instances
215 [Documentation] Bring up all controllers
216 ClusterManagement.Start Members From List Or All
218 Connectivity Tests From Vm Instance2 In net_2 after recovering all nodes
219 [Documentation] ssh to the VM instance and test operations.
220 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
221 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_L3_VM_IPS}[1] ${dst_list}
222 [Teardown] OpenStackOperations.Get OvsDebugInfo
224 Connectivity Tests From Vm Instance3 In net_2 after recovering all nodes
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}[2] ${dst_list}
228 [Teardown] OpenStackOperations.Get OvsDebugInfo
230 Delete Vm Instances In net_1
231 [Documentation] Delete Vm instances using instance names in net_1.
232 : FOR ${vm} IN @{NET_1_VMS}
233 \ OpenStackOperations.Delete Vm Instance ${vm}
235 Delete Vm Instances In net_2
236 [Documentation] Delete Vm instances using instance names in net_2.
237 : FOR ${vm} IN @{NET_2_VMS}
238 \ OpenStackOperations.Delete Vm Instance ${vm}
240 Delete Router Interfaces
241 [Documentation] Remove Interface to the subnets.
242 : FOR ${interface} IN @{SUBNETS}
243 \ OpenStackOperations.Remove Interface @{ROUTERS}[2] ${interface}
246 [Documentation] Delete Router and Interface to the subnets.
247 OpenStackOperations.Delete Router @{ROUTERS}[1]
248 OpenStackOperations.Delete Router @{ROUTERS}[2]
250 Verify Deleted Routers
251 [Documentation] Check deleted routers using northbound rest calls
252 ${data} = Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
254 BuiltIn.Should Not Contain ${data} @{ROUTERS}[2]
256 Delete Sub Network In net_1
257 [Documentation] Delete Sub Nets for the Networks with neutron request.
258 OpenStackOperations.Delete SubNet @{SUBNETS}[0]
260 Delete Sub Network In net_2
261 [Documentation] Delete Sub Nets for the Networks with neutron request.
262 OpenStackOperations.Delete SubNet @{SUBNETS}[1]
265 [Documentation] Delete Networks with neutron request.
266 : FOR ${network} IN @{NETWORKS}
267 \ OpenStackOperations.Delete Network ${network}
269 Delete Security Group
270 [Documentation] Delete security groups with neutron request
271 OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
274 [Documentation] Verify that flows have been cleaned up properly after removing all neutron configurations
275 DataModels.Verify Flows Are Cleaned Up On All OpenStack Nodes