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 Setup Log Testcase Start To Controller Karaf
7 Library OperatingSystem
8 Library RequestsLibrary
9 Resource ../../../libraries/Utils.robot
10 Resource ../../../libraries/OpenStackOperations.robot
11 Resource ../../../libraries/DevstackUtils.robot
12 Resource ../../../libraries/ClusterManagement.robot
15 @{NETWORKS_NAME} l3_net_1 l3_net_2
16 @{SUBNETS_NAME} l3_sub_net_1 l3_sub_net_2
17 @{NET_1_VM_INSTANCES} VmInstance1_net_1 VmInstance2_net_1 VmInstance3_net_1
18 @{NET_2_VM_INSTANCES} VmInstance1_net_2 VmInstance2_net_2 VmInstance3_net_2
19 @{NET_1_VM_IPS} 90.0.0.3 90.0.0.4 90.0.0.5
20 @{NET_2_VM_IPS} 100.0.0.3 100.0.0.4 100.0.0.5
21 @{GATEWAY_IPS} 90.0.0.1 100.0.0.1
22 @{DHCP_IPS} 90.0.0.2 100.0.0.2
23 @{SUBNETS_RANGE} 90.0.0.0/24 100.0.0.0/24
24 @{odl_1_and_2_down} ${1} ${2}
25 @{odl_2_and_3_down} ${2} ${3}
28 Create All Controller Sessions
29 [Documentation] Create sessions for all three contorllers.
30 ClusterManagement.ClusterManagement Setup
33 [Documentation] Create Network with neutron request.
34 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
35 \ OpenStackOperations.Create Network ${NetworkElement}
37 Create Subnets For l3_net_1
38 [Documentation] Create Sub Nets for the Networks with neutron request.
39 OpenStackOperations.Create SubNet l3_net_1 l3_sub_net_1 @{SUBNETS_RANGE}[0]
41 Create Subnets For l3_net_2
42 [Documentation] Create Sub Nets for the Networks with neutron request.
43 OpenStackOperations.Create SubNet l3_net_2 l3_sub_net_2 @{SUBNETS_RANGE}[1]
46 [Documentation] Kill the karaf in First Controller
47 ClusterManagement.Kill Single Member 1
49 Create Vm Instances For l3_net_1
50 [Documentation] Create Four Vm instances using flavor and image names for a network.
51 OpenStackOperations.Create Vm Instances l3_net_1 ${NET_1_VM_INSTANCES}
52 [Teardown] OpenStackOperations.Show Debugs ${NET_1_VM_INSTANCES}
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}
65 [Teardown] Show Debugs ${NET_2_VM_INSTANCES}
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
76 [Documentation] Create Router and Add Interface to the subnets.
77 OpenStackOperations.Create Router router_2
78 OpenStackOperations.Create Router router_3
80 Add Interfaces To Router
81 [Documentation] Add Interfaces
82 : FOR ${interface} IN @{SUBNETS_NAME}
83 \ OpenStackOperations.Add Router Interface router_3 ${interface}
85 Verify Created Routers
86 [Documentation] Check created routers using northbound rest calls
87 ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
89 Should Contain ${data} router_3
92 [Documentation] Bring up ODL3 again
93 ClusterManagement.Start Single Member 3
95 Ping Vm Instance1 In l3_net_2 From l3_net_1
96 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
97 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[0]
99 Ping Vm Instance2 In l3_net_2 From l3_net_1
100 [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}[1]
103 Ping Vm Instance3 In l3_net_2 From l3_net_1
104 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
105 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[2]
107 Ping Vm Instance1 In l3_net_1 From l3_net_2
108 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
109 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[0]
111 Ping Vm Instance2 In l3_net_1 From l3_net_2
112 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
113 OpenStackOperations.Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[1]
115 Ping Vm Instance3 In l3_net_1 From l3_net_2
116 [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}[2]
119 Take Down ODL1 and ODL2
120 [Documentation] Kill the karaf in First and Second Controller
121 ClusterManagement.Kill Members From List Or All ${odl_1_and_2_down}
123 Connectivity Tests From Vm Instance1 In l3_net_1
124 [Documentation] Logging to the vm instance using generated key pair.
125 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[1] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
127 ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2] @{NET_2_VM_IPS}[1]
128 Log ${other_dst_ip_list}
129 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}
131 Connectivity Tests From Vm Instance2 In l3_net_1
132 [Documentation] Logging to the vm instance using generated key pair.
133 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
135 ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
136 Log ${other_dst_ip_list}
137 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}
139 Connectivity Tests From Vm Instance3 In l3_net_1
140 [Documentation] Logging to the vm instance using generated key pair.
141 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1]
143 ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
144 Log ${other_dst_ip_list}
145 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}
147 Bring Up ODL1 and ODL2
148 [Documentation] Bring up ODL1 and ODL2 again
149 ClusterManagement.Start Members From List Or All ${odl_1_and_2_down}
151 Take Down ODL2 and ODL3
152 [Documentation] Kill the karaf in First and Second Controller
153 ClusterManagement.Kill Members From List Or All ${odl_2_and_3_down}
155 Connectivity Tests From Vm Instance1 In l3_net_2
156 [Documentation] Logging to the vm instance using generated key pair.
157 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[1] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
159 ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
160 Log ${other_dst_ip_list}
161 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}
163 Connectivity Tests From Vm Instance2 In l3_net_2
164 [Documentation] Logging to the vm instance using generated key pair.
165 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
167 ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
168 Log ${other_dst_ip_list}
169 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}
171 Connectivity Tests From Vm Instance3 In l3_net_2
172 [Documentation] Logging to the vm instance using generated key pair.
173 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[1]
175 ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
176 Log ${other_dst_ip_list}
177 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}
179 Bring Up ODL2 and ODL3
180 [Documentation] Bring up ODL2 and ODL3 again.
181 ClusterManagement.Start Members From List Or All ${odl_2_and_3_down}
183 Delete Vm Instances In l3_net_1
184 [Documentation] Delete Vm instances using instance names in l3_net_1.
185 : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
186 \ OpenStackOperations.Delete Vm Instance ${VmElement}
188 Delete Vm Instances In l3_net_2
189 [Documentation] Delete Vm instances using instance names in l3_net_2.
190 : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
191 \ OpenStackOperations.Delete Vm Instance ${VmElement}
193 Delete Router Interfaces
194 [Documentation] Remove Interface to the subnets.
195 : FOR ${interface} IN @{SUBNETS_NAME}
196 \ OpenStackOperations.Remove Interface router_3 ${interface}
199 [Documentation] Delete Router and Interface to the subnets.
200 OpenStackOperations.Delete Router router_2
201 OpenStackOperations.Delete Router router_3
203 Verify Deleted Routers
204 [Documentation] Check deleted routers using northbound rest calls
205 ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
207 Should Not Contain ${data} router_3
209 Delete Sub Networks In l3_net_1
210 [Documentation] Delete Sub Nets for the Networks with neutron request.
211 OpenStackOperations.Delete SubNet l3_sub_net_1
213 Delete Sub Networks In l3_net_2
214 [Documentation] Delete Sub Nets for the Networks with neutron request.
215 OpenStackOperations.Delete SubNet l3_sub_net_2
218 [Documentation] Delete Networks with neutron request.
219 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
220 \ OpenStackOperations.Delete Network ${NetworkElement}