2 Documentation Test suite to check connectivity in L3 using routers.
5 Library OperatingSystem
6 Library RequestsLibrary
7 Resource ../../../libraries/DevstackUtils.robot
8 Resource ../../../libraries/DataModels.robot
9 Resource ../../../libraries/OpenStackOperations.robot
10 Resource ../../../libraries/SetupUtils.robot
11 Resource ../../../libraries/Utils.robot
13 Suite Setup Suite Setup
14 Suite Teardown OpenStackOperations.OpenStack Suite Teardown
15 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
16 Test Teardown OpenStackOperations.Get Test Teardown Debugs
20 ${SECURITY_GROUP} l3_sg
21 @{NETWORKS} l3_net_1 l3_net_2 l3_net_3 l3_net_4 l3_net_5
22 @{SUBNETS_1} l3_sub_1 l3_sub_2 l3_sub_3
23 @{SUBNETS_2} l3_sub_4 l3_sub_5
24 @{ROUTER} l3_router1 l3_router2
25 @{NET_1_VMS} l3_net_1_vm_1 l3_net_1_vm_2 l3_net_1_vm_3
26 @{NET_2_VMS} l3_net_2_vm_1 l3_net_2_vm_2 l3_net_2_vm_3
27 @{NET_3_VMS} l3_net_3_vm_1 l3_net_3_vm_2 l3_net_3_vm_3
28 @{NET_4_VMS} l3_net_4_vm_1
29 @{NET_5_VMS} l3_net_5_vm_1
30 @{SUBNET_CIDRS} 31.0.0.0/24 32.0.0.0/24 33.0.0.0/24 34.0.0.0/24 35.0.0.0/24
31 @{NET_VLAN_ID} 1131 1132 1133
35 Ping Vm Instance1 In net_2 From net_1 (vxlan to vlan)
36 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
37 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_2_L3_VM_IPS}[0]
39 Ping Vm Instance2 In net_2 From net_1 (vxlan to vlan)
40 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
41 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_2_L3_VM_IPS}[1]
43 Ping Vm Instance3 In net_2 From net_1 (vxlan to vlan)
44 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
45 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_2_L3_VM_IPS}[2]
47 Ping Vm Instance1 In net_1 From net_2 (vlan to vxlan)
48 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
49 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_1_L3_VM_IPS}[0]
51 Ping Vm Instance2 In net_1 From net_2 (vlan to vxlan)
52 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
53 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_1_L3_VM_IPS}[1]
55 Ping Vm Instance3 In net_1 From net_2 (vlan to vxlan)
56 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
57 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_1_L3_VM_IPS}[2]
59 Ping Vm Instance1 In net_3 From net_2 (vxlan to vxlan)
60 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
61 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_3_L3_VM_IPS}[0]
63 Ping Vm Instance2 In net_3 From net_2 (vxlan to vxlan)
64 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
65 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_3_L3_VM_IPS}[1]
67 Ping Vm Instance3 In net_3 From net_2 (vxlan to vxlan)
68 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
69 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_3_L3_VM_IPS}[2]
71 Connectivity Tests From Vm Instance1 In net_1
72 [Documentation] Login to the VM instance and test operations
73 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
74 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_L3_VM_IPS}[0] ${dst_list}
76 Connectivity Tests From Vm Instance2 In net_1
77 [Documentation] Login to the vm instance and test operations
78 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
79 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_L3_VM_IPS}[1] ${dst_list}
81 Connectivity Tests From Vm Instance3 In net_1
82 [Documentation] Login to the vm instance and test operations
83 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
84 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_L3_VM_IPS}[2] ${dst_list}
86 Connectivity Tests From Vm Instance1 In net_2
87 [Documentation] Login to the vm instance and test operations
88 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
89 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_L3_VM_IPS}[0] ${dst_list}
91 Connectivity Tests From Vm Instance2 In net_2
92 [Documentation] Logging to the vm instance using generated key pair.
93 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
94 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_L3_VM_IPS}[1] ${dst_list}
96 Connectivity Tests From Vm Instance3 In net_2
97 [Documentation] Logging to the vm instance using generated key pair.
98 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
99 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_L3_VM_IPS}[2] ${dst_list}
101 Delete Vm Instances In net_1
102 [Documentation] Delete Vm instances using instance names in net_1.
104 FOR ${vm} IN @{NET_1_VMS}
105 OpenStackOperations.Delete Vm Instance ${vm}
108 Delete Vm Instances In net_2
109 [Documentation] Delete Vm instances using instance names in net_2.
111 FOR ${vm} IN @{NET_2_VMS}
112 OpenStackOperations.Delete Vm Instance ${vm}
115 Delete Vm Instances In net_3
116 [Documentation] Delete Vm instances using instance names in net_3.
118 FOR ${vm} IN @{NET_3_VMS}
119 OpenStackOperations.Delete Vm Instance ${vm}
122 Create Vm Instances For net_4
123 [Documentation] Create VM instances using flavor and image names for a network.
125 OpenStackOperations.Create Vm Instance On Compute Node
128 ... ${OS_CMP1_HOSTNAME}
129 ... sg=${SECURITY_GROUP}
131 Create Vm Instances For net_5
132 [Documentation] Create VM instances using flavor and image names for a network.
134 OpenStackOperations.Create Vm Instance On Compute Node
137 ... ${OS_CMP2_HOSTNAME}
138 ... sg=${SECURITY_GROUP}
141 [Documentation] Create Router
143 OpenStackOperations.Create Router ${ROUTER}[1]
145 Add net_4 Interfaces To Router2
146 [Documentation] Add Interfaces
148 OpenStackOperations.Add Router Interface ${ROUTER}[1] ${SUBNETS_2}[0]
150 Check Vm Instances on net_4 and net_5 Have Ip Address
152 @{NET_4_L3_VM_IPS} ${NET_4_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_4_VMS}
153 @{NET_5_L3_VM_IPS} ${NET_5_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_5_VMS}
154 BuiltIn.Set Suite Variable @{NET_4_L3_VM_IPS}
155 BuiltIn.Set Suite Variable @{NET_5_L3_VM_IPS}
156 BuiltIn.Should Not Contain ${NET_4_L3_VM_IPS} None
157 BuiltIn.Should Not Contain ${NET_5_L3_VM_IPS} None
158 BuiltIn.Should Not Contain ${NET_4_L3_DHCP_IP} None
159 BuiltIn.Should Not Contain ${NET_5_L3_DHCP_IP} None
160 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Show Debugs @{NET_4_VMS} @{NET_5_VMS}
161 ... AND OpenStackOperations.Get Test Teardown Debugs
163 Add net_5 Interfaces To Router2
164 [Documentation] Add Interfaces
166 OpenStackOperations.Add Router Interface ${ROUTER}[1] ${SUBNETS_2}[1]
168 Ping Vm Instance5 In net_5 From net_4 (vlan to vlan)
169 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
171 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[3] ${NET_5_L3_VM_IPS}[0]
173 Ping Vm Instance5 In net_4 From net_5 (vlan to vlan)
174 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
176 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[4] ${NET_4_L3_VM_IPS}[0]
178 Connectivity Tests From Vm Instance4 In net_5
179 [Documentation] Check reachability of vm instance on a different network with one vlan vm in source and destination.
181 ${dst_list} = BuiltIn.Create List @{NET_4_L3_VM_IPS}
182 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[4] ${NET_5_L3_VM_IPS}[0] ${dst_list}
187 OpenStackOperations.OpenStack Suite Setup
188 OpenStackOperations.Create Network
190 ... --provider-network-type vlan --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} --provider-segment ${NET_VLAN_ID}[0]
191 OpenStackOperations.Create SubNet ${NETWORKS}[0] ${SUBNETS_1}[0] ${SUBNET_CIDRS}[0]
192 OpenStackOperations.Create Network ${NETWORKS}[1]
193 OpenStackOperations.Create SubNet ${NETWORKS}[1] ${SUBNETS_1}[1] ${SUBNET_CIDRS}[1]
194 OpenStackOperations.Create Network ${NETWORKS}[2]
195 OpenStackOperations.Create SubNet ${NETWORKS}[2] ${SUBNETS_1}[2] ${SUBNET_CIDRS}[2]
196 OpenStackOperations.Create Network
198 ... --provider-network-type vlan --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} --provider-segment ${NET_VLAN_ID}[1]
199 OpenStackOperations.Create SubNet ${NETWORKS}[3] ${SUBNETS_2}[0] ${SUBNET_CIDRS}[3]
200 OpenStackOperations.Create Network
202 ... --provider-network-type vlan --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} --provider-segment ${NET_VLAN_ID}[2]
203 OpenStackOperations.Create SubNet ${NETWORKS}[4] ${SUBNETS_2}[1] ${SUBNET_CIDRS}[4]
204 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
205 OpenStackOperations.Create Vm Instance On Compute Node
208 ... ${OS_CMP1_HOSTNAME}
209 ... sg=${SECURITY_GROUP}
210 OpenStackOperations.Create Vm Instance On Compute Node
213 ... ${OS_CMP1_HOSTNAME}
214 ... sg=${SECURITY_GROUP}
215 OpenStackOperations.Create Vm Instance On Compute Node
218 ... ${OS_CMP2_HOSTNAME}
219 ... sg=${SECURITY_GROUP}
220 OpenStackOperations.Create Vm Instance On Compute Node
223 ... ${OS_CMP1_HOSTNAME}
224 ... sg=${SECURITY_GROUP}
225 OpenStackOperations.Create Vm Instance On Compute Node
228 ... ${OS_CMP2_HOSTNAME}
229 ... sg=${SECURITY_GROUP}
230 OpenStackOperations.Create Vm Instance On Compute Node
233 ... ${OS_CMP2_HOSTNAME}
234 ... sg=${SECURITY_GROUP}
235 OpenStackOperations.Create Vm Instance On Compute Node
238 ... ${OS_CMP1_HOSTNAME}
239 ... sg=${SECURITY_GROUP}
240 OpenStackOperations.Create Vm Instance On Compute Node
243 ... ${OS_CMP1_HOSTNAME}
244 ... sg=${SECURITY_GROUP}
245 OpenStackOperations.Create Vm Instance On Compute Node
248 ... ${OS_CMP2_HOSTNAME}
249 ... sg=${SECURITY_GROUP}
250 @{NET_1_L3_VM_IPS} ${NET_1_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
251 @{NET_2_L3_VM_IPS} ${NET_2_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
252 @{NET_3_L3_VM_IPS} ${NET_3_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_3_VMS}
253 BuiltIn.Set Suite Variable @{NET_1_L3_VM_IPS}
254 BuiltIn.Set Suite Variable @{NET_2_L3_VM_IPS}
255 BuiltIn.Set Suite Variable @{NET_3_L3_VM_IPS}
256 BuiltIn.Should Not Contain ${NET_1_L3_VM_IPS} None
257 BuiltIn.Should Not Contain ${NET_2_L3_VM_IPS} None
258 BuiltIn.Should Not Contain ${NET_3_L3_VM_IPS} None
259 BuiltIn.Should Not Contain ${NET_1_L3_DHCP_IP} None
260 BuiltIn.Should Not Contain ${NET_2_L3_DHCP_IP} None
261 BuiltIn.Should Not Contain ${NET_3_L3_DHCP_IP} None
262 OpenStackOperations.Create Router ${ROUTER}[0]
263 FOR ${interface} IN @{SUBNETS_1}
264 OpenStackOperations.Add Router Interface ${ROUTER}[0] ${interface}
266 OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS} @{NET_3_VMS}
267 OpenStackOperations.Get Suite Debugs