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 Teardown Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
6 ... AND Get OvsDebugInfo
8 Library OperatingSystem
9 Library RequestsLibrary
10 Resource ../../../libraries/Utils.robot
11 Resource ../../../libraries/OpenStackOperations.robot
12 Resource ../../../libraries/DevstackUtils.robot
13 Resource ../../../libraries/ClusterManagement.robot
16 @{NETWORKS_NAME} l3_net_1 l3_net_2
17 @{SUBNETS_NAME} l3_sub_net_1 l3_sub_net_2
18 @{NET_1_VM_INSTANCES} VmInstance1_net_1 VmInstance2_net_1 VmInstance3_net_1
19 @{NET_2_VM_INSTANCES} VmInstance1_net_2 VmInstance2_net_2 VmInstance3_net_2
20 @{NET_1_VM_IPS} 90.0.0.3 90.0.0.4 90.0.0.5
21 @{NET_2_VM_IPS} 100.0.0.3 100.0.0.4 100.0.0.5
22 @{GATEWAY_IPS} 90.0.0.1 100.0.0.1
23 @{DHCP_IPS} 90.0.0.2 100.0.0.2
24 @{SUBNETS_RANGE} 90.0.0.0/24 100.0.0.0/24
25 @{odl_1_and_2_down} ${1} ${2}
26 @{odl_2_and_3_down} ${2} ${3}
29 Create All Controller Sessions
30 [Documentation] Create sessions for all three contorllers.
31 ClusterManagement.ClusterManagement Setup
34 [Documentation] Create Network with neutron request.
35 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
36 \ OpenStackOperations.Create Network ${NetworkElement}
38 Create Subnets For l3_net_1
39 [Documentation] Create Sub Nets for the Networks with neutron request.
40 OpenStackOperations.Create SubNet l3_net_1 l3_sub_net_1 @{SUBNETS_RANGE}[0]
42 Create Subnets For l3_net_2
43 [Documentation] Create Sub Nets for the Networks with neutron request.
44 OpenStackOperations.Create SubNet l3_net_2 l3_sub_net_2 @{SUBNETS_RANGE}[1]
47 [Documentation] Kill the karaf in First Controller
48 ClusterManagement.Kill Single Member 1
50 Create Vm Instances For l3_net_1
51 [Documentation] Create Four Vm instances using flavor and image names for a network.
52 OpenStackOperations.Create Vm Instances l3_net_1 ${NET_1_VM_INSTANCES} sg=csit
55 [Documentation] Bring up ODL1 again
56 ClusterManagement.Start Single Member 1
59 [Documentation] Kill the karaf in Second Controller
60 ClusterManagement.Kill Single Member 2
62 Create Vm Instances For l3_net_2
63 [Documentation] Create Four Vm instances using flavor and image names for a network.
64 OpenStackOperations.Create Vm Instances l3_net_2 ${NET_2_VM_INSTANCES} sg=csit
67 [Documentation] Bring up ODL2 again
68 ClusterManagement.Start Single Member 2
71 [Documentation] Kill the karaf in Third Controller
72 ClusterManagement.Kill Single Member 3
74 Create Router router_2
75 [Documentation] Create Router and Add Interface to the subnets. this fails sometimes.
76 OpenStackOperations.Create Router router_2
77 [Teardown] Report_Failure_Due_To_Bug 6117
79 Create Router router_3
80 [Documentation] Create Router and Add Interface to the subnets.
81 OpenStackOperations.Create Router router_3
83 Add Interfaces To Router
84 [Documentation] Add Interfaces
85 : FOR ${interface} IN @{SUBNETS_NAME}
86 \ OpenStackOperations.Add Router Interface router_3 ${interface}
88 Verify Created Routers
89 [Documentation] Check created routers using northbound rest calls
90 ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
92 Should Contain ${data} router_3
95 [Documentation] Bring up ODL3 again
96 ClusterManagement.Start Single Member 3
98 Ping Vm Instance1 In l3_net_2 From l3_net_1
99 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
101 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[0]
103 Ping Vm Instance2 In l3_net_2 From l3_net_1
104 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
106 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[1]
108 Ping Vm Instance3 In l3_net_2 From l3_net_1
109 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
111 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[2]
113 Ping Vm Instance1 In l3_net_1 From l3_net_2
114 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
116 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[0]
118 Ping Vm Instance2 In l3_net_1 From l3_net_2
119 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
121 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[1]
123 Ping Vm Instance3 In l3_net_1 From l3_net_2
124 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
126 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[2]
128 Take Down ODL1 and ODL2
129 [Documentation] Kill the karaf in First and Second Controller
130 ClusterManagement.Kill Members From List Or All ${odl_1_and_2_down}
132 Connectivity Tests From Vm Instance1 In l3_net_1
133 [Documentation] Logging to the vm instance using generated key pair.
134 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[1] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
136 ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2] @{NET_2_VM_IPS}[1]
137 Log ${other_dst_ip_list}
139 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}
141 Connectivity Tests From Vm Instance2 In l3_net_1
142 [Documentation] Logging to the vm instance using generated key pair.
143 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
145 ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
146 Log ${other_dst_ip_list}
148 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}
150 Connectivity Tests From Vm Instance3 In l3_net_1
151 [Documentation] Logging to the vm instance using generated key pair.
152 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1]
154 ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
155 Log ${other_dst_ip_list}
157 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}
159 Bring Up ODL1 and ODL2
160 [Documentation] Bring up ODL1 and ODL2 again
161 ClusterManagement.Start Members From List Or All ${odl_1_and_2_down}
163 Take Down ODL2 and ODL3
164 [Documentation] Kill the karaf in First and Second Controller
165 ClusterManagement.Kill Members From List Or All ${odl_2_and_3_down}
167 Connectivity Tests From Vm Instance1 In l3_net_2
168 [Documentation] Logging to the vm instance using generated key pair.
169 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[1] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
171 ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
172 Log ${other_dst_ip_list}
174 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}
176 Connectivity Tests From Vm Instance2 In l3_net_2
177 [Documentation] Logging to the vm instance using generated key pair.
178 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
180 ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
181 Log ${other_dst_ip_list}
183 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}
185 Connectivity Tests From Vm Instance3 In l3_net_2
186 [Documentation] Logging to the vm instance using generated key pair.
187 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[1]
189 ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
190 Log ${other_dst_ip_list}
192 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}
194 Bring Up ODL2 and ODL3
195 [Documentation] Bring up ODL2 and ODL3 again.
196 ClusterManagement.Start Members From List Or All ${odl_2_and_3_down}
198 Delete Vm Instances In l3_net_1
199 [Documentation] Delete Vm instances using instance names in l3_net_1.
200 : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
201 \ OpenStackOperations.Delete Vm Instance ${VmElement}
203 Delete Vm Instances In l3_net_2
204 [Documentation] Delete Vm instances using instance names in l3_net_2.
205 : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
206 \ OpenStackOperations.Delete Vm Instance ${VmElement}
208 Delete Router Interfaces
209 [Documentation] Remove Interface to the subnets.
210 : FOR ${interface} IN @{SUBNETS_NAME}
211 \ OpenStackOperations.Remove Interface router_3 ${interface}
214 [Documentation] Delete Router and Interface to the subnets.
215 OpenStackOperations.Delete Router router_2
216 OpenStackOperations.Delete Router router_3
218 Verify Deleted Routers
219 [Documentation] Check deleted routers using northbound rest calls
220 ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
222 Should Not Contain ${data} router_3
224 Delete Sub Networks In l3_net_1
225 [Documentation] Delete Sub Nets for the Networks with neutron request.
226 OpenStackOperations.Delete SubNet l3_sub_net_1
228 Delete Sub Networks In l3_net_2
229 [Documentation] Delete Sub Nets for the Networks with neutron request.
230 OpenStackOperations.Delete SubNet l3_sub_net_2
233 [Documentation] Delete Networks with neutron request.
234 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
235 \ OpenStackOperations.Delete Network ${NetworkElement}