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 @{NETWORKS_NAME} l3_net_1 l3_net_2
22 @{SUBNETS_NAME} l3_sub_net_1 l3_sub_net_2
23 @{NET_1_VM_INSTANCES} VmInstance1_net_1 VmInstance2_net_1 VmInstance3_net_1
24 @{NET_2_VM_INSTANCES} VmInstance1_net_2 VmInstance2_net_2 VmInstance3_net_2
25 @{GATEWAY_IPS} 90.0.0.1 100.0.0.1
26 @{SUBNETS_RANGE} 90.0.0.0/24 100.0.0.0/24
27 @{odl_1_and_2_down} ${1} ${2}
28 @{odl_2_and_3_down} ${2} ${3}
31 Create All Controller Sessions
32 [Documentation] Create sessions for all three contorllers.
33 ClusterManagement.ClusterManagement Setup
36 [Documentation] Create Network with neutron request.
37 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
38 \ OpenStackOperations.Create Network ${NetworkElement}
40 Create Subnets For l3_net_1
41 [Documentation] Create Sub Nets for the Networks with neutron request.
42 OpenStackOperations.Create SubNet l3_net_1 l3_sub_net_1 @{SUBNETS_RANGE}[0]
44 Create Subnets For l3_net_2
45 [Documentation] Create Sub Nets for the Networks with neutron request.
46 OpenStackOperations.Create SubNet l3_net_2 l3_sub_net_2 @{SUBNETS_RANGE}[1]
49 [Documentation] Kill the karaf in First Controller
50 ClusterManagement.Kill Single Member 1
52 Create Vm Instances For l3_net_1
53 [Documentation] Create Four Vm instances using flavor and image names for a network.
54 OpenStackOperations.Create Vm Instances l3_net_1 ${NET_1_VM_INSTANCES} sg=csit
57 [Documentation] Bring up ODL1 again
58 ClusterManagement.Start Single Member 1
61 [Documentation] Kill the karaf in Second Controller
62 ClusterManagement.Kill Single Member 2
64 Create Vm Instances For l3_net_2
65 [Documentation] Create Four Vm instances using flavor and image names for a network.
66 OpenStackOperations.Create Vm Instances l3_net_2 ${NET_2_VM_INSTANCES} sg=csit
68 Check Vm Instances Have Ip Address
69 [Documentation] Test case to verify that all created VMs are ready and have received their ip addresses.
70 ... We are polling first and longest on the last VM created assuming that if it's received it's address
71 ... already the other instances should have theirs already or at least shortly thereafter.
72 # first, ensure all VMs are in ACTIVE state. if not, we can just fail the test case and not waste time polling
74 : FOR ${vm} IN @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
75 \ Wait Until Keyword Succeeds 15s 5s Verify VM Is ACTIVE ${vm}
76 ${NET1_VM_COUNT} Get Length ${NET_1_VM_INSTANCES}
77 ${NET2_VM_COUNT} Get Length ${NET_2_VM_INSTANCES}
78 ${LOOP_COUNT} Evaluate ${NET1_VM_COUNT}+${NET2_VM_COUNT}
79 : FOR ${index} IN RANGE 1 ${LOOP_COUNT}
80 \ ${NET1_L3_VM_IPS} ${NET1_DHCP_IP} Verify VMs Received DHCP Lease @{NET_1_VM_INSTANCES}
81 \ ${NET2_L3_VM_IPS} ${NET2_DHCP_IP} Verify VMs Received DHCP Lease @{NET_2_VM_INSTANCES}
82 \ ${NET1_VM_LIST_LENGTH}= Get Length ${NET1_L3_VM_IPS}
83 \ ${NET2_VM_LIST_LENGTH}= Get Length ${NET2_L3_VM_IPS}
84 \ Exit For Loop If ${NET1_VM_LIST_LENGTH}==${NET1_VM_COUNT} and ${NET2_VM_LIST_LENGTH}==${NET2_VM_COUNT}
85 Set Suite Variable ${NET1_L3_VM_IPS}
86 Set Suite Variable ${NET1_DHCP_IP}
87 Set Suite Variable ${NET2_L3_VM_IPS}
88 Set Suite Variable ${NET2_DHCP_IP}
89 [Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
90 ... AND Get Test Teardown Debugs
93 [Documentation] Bring up ODL2 again
94 ClusterManagement.Start Single Member 2
97 [Documentation] Kill the karaf in Third Controller
98 ClusterManagement.Kill Single Member 3
100 Create Router router_2
101 [Documentation] Create Router and Add Interface to the subnets. this fails sometimes.
102 OpenStackOperations.Create Router router_2
103 [Teardown] Report_Failure_Due_To_Bug 6117
105 Create Router router_3
106 [Documentation] Create Router and Add Interface to the subnets.
107 OpenStackOperations.Create Router router_3
109 Add Interfaces To Router
110 [Documentation] Add Interfaces
111 : FOR ${interface} IN @{SUBNETS_NAME}
112 \ OpenStackOperations.Add Router Interface router_3 ${interface}
114 Verify Created Routers
115 [Documentation] Check created routers using northbound rest calls
116 ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
118 Should Contain ${data} router_3
121 [Documentation] Bring up ODL3 again
122 ClusterManagement.Start Single Member 3
124 Ping Vm Instance1 In l3_net_2 From l3_net_1
125 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
126 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET2_L3_VM_IPS}[0]
128 Ping Vm Instance2 In l3_net_2 From l3_net_1
129 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
130 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET2_L3_VM_IPS}[1]
132 Ping Vm Instance3 In l3_net_2 From l3_net_1
133 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
134 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET2_L3_VM_IPS}[2]
136 Ping Vm Instance1 In l3_net_1 From l3_net_2
137 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
138 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET1_L3_VM_IPS}[0]
140 Ping Vm Instance2 In l3_net_1 From l3_net_2
141 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
142 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET1_L3_VM_IPS}[1]
144 Ping Vm Instance3 In l3_net_1 From l3_net_2
145 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
146 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET1_L3_VM_IPS}[2]
148 Take Down ODL1 and ODL2
149 [Documentation] Kill the karaf in First and Second Controller
150 ClusterManagement.Kill Members From List Or All ${odl_1_and_2_down}
152 Connectivity Tests From Vm Instance1 In l3_net_1
153 [Documentation] ssh to the VM instance and test operations.
154 ${dst_ip_list}= Create List @{NET2_L3_VM_IPS} @{NET1_L3_VM_IPS}
156 OpenStackOperations.Test Operations From Vm Instance l3_net_1 @{NET1_L3_VM_IPS}[0] ${dst_ip_list}
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}
164 Connectivity Tests From Vm Instance3 In l3_net_1
165 [Documentation] ssh to the VM instance and test operations.
166 ${dst_ip_list}= Create List @{NET2_L3_VM_IPS} @{NET1_L3_VM_IPS}
168 OpenStackOperations.Test Operations From Vm Instance l3_net_1 @{NET1_L3_VM_IPS}[2] ${dst_ip_list}
170 Bring Up ODL1 and ODL2
171 [Documentation] Bring up ODL1 and ODL2 again
172 ClusterManagement.Start Members From List Or All ${odl_1_and_2_down}
174 Take Down ODL2 and ODL3
175 [Documentation] Kill the karaf in First and Second Controller
176 ClusterManagement.Kill Members From List Or All ${odl_2_and_3_down}
178 Connectivity Tests From Vm Instance1 In l3_net_2
179 [Documentation] ssh to the VM instance and test operations.
180 ${dst_ip_list}= Create List @{NET2_L3_VM_IPS} @{NET1_L3_VM_IPS}
182 OpenStackOperations.Test Operations From Vm Instance l3_net_2 @{NET2_L3_VM_IPS}[0] ${dst_ip_list}
184 Connectivity Tests From Vm Instance2 In l3_net_2
185 [Documentation] ssh to the VM instance and test operations.
186 ${dst_ip_list}= Create List @{NET2_L3_VM_IPS} @{NET1_L3_VM_IPS}
188 OpenStackOperations.Test Operations From Vm Instance l3_net_2 @{NET2_L3_VM_IPS}[1] ${dst_ip_list}
190 Connectivity Tests From Vm Instance3 In l3_net_2
191 [Documentation] ssh to the VM instance and test operations.
192 ${dst_ip_list}= Create List @{NET2_L3_VM_IPS} @{NET1_L3_VM_IPS}
194 OpenStackOperations.Test Operations From Vm Instance l3_net_2 @{NET2_L3_VM_IPS}[2] ${dst_ip_list}
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 l3_net_1
201 [Documentation] Delete Vm instances using instance names in l3_net_1.
202 : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
203 \ OpenStackOperations.Delete Vm Instance ${VmElement}
205 Delete Vm Instances In l3_net_2
206 [Documentation] Delete Vm instances using instance names in l3_net_2.
207 : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
208 \ OpenStackOperations.Delete Vm Instance ${VmElement}
210 Delete Router Interfaces
211 [Documentation] Remove Interface to the subnets.
212 : FOR ${interface} IN @{SUBNETS_NAME}
213 \ OpenStackOperations.Remove Interface router_3 ${interface}
216 [Documentation] Delete Router and Interface to the subnets.
217 OpenStackOperations.Delete Router router_2
218 OpenStackOperations.Delete Router router_3
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 Should Not Contain ${data} router_3
226 Delete Sub Networks In l3_net_1
227 [Documentation] Delete Sub Nets for the Networks with neutron request.
228 OpenStackOperations.Delete SubNet l3_sub_net_1
230 Delete Sub Networks In l3_net_2
231 [Documentation] Delete Sub Nets for the Networks with neutron request.
232 OpenStackOperations.Delete SubNet l3_sub_net_2
235 [Documentation] Delete Networks with neutron request.
236 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
237 \ OpenStackOperations.Delete Network ${NetworkElement}