2 Documentation Test suite to check connectivity in L3 using routers.
3 Suite Setup Devstack Suite Setup source_pwd=yes
4 Suite Teardown Close All Connections
5 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
6 Test Teardown 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 Variables ../../../variables/Variables.py
21 ${SECURITY_GROUP} sg-clustering
22 @{NETWORKS_NAME} l3_net_1 l3_net_2
23 @{SUBNETS_NAME} l3_sub_net_1 l3_sub_net_2
24 @{NET_1_VM_INSTANCES} VmInstance1_net_1 VmInstance2_net_1 VmInstance3_net_1
25 @{NET_2_VM_INSTANCES} VmInstance1_net_2 VmInstance2_net_2 VmInstance3_net_2
26 @{GATEWAY_IPS} 90.0.0.1 100.0.0.1
27 @{SUBNETS_RANGE} 90.0.0.0/24 100.0.0.0/24
28 @{odl_1_and_2_down} ${1} ${2}
29 @{odl_2_and_3_down} ${2} ${3}
32 Create All Controller Sessions
33 [Documentation] Create sessions for all three contorllers.
34 ClusterManagement.ClusterManagement Setup
37 [Documentation] Create Network with neutron request.
38 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
39 \ OpenStackOperations.Create Network ${NetworkElement}
41 Create Subnets For l3_net_1
42 [Documentation] Create Sub Nets for the Networks with neutron request.
43 OpenStackOperations.Create SubNet l3_net_1 l3_sub_net_1 @{SUBNETS_RANGE}[0]
45 Create Subnets For l3_net_2
46 [Documentation] Create Sub Nets for the Networks with neutron request.
47 OpenStackOperations.Create SubNet l3_net_2 l3_sub_net_2 @{SUBNETS_RANGE}[1]
50 [Documentation] Allow all TCP/UDP/ICMP packets for this suite
51 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
54 [Documentation] Kill the karaf in First Controller
55 ClusterManagement.Kill Single Member 1
57 Create Vm Instances For l3_net_1
58 [Documentation] Create Four Vm instances using flavor and image names for a network.
59 OpenStackOperations.Create Vm Instances l3_net_1 ${NET_1_VM_INSTANCES} sg=${SECURITY_GROUP}
62 [Documentation] Bring up ODL1 again
63 ClusterManagement.Start Single Member 1
66 [Documentation] Kill the karaf in Second Controller
67 ClusterManagement.Kill Single Member 2
69 Create Vm Instances For l3_net_2
70 [Documentation] Create Four Vm instances using flavor and image names for a network.
71 OpenStackOperations.Create Vm Instances l3_net_2 ${NET_2_VM_INSTANCES} sg=${SECURITY_GROUP}
73 Check Vm Instances Have Ip Address
74 [Documentation] Test case to verify that all created VMs are ready and have received their ip addresses.
75 ... We are polling first and longest on the last VM created assuming that if it's received it's address
76 ... already the other instances should have theirs already or at least shortly thereafter.
77 # first, ensure all VMs are in ACTIVE state. if not, we can just fail the test case and not waste time polling
79 @{NET1_L3_VM_IPS} ${NET1_DHCP_IP} = Get VM IPs @{NET_1_VM_INSTANCES}
80 @{NET2_L3_VM_IPS} ${NET2_DHCP_IP} = Get VM IPs @{NET_2_VM_INSTANCES}
81 Set Suite Variable @{NET1_L3_VM_IPS}
82 Set Suite Variable @{NET2_L3_VM_IPS}
83 Should Not Contain ${NET1_L3_VM_IPS} None
84 Should Not Contain ${NET2_L3_VM_IPS} None
85 Should Not Contain ${NET1_DHCP_IP} None
86 Should Not Contain ${NET2_DHCP_IP} None
87 [Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
88 ... AND 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. this fails sometimes.
100 OpenStackOperations.Create Router router_2
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 router_3
107 Add Interfaces To Router
108 [Documentation] Add Interfaces
109 : FOR ${interface} IN @{SUBNETS_NAME}
110 \ OpenStackOperations.Add Router Interface router_3 ${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} router_3
119 [Documentation] Bring up ODL3 again
120 ClusterManagement.Start Single Member 3
122 Ping Vm Instance1 In l3_net_2 From l3_net_1
123 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
124 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET2_L3_VM_IPS}[0]
126 Ping Vm Instance2 In l3_net_2 From l3_net_1
127 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
128 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET2_L3_VM_IPS}[1]
130 Ping Vm Instance3 In l3_net_2 From l3_net_1
131 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
132 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET2_L3_VM_IPS}[2]
134 Ping Vm Instance1 In l3_net_1 From l3_net_2
135 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
136 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET1_L3_VM_IPS}[0]
138 Ping Vm Instance2 In l3_net_1 From l3_net_2
139 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
140 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET1_L3_VM_IPS}[1]
142 Ping Vm Instance3 In l3_net_1 From l3_net_2
143 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
144 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET1_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] Get OvsDebugInfo
151 Connectivity Tests From Vm Instance1 In l3_net_1
152 [Documentation] ssh to the VM instance and test operations.
153 ${dst_ip_list}= Create List @{NET2_L3_VM_IPS} @{NET1_L3_VM_IPS}
155 OpenStackOperations.Test Operations From Vm Instance l3_net_1 @{NET1_L3_VM_IPS}[0] ${dst_ip_list}
156 [Teardown] Get OvsDebugInfo
158 Connectivity Tests From Vm Instance2 In l3_net_1
159 [Documentation] ssh to the VM instance and test operations.
160 ${dst_ip_list}= Create List @{NET2_L3_VM_IPS} @{NET1_L3_VM_IPS}
162 OpenStackOperations.Test Operations From Vm Instance l3_net_1 @{NET1_L3_VM_IPS}[1] ${dst_ip_list}
163 [Teardown] Get OvsDebugInfo
165 Connectivity Tests From Vm Instance3 In l3_net_1
166 [Documentation] ssh to the VM instance and test operations.
167 ${dst_ip_list}= Create List @{NET2_L3_VM_IPS} @{NET1_L3_VM_IPS}
169 OpenStackOperations.Test Operations From Vm Instance l3_net_1 @{NET1_L3_VM_IPS}[2] ${dst_ip_list}
170 [Teardown] Get OvsDebugInfo
172 Bring Up ODL1 and ODL2
173 [Documentation] Bring up ODL1 and ODL2 again
174 ClusterManagement.Start Members From List Or All ${odl_1_and_2_down}
176 Take Down ODL2 and ODL3
177 [Documentation] Kill the karaf in First and Second Controller
178 ClusterManagement.Kill Members From List Or All ${odl_2_and_3_down}
179 [Teardown] Get OvsDebugInfo
181 Connectivity Tests From Vm Instance1 In l3_net_2
182 [Documentation] ssh to the VM instance and test operations.
183 ${dst_ip_list}= Create List @{NET2_L3_VM_IPS} @{NET1_L3_VM_IPS}
185 OpenStackOperations.Test Operations From Vm Instance l3_net_2 @{NET2_L3_VM_IPS}[0] ${dst_ip_list}
186 [Teardown] Get OvsDebugInfo
188 Connectivity Tests From Vm Instance2 In l3_net_2
189 [Documentation] ssh to the VM instance and test operations.
190 ${dst_ip_list}= Create List @{NET2_L3_VM_IPS} @{NET1_L3_VM_IPS}
192 OpenStackOperations.Test Operations From Vm Instance l3_net_2 @{NET2_L3_VM_IPS}[1] ${dst_ip_list}
193 [Teardown] Get OvsDebugInfo
195 Connectivity Tests From Vm Instance3 In l3_net_2
196 [Documentation] ssh to the VM instance and test operations.
197 ${dst_ip_list}= Create List @{NET2_L3_VM_IPS} @{NET1_L3_VM_IPS}
199 OpenStackOperations.Test Operations From Vm Instance l3_net_2 @{NET2_L3_VM_IPS}[2] ${dst_ip_list}
200 [Teardown] Get OvsDebugInfo
202 Bring Up ODL2 and ODL3
203 [Documentation] Bring up ODL2 and ODL3 again.
204 ClusterManagement.Start Members From List Or All ${odl_2_and_3_down}
206 Delete Vm Instances In l3_net_1
207 [Documentation] Delete Vm instances using instance names in l3_net_1.
208 : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
209 \ OpenStackOperations.Delete Vm Instance ${VmElement}
211 Delete Vm Instances In l3_net_2
212 [Documentation] Delete Vm instances using instance names in l3_net_2.
213 : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
214 \ OpenStackOperations.Delete Vm Instance ${VmElement}
216 Delete Router Interfaces
217 [Documentation] Remove Interface to the subnets.
218 : FOR ${interface} IN @{SUBNETS_NAME}
219 \ OpenStackOperations.Remove Interface router_3 ${interface}
222 [Documentation] Delete Router and Interface to the subnets.
223 OpenStackOperations.Delete Router router_2
224 OpenStackOperations.Delete Router router_3
226 Verify Deleted Routers
227 [Documentation] Check deleted routers using northbound rest calls
228 ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
230 Should Not Contain ${data} router_3
232 Delete Sub Networks In l3_net_1
233 [Documentation] Delete Sub Nets for the Networks with neutron request.
234 OpenStackOperations.Delete SubNet l3_sub_net_1
236 Delete Sub Networks In l3_net_2
237 [Documentation] Delete Sub Nets for the Networks with neutron request.
238 OpenStackOperations.Delete SubNet l3_sub_net_2
241 [Documentation] Delete Networks with neutron request.
242 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
243 \ OpenStackOperations.Delete Network ${NetworkElement}
245 Delete Security Group
246 [Documentation] Delete security groups with neutron request
247 Delete SecurityGroup ${SECURITY_GROUP}
250 [Documentation] Verify that flows have been cleaned up properly after removing all neutron configurations
251 Verify Flows Are Cleaned Up On All OpenStack Nodes