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
12 Resource ../../../variables/netvirt/Variables.robot
14 Suite Setup Suite Setup
15 Suite Teardown OpenStackOperations.OpenStack Suite Teardown
16 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
17 Test Teardown OpenStackOperations.Get Test Teardown Debugs
21 ${SECURITY_GROUP} l3_sg
22 @{NETWORKS} l3_net_1 l3_net_2 l3_net_3 l3_net_4 l3_net_5
23 @{SUBNETS_1} l3_sub_1 l3_sub_2 l3_sub_3
24 @{SUBNETS_2} l3_sub_4 l3_sub_5
25 @{ROUTER} l3_router1 l3_router2
26 @{NET_1_VMS} l3_net_1_vm_1 l3_net_1_vm_2 l3_net_1_vm_3
27 @{NET_2_VMS} l3_net_2_vm_1 l3_net_2_vm_2 l3_net_2_vm_3
28 @{NET_3_VMS} l3_net_3_vm_1 l3_net_3_vm_2 l3_net_3_vm_3
29 @{NET_4_VMS} l3_net_4_vm_1
30 @{NET_5_VMS} l3_net_5_vm_1
31 @{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
32 @{NET_VLAN_ID} 1131 1132 1133
36 Ping Vm Instance1 In net_2 From net_1 (vxlan to vlan)
37 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
38 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_2_L3_VM_IPS}[0]
40 Ping Vm Instance2 In net_2 From net_1 (vxlan to vlan)
41 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
42 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_2_L3_VM_IPS}[1]
44 Ping Vm Instance3 In net_2 From net_1 (vxlan to vlan)
45 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
46 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[0] ${NET_2_L3_VM_IPS}[2]
48 Ping Vm Instance1 In net_1 From net_2 (vlan to vxlan)
49 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
50 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_1_L3_VM_IPS}[0]
52 Ping Vm Instance2 In net_1 From net_2 (vlan to vxlan)
53 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
54 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_1_L3_VM_IPS}[1]
56 Ping Vm Instance3 In net_1 From net_2 (vlan to vxlan)
57 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
58 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_1_L3_VM_IPS}[2]
60 Ping Vm Instance1 In net_3 From net_2 (vxlan to vxlan)
61 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
62 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_3_L3_VM_IPS}[0]
64 Ping Vm Instance2 In net_3 From net_2 (vxlan to vxlan)
65 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
66 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_3_L3_VM_IPS}[1]
68 Ping Vm Instance3 In net_3 From net_2 (vxlan to vxlan)
69 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
70 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[1] ${NET_3_L3_VM_IPS}[2]
72 Connectivity Tests From Vm Instance1 In net_1
73 [Documentation] Login to the VM instance and test operations
74 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
75 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_L3_VM_IPS}[0] ${dst_list}
77 Connectivity Tests From Vm Instance2 In net_1
78 [Documentation] Login to the vm instance and test operations
79 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
80 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_L3_VM_IPS}[1] ${dst_list}
82 Connectivity Tests From Vm Instance3 In net_1
83 [Documentation] Login to the vm instance and test operations
84 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
85 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[0] ${NET_1_L3_VM_IPS}[2] ${dst_list}
87 Connectivity Tests From Vm Instance1 In net_2
88 [Documentation] Login to the vm instance and test operations
89 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
90 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_L3_VM_IPS}[0] ${dst_list}
92 Connectivity Tests From Vm Instance2 In net_2
93 [Documentation] Logging to the vm instance using generated key pair.
94 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
95 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_L3_VM_IPS}[1] ${dst_list}
97 Connectivity Tests From Vm Instance3 In net_2
98 [Documentation] Logging to the vm instance using generated key pair.
99 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
100 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[1] ${NET_2_L3_VM_IPS}[2] ${dst_list}
102 Delete Vm Instances In net_1
103 [Documentation] Delete Vm instances using instance names in net_1.
105 FOR ${vm} IN @{NET_1_VMS}
106 OpenStackOperations.Delete Vm Instance ${vm}
109 Delete Vm Instances In net_2
110 [Documentation] Delete Vm instances using instance names in net_2.
112 FOR ${vm} IN @{NET_2_VMS}
113 OpenStackOperations.Delete Vm Instance ${vm}
116 Delete Vm Instances In net_3
117 [Documentation] Delete Vm instances using instance names in net_3.
119 FOR ${vm} IN @{NET_3_VMS}
120 OpenStackOperations.Delete Vm Instance ${vm}
123 Create Vm Instances For net_4
124 [Documentation] Create VM instances using flavor and image names for a network.
126 OpenStackOperations.Create Vm Instance On Compute Node
129 ... ${OS_CMP1_HOSTNAME}
130 ... sg=${SECURITY_GROUP}
132 Create Vm Instances For net_5
133 [Documentation] Create VM instances using flavor and image names for a network.
135 OpenStackOperations.Create Vm Instance On Compute Node
138 ... ${OS_CMP2_HOSTNAME}
139 ... sg=${SECURITY_GROUP}
142 [Documentation] Create Router
144 OpenStackOperations.Create Router ${ROUTER}[1]
146 Add net_4 Interfaces To Router2
147 [Documentation] Add Interfaces
149 OpenStackOperations.Add Router Interface ${ROUTER}[1] ${SUBNETS_2}[0]
151 Check Vm Instances on net_4 and net_5 Have Ip Address
153 @{NET_4_L3_VM_IPS} ${NET_4_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_4_VMS}
154 @{NET_5_L3_VM_IPS} ${NET_5_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_5_VMS}
155 BuiltIn.Set Suite Variable @{NET_4_L3_VM_IPS}
156 BuiltIn.Set Suite Variable @{NET_5_L3_VM_IPS}
157 BuiltIn.Should Not Contain ${NET_4_L3_VM_IPS} None
158 BuiltIn.Should Not Contain ${NET_5_L3_VM_IPS} None
159 BuiltIn.Should Not Contain ${NET_4_L3_DHCP_IP} None
160 BuiltIn.Should Not Contain ${NET_5_L3_DHCP_IP} None
161 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Show Debugs @{NET_4_VMS} @{NET_5_VMS}
162 ... AND OpenStackOperations.Get Test Teardown Debugs
164 Add net_5 Interfaces To Router2
165 [Documentation] Add Interfaces
167 OpenStackOperations.Add Router Interface ${ROUTER}[1] ${SUBNETS_2}[1]
169 Ping Vm Instance5 In net_5 From net_4 (vlan to vlan)
170 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
172 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[3] ${NET_5_L3_VM_IPS}[0]
174 Ping Vm Instance5 In net_4 From net_5 (vlan to vlan)
175 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
177 OpenStackOperations.Ping Vm From DHCP Namespace ${NETWORKS}[4] ${NET_4_L3_VM_IPS}[0]
179 Connectivity Tests From Vm Instance4 In net_5
180 [Documentation] Check reachability of vm instance on a different network with one vlan vm in source and destination.
182 ${dst_list} = BuiltIn.Create List @{NET_4_L3_VM_IPS}
183 OpenStackOperations.Test Operations From Vm Instance ${NETWORKS}[4] ${NET_5_L3_VM_IPS}[0] ${dst_list}
188 OpenStackOperations.OpenStack Suite Setup
189 OpenStackOperations.Create Network
191 ... --provider-network-type vlan --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} --provider-segment ${NET_VLAN_ID}[0]
192 OpenStackOperations.Create SubNet ${NETWORKS}[0] ${SUBNETS_1}[0] ${SUBNET_CIDRS}[0]
193 OpenStackOperations.Create Network ${NETWORKS}[1]
194 OpenStackOperations.Create SubNet ${NETWORKS}[1] ${SUBNETS_1}[1] ${SUBNET_CIDRS}[1]
195 OpenStackOperations.Create Network ${NETWORKS}[2]
196 OpenStackOperations.Create SubNet ${NETWORKS}[2] ${SUBNETS_1}[2] ${SUBNET_CIDRS}[2]
197 OpenStackOperations.Create Network
199 ... --provider-network-type vlan --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} --provider-segment ${NET_VLAN_ID}[1]
200 OpenStackOperations.Create SubNet ${NETWORKS}[3] ${SUBNETS_2}[0] ${SUBNET_CIDRS}[3]
201 OpenStackOperations.Create Network
203 ... --provider-network-type vlan --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} --provider-segment ${NET_VLAN_ID}[2]
204 OpenStackOperations.Create SubNet ${NETWORKS}[4] ${SUBNETS_2}[1] ${SUBNET_CIDRS}[4]
205 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
206 OpenStackOperations.Create Vm Instance On Compute Node
209 ... ${OS_CMP1_HOSTNAME}
210 ... sg=${SECURITY_GROUP}
211 OpenStackOperations.Create Vm Instance On Compute Node
214 ... ${OS_CMP1_HOSTNAME}
215 ... sg=${SECURITY_GROUP}
216 OpenStackOperations.Create Vm Instance On Compute Node
219 ... ${OS_CMP2_HOSTNAME}
220 ... sg=${SECURITY_GROUP}
221 OpenStackOperations.Create Vm Instance On Compute Node
224 ... ${OS_CMP1_HOSTNAME}
225 ... sg=${SECURITY_GROUP}
226 OpenStackOperations.Create Vm Instance On Compute Node
229 ... ${OS_CMP2_HOSTNAME}
230 ... sg=${SECURITY_GROUP}
231 OpenStackOperations.Create Vm Instance On Compute Node
234 ... ${OS_CMP2_HOSTNAME}
235 ... sg=${SECURITY_GROUP}
236 OpenStackOperations.Create Vm Instance On Compute Node
239 ... ${OS_CMP1_HOSTNAME}
240 ... sg=${SECURITY_GROUP}
241 OpenStackOperations.Create Vm Instance On Compute Node
244 ... ${OS_CMP1_HOSTNAME}
245 ... sg=${SECURITY_GROUP}
246 OpenStackOperations.Create Vm Instance On Compute Node
249 ... ${OS_CMP2_HOSTNAME}
250 ... sg=${SECURITY_GROUP}
251 @{NET_1_L3_VM_IPS} ${NET_1_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
252 @{NET_2_L3_VM_IPS} ${NET_2_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
253 @{NET_3_L3_VM_IPS} ${NET_3_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_3_VMS}
254 BuiltIn.Set Suite Variable @{NET_1_L3_VM_IPS}
255 BuiltIn.Set Suite Variable @{NET_2_L3_VM_IPS}
256 BuiltIn.Set Suite Variable @{NET_3_L3_VM_IPS}
257 BuiltIn.Should Not Contain ${NET_1_L3_VM_IPS} None
258 BuiltIn.Should Not Contain ${NET_2_L3_VM_IPS} None
259 BuiltIn.Should Not Contain ${NET_3_L3_VM_IPS} None
260 BuiltIn.Should Not Contain ${NET_1_L3_DHCP_IP} None
261 BuiltIn.Should Not Contain ${NET_2_L3_DHCP_IP} None
262 BuiltIn.Should Not Contain ${NET_3_L3_DHCP_IP} None
263 OpenStackOperations.Create Router ${ROUTER}[0]
264 FOR ${interface} IN @{SUBNETS_1}
265 OpenStackOperations.Add Router Interface ${ROUTER}[0] ${interface}
267 OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS} @{NET_3_VMS}
268 OpenStackOperations.Get Suite Debugs