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 contorllers.
35 ClusterManagement.ClusterManagement Setup
38 [Documentation] Create Network with neutron request.
39 : FOR ${NetworkElement} IN @{NETWORKS}
40 \ OpenStackOperations.Create Network ${NetworkElement}
42 Create Subnets For net_1
43 [Documentation] Create Sub Nets for the Networks with neutron request.
44 OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] @{SUBNET_CIDRS}[0]
46 Create Subnets For net_2
47 [Documentation] Create Sub Nets for the Networks with neutron request.
48 OpenStackOperations.Create SubNet @{NETWORKS}[1] @{SUBNETS}[1] @{SUBNET_CIDRS}[1]
50 Add Ssh Allow All Rule
51 [Documentation] Allow all TCP/UDP/ICMP packets for this suite
52 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
55 [Documentation] Kill the karaf in First Controller
56 ClusterManagement.Kill Single Member 1
58 Create Vm Instances For net_1
59 [Documentation] Create Vm instances using flavor and image names for a network.
60 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] @{NET_1_VMS}[0] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
61 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] @{NET_1_VMS}[1] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
62 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] @{NET_1_VMS}[2] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
65 [Documentation] Bring up ODL1 again
66 ClusterManagement.Start Single Member 1
69 [Documentation] Kill the karaf in Second Controller
70 ClusterManagement.Kill Single Member 2
72 Create Vm Instances For net_2
73 [Documentation] Create Vm instances using flavor and image names for a network.
74 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[1] @{NET_2_VMS}[0] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
75 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[1] @{NET_2_VMS}[1] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
76 OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[1] @{NET_2_VMS}[2] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
78 Check Vm Instances Have Ip Address
79 @{NET_1_L3_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
80 @{NET_2_L3_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
81 BuiltIn.Set Suite Variable @{NET_1_L3_VM_IPS}
82 BuiltIn.Set Suite Variable @{NET_2_L3_VM_IPS}
83 BuiltIn.Should Not Contain ${NET_1_L3_VM_IPS} None
84 BuiltIn.Should Not Contain ${NET_2_L3_VM_IPS} None
85 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
86 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
87 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS}
88 ... AND OpenStackOperations.Get Test Teardown Debugs
91 [Documentation] Bring up ODL2 again
92 ClusterManagement.Start Single Member 2
95 [Documentation] Kill the karaf in Third Controller
96 ClusterManagement.Kill Single Member 3
98 Create Router router_2
99 [Documentation] Create Router and Add Interface to the subnets.
100 OpenStackOperations.Create Router @{ROUTERS}[1]
101 [Teardown] Report_Failure_Due_To_Bug 6117
103 Create Router router_3
104 [Documentation] Create Router and Add Interface to the subnets.
105 OpenStackOperations.Create Router @{ROUTERS}[2]
107 Add Interfaces To Router
108 [Documentation] Add Interfaces
109 : FOR ${interface} IN @{SUBNETS}
110 \ OpenStackOperations.Add Router Interface @{ROUTERS}[2] ${interface}
112 Verify Created Routers
113 [Documentation] Check created routers using northbound rest calls
114 ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
116 Should Contain ${data} @{ROUTERS}[2]
119 [Documentation] Bring up ODL3 again
120 ClusterManagement.Start Single Member 3
122 Ping Vm Instance1 In net_2 From net_1
123 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
124 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[0]
126 Ping Vm Instance2 In net_2 From net_1
127 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
128 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[1]
130 Ping Vm Instance3 In net_2 From net_1
131 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
132 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[2]
134 Ping Vm Instance1 In net_1 From net_2
135 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
136 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[0]
138 Ping Vm Instance2 In net_1 From net_2
139 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
140 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[1]
142 Ping Vm Instance3 In net_1 From net_2
143 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
144 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[2]
146 Take Down ODL1 and ODL2
147 [Documentation] Kill the karaf in First and Second Controller
148 ClusterManagement.Kill Members From List Or All ${ODL_1_AND_2_DOWN}
149 [Teardown] OpenStackOperations.Get OvsDebugInfo
151 Connectivity Tests From Vm Instance1 In net_1
152 [Documentation] ssh to the VM instance and test operations.
153 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
154 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[0] ${dst_list}
155 [Teardown] OpenStackOperations.Get OvsDebugInfo
157 Connectivity Tests From Vm Instance2 In net_1
158 [Documentation] ssh to the VM instance and test operations.
159 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
160 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[1] ${dst_list}
161 [Teardown] OpenStackOperations.Get OvsDebugInfo
163 Connectivity Tests From Vm Instance3 In net_1
164 [Documentation] ssh to the VM instance and test operations.
165 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
166 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[2] ${dst_list}
167 [Teardown] OpenStackOperations.Get OvsDebugInfo
169 Bring Up ODL1 and ODL2
170 [Documentation] Bring up ODL1 and ODL2 again
171 ClusterManagement.Start Members From List Or All ${ODL_1_AND_2_DOWN}
173 Take Down ODL2 and ODL3
174 [Documentation] Kill the karaf in First and Second Controller
175 ClusterManagement.Kill Members From List Or All ${ODL_2_AND_3_DOWN}
176 [Teardown] OpenStackOperations.Get OvsDebugInfo
178 Connectivity Tests From Vm Instance1 In net_2
179 [Documentation] ssh to the VM instance and test operations.
180 ${dst_list} = BuiltIn.Create List @{NET_2_L3_VM_IPS} @{NET_1_L3_VM_IPS}
181 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_L3_VM_IPS}[0] ${dst_list}
182 [Teardown] OpenStackOperations.Get OvsDebugInfo
184 Connectivity Tests From Vm Instance2 In net_2
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}[1] @{NET_2_L3_VM_IPS}[1] ${dst_list}
188 [Teardown] OpenStackOperations.Get OvsDebugInfo
190 Connectivity Tests From Vm Instance3 In net_2
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}[1] @{NET_2_L3_VM_IPS}[2] ${dst_list}
194 [Teardown] OpenStackOperations.Get OvsDebugInfo
196 Bring Up ODL2 and ODL3
197 [Documentation] Bring up ODL2 and ODL3 again.
198 ClusterManagement.Start Members From List Or All ${ODL_2_AND_3_DOWN}
200 Delete Vm Instances In net_1
201 [Documentation] Delete Vm instances using instance names in net_1.
202 : FOR ${vm} IN @{NET_1_VMS}
203 \ OpenStackOperations.Delete Vm Instance ${vm}
205 Delete Vm Instances In net_2
206 [Documentation] Delete Vm instances using instance names in net_2.
207 : FOR ${vm} IN @{NET_2_VMS}
208 \ OpenStackOperations.Delete Vm Instance ${vm}
210 Delete Router Interfaces
211 [Documentation] Remove Interface to the subnets.
212 : FOR ${interface} IN @{SUBNETS}
213 \ OpenStackOperations.Remove Interface @{ROUTERS}[2] ${interface}
216 [Documentation] Delete Router and Interface to the subnets.
217 OpenStackOperations.Delete Router @{ROUTERS}[1]
218 OpenStackOperations.Delete Router @{ROUTERS}[2]
220 Verify Deleted Routers
221 [Documentation] Check deleted routers using northbound rest calls
222 ${data} = Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
224 BuiltIn.Should Not Contain ${data} @{ROUTERS}[2]
226 Delete Sub Network In net_1
227 [Documentation] Delete Sub Nets for the Networks with neutron request.
228 OpenStackOperations.Delete SubNet @{SUBNETS}[0]
230 Delete Sub Network In net_2
231 [Documentation] Delete Sub Nets for the Networks with neutron request.
232 OpenStackOperations.Delete SubNet @{SUBNETS}[1]
235 [Documentation] Delete Networks with neutron request.
236 : FOR ${network} IN @{NETWORKS}
237 \ OpenStackOperations.Delete Network ${network}
239 Delete Security Group
240 [Documentation] Delete security groups with neutron request
241 OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
244 [Documentation] Verify that flows have been cleaned up properly after removing all neutron configurations
245 DataModels.Verify Flows Are Cleaned Up On All OpenStack Nodes