2 Documentation Test suite to check connectivity in L3 using routers.
3 Suite Setup Devstack Suite Setup Tests source_pwd=yes
4 Suite Teardown Close All Connections
5 Test Teardown Run Keywords Show Debugs ${NET_1_VM_INSTANCES}
6 ... AND Show Debugs ${NET_2_VM_INSTANCES}
7 ... AND Get OvsDebugInfo
9 Library OperatingSystem
10 Library RequestsLibrary
11 Resource ../../../libraries/Utils.robot
12 Resource ../../../libraries/OpenStackOperations.robot
13 Resource ../../../libraries/DevstackUtils.robot
14 Resource ../../../libraries/ClusterManagement.robot
17 @{NETWORKS_NAME} l3_net_1 l3_net_2
18 @{SUBNETS_NAME} l3_sub_net_1 l3_sub_net_2
19 @{NET_1_VM_INSTANCES} VmInstance1_net_1 VmInstance2_net_1 VmInstance3_net_1
20 @{NET_2_VM_INSTANCES} VmInstance1_net_2 VmInstance2_net_2 VmInstance3_net_2
21 @{NET_1_VM_IPS} 90.0.0.3 90.0.0.4 90.0.0.5
22 @{NET_2_VM_IPS} 100.0.0.3 100.0.0.4 100.0.0.5
23 @{GATEWAY_IPS} 90.0.0.1 100.0.0.1
24 @{DHCP_IPS} 90.0.0.2 100.0.0.2
25 @{SUBNETS_RANGE} 90.0.0.0/24 100.0.0.0/24
26 @{odl_1_and_2_down} ${1} ${2}
27 @{odl_2_and_3_down} ${2} ${3}
30 Create All Controller Sessions
31 [Documentation] Create sessions for all three contorllers.
32 ClusterManagement.ClusterManagement Setup
35 [Documentation] Create Network with neutron request.
36 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
37 \ OpenStackOperations.Create Network ${NetworkElement}
39 Create Subnets For l3_net_1
40 [Documentation] Create Sub Nets for the Networks with neutron request.
41 OpenStackOperations.Create SubNet l3_net_1 l3_sub_net_1 @{SUBNETS_RANGE}[0]
43 Create Subnets For l3_net_2
44 [Documentation] Create Sub Nets for the Networks with neutron request.
45 OpenStackOperations.Create SubNet l3_net_2 l3_sub_net_2 @{SUBNETS_RANGE}[1]
48 [Documentation] Kill the karaf in First Controller
49 ClusterManagement.Kill Single Member 1
51 Create Vm Instances For l3_net_1
52 [Documentation] Create Four Vm instances using flavor and image names for a network.
53 OpenStackOperations.Create Vm Instances l3_net_1 ${NET_1_VM_INSTANCES} sg=csit
56 [Documentation] Bring up ODL1 again
57 ClusterManagement.Start Single Member 1
60 [Documentation] Kill the karaf in Second Controller
61 ClusterManagement.Kill Single Member 2
63 Create Vm Instances For l3_net_2
64 [Documentation] Create Four Vm instances using flavor and image names for a network.
65 OpenStackOperations.Create Vm Instances l3_net_2 ${NET_2_VM_INSTANCES} sg=csit
68 [Documentation] Bring up ODL2 again
69 ClusterManagement.Start Single Member 2
72 [Documentation] Kill the karaf in Third Controller
73 ClusterManagement.Kill Single Member 3
75 Create Router router_2
76 [Documentation] Create Router and Add Interface to the subnets. this fails sometimes.
77 OpenStackOperations.Create Router router_2
78 [Teardown] Report_Failure_Due_To_Bug 6117
80 Create Router router_3
81 [Documentation] Create Router and Add Interface to the subnets.
82 OpenStackOperations.Create Router router_3
84 Add Interfaces To Router
85 [Documentation] Add Interfaces
86 : FOR ${interface} IN @{SUBNETS_NAME}
87 \ OpenStackOperations.Add Router Interface router_3 ${interface}
89 Verify Created Routers
90 [Documentation] Check created routers using northbound rest calls
91 ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
93 Should Contain ${data} router_3
96 [Documentation] Bring up ODL3 again
97 ClusterManagement.Start Single Member 3
99 Ping Vm Instance1 In l3_net_2 From l3_net_1
100 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
102 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[0]
104 Ping Vm Instance2 In l3_net_2 From l3_net_1
105 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
107 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[1]
109 Ping Vm Instance3 In l3_net_2 From l3_net_1
110 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
112 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[2]
114 Ping Vm Instance1 In l3_net_1 From l3_net_2
115 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
117 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[0]
119 Ping Vm Instance2 In l3_net_1 From l3_net_2
120 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
122 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[1]
124 Ping Vm Instance3 In l3_net_1 From l3_net_2
125 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
127 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[2]
129 Take Down ODL1 and ODL2
130 [Documentation] Kill the karaf in First and Second Controller
131 ClusterManagement.Kill Members From List Or All ${odl_1_and_2_down}
133 Connectivity Tests From Vm Instance1 In l3_net_1
134 [Documentation] Logging to the vm instance using generated key pair.
135 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[1] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
137 ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2] @{NET_2_VM_IPS}[1]
138 Log ${other_dst_ip_list}
140 OpenStackOperations.Test Operations From Vm Instance l3_net_1 @{NET_1_VM_IPS}[0] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
142 Connectivity Tests From Vm Instance2 In l3_net_1
143 [Documentation] Logging to the vm instance using generated key pair.
144 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
146 ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
147 Log ${other_dst_ip_list}
149 OpenStackOperations.Test Operations From Vm Instance l3_net_1 @{NET_1_VM_IPS}[1] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
151 Connectivity Tests From Vm Instance3 In l3_net_1
152 [Documentation] Logging to the vm instance using generated key pair.
153 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1]
155 ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
156 Log ${other_dst_ip_list}
158 OpenStackOperations.Test Operations From Vm Instance l3_net_1 @{NET_1_VM_IPS}[2] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
160 Bring Up ODL1 and ODL2
161 [Documentation] Bring up ODL1 and ODL2 again
162 ClusterManagement.Start Members From List Or All ${odl_1_and_2_down}
164 Take Down ODL2 and ODL3
165 [Documentation] Kill the karaf in First and Second Controller
166 ClusterManagement.Kill Members From List Or All ${odl_2_and_3_down}
168 Connectivity Tests From Vm Instance1 In l3_net_2
169 [Documentation] Logging to the vm instance using generated key pair.
170 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[1] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
172 ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
173 Log ${other_dst_ip_list}
175 OpenStackOperations.Test Operations From Vm Instance l3_net_2 @{NET_2_VM_IPS}[0] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
177 Connectivity Tests From Vm Instance2 In l3_net_2
178 [Documentation] Logging to the vm instance using generated key pair.
179 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
181 ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
182 Log ${other_dst_ip_list}
184 OpenStackOperations.Test Operations From Vm Instance l3_net_2 @{NET_2_VM_IPS}[1] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
186 Connectivity Tests From Vm Instance3 In l3_net_2
187 [Documentation] Logging to the vm instance using generated key pair.
188 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[1]
190 ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
191 Log ${other_dst_ip_list}
193 OpenStackOperations.Test Operations From Vm Instance l3_net_2 @{NET_2_VM_IPS}[2] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
195 Bring Up ODL2 and ODL3
196 [Documentation] Bring up ODL2 and ODL3 again.
197 ClusterManagement.Start Members From List Or All ${odl_2_and_3_down}
199 Delete Vm Instances In l3_net_1
200 [Documentation] Delete Vm instances using instance names in l3_net_1.
201 : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
202 \ OpenStackOperations.Delete Vm Instance ${VmElement}
204 Delete Vm Instances In l3_net_2
205 [Documentation] Delete Vm instances using instance names in l3_net_2.
206 : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
207 \ OpenStackOperations.Delete Vm Instance ${VmElement}
209 Delete Router Interfaces
210 [Documentation] Remove Interface to the subnets.
211 : FOR ${interface} IN @{SUBNETS_NAME}
212 \ OpenStackOperations.Remove Interface router_3 ${interface}
215 [Documentation] Delete Router and Interface to the subnets.
216 OpenStackOperations.Delete Router router_2
217 OpenStackOperations.Delete Router router_3
219 Verify Deleted Routers
220 [Documentation] Check deleted routers using northbound rest calls
221 ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
223 Should Not Contain ${data} router_3
225 Delete Sub Networks In l3_net_1
226 [Documentation] Delete Sub Nets for the Networks with neutron request.
227 OpenStackOperations.Delete SubNet l3_sub_net_1
229 Delete Sub Networks In l3_net_2
230 [Documentation] Delete Sub Nets for the Networks with neutron request.
231 OpenStackOperations.Delete SubNet l3_sub_net_2
234 [Documentation] Delete Networks with neutron request.
235 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
236 \ OpenStackOperations.Delete Network ${NetworkElement}