2 Documentation Test suite to check connectivity in L3 using routers.
3 Suite Setup BuiltIn.Run Keywords SetupUtils.Setup_Utils_For_Setup_And_Teardown
4 ... AND DevstackUtils.Devstack Suite Setup
5 Suite Teardown OpenStackOperations.OpenStack Suite Teardown
6 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
7 Test Teardown OpenStackOperations.Get Test Teardown Debugs
9 Library OperatingSystem
10 Library RequestsLibrary
11 Resource ../../../libraries/DevstackUtils.robot
12 Resource ../../../libraries/DataModels.robot
13 Resource ../../../libraries/OpenStackOperations.robot
14 Resource ../../../libraries/SetupUtils.robot
15 Resource ../../../libraries/Utils.robot
16 Resource ../../../variables/netvirt/Variables.robot
19 ${SECURITY_GROUP} l3_sg
20 @{NETWORKS} l3_net_1 l3_net_2 l3_net_3
21 @{SUBNETS} l3_sub_1 l3_sub_2 l3_sub_3
23 @{NET_1_VMS} l3_net_1_vm_1 l3_net_1_vm_2 l3_net_1_vm_3
24 @{NET_2_VMS} l3_net_2_vm_1 l3_net_2_vm_2 l3_net_2_vm_3
25 @{NET_3_VMS} l3_net_3_vm_1 l3_net_3_vm_2 l3_net_3_vm_3
26 @{SUBNET_CIDRS} 31.0.0.0/24 32.0.0.0/24 33.0.0.0/24
30 Create VLAN Network net_1
31 [Documentation] Create Network with neutron request.
32 # in the case that the controller under test is using legacy netvirt features, vlan segmentation is not supported,
33 # and we cannot create a vlan network. If those features are installed we will instead stick with vxlan.
34 ${feature_check_status} = OpenStackOperations.Is Feature Installed ${legacy_feature_list}
35 Run Keyword If '${feature_check_status}' == 'True' OpenStackOperations.Create Network @{NETWORKS}[0]
36 ... ELSE OpenStackOperations.Create Network @{NETWORKS}[0] --provider-network-type vlan --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} --provider-segment ${NET_1_VLAN_ID}
38 Create Subnet For net_1
39 [Documentation] Create Sub Nets for the Networks with neutron request.
40 OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] @{SUBNET_CIDRS}[0]
42 Create VXLAN Network net_2
43 [Documentation] Create Network with neutron request.
44 OpenStackOperations.Create Network @{NETWORKS}[1]
46 Create Subnet For net_2
47 [Documentation] Create Sub Nets for the Networks with neutron request.
48 OpenStackOperations.Create SubNet @{NETWORKS}[1] @{SUBNETS}[1] @{SUBNET_CIDRS}[1]
50 Create VXLAN Network net_3
51 [Documentation] Create Network with neutron request.
52 OpenStackOperations.Create Network @{NETWORKS}[2]
54 Create Subnet For net_3
55 [Documentation] Create Sub Nets for the Networks with neutron request.
56 OpenStackOperations.Create SubNet @{NETWORKS}[2] @{SUBNETS}[2] @{SUBNET_CIDRS}[2]
58 Add Ssh Allow All Rule
59 [Documentation] Allow all TCP/UDP/ICMP packets for this suite
60 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
62 Create Vm Instances For net_1
63 [Documentation] Create Vm instances using flavor and image names for a network.
64 OpenStackOperations.Create Vm Instances @{NETWORKS}[0] ${NET_1_VMS} sg=${SECURITY_GROUP}
66 Create Vm Instances For net_2
67 [Documentation] Create Vm instances using flavor and image names for a network.
68 OpenStackOperations.Create Vm Instances @{NETWORKS}[1] ${NET_2_VMS} sg=${SECURITY_GROUP}
70 Create Vm Instances For net_3
71 [Documentation] Create Vm instances using flavor and image names for a network.
72 OpenStackOperations.Create Vm Instances @{NETWORKS}[2] ${NET_3_VMS} sg=${SECURITY_GROUP}
74 Check Vm Instances Have Ip Address
75 @{NET_1_L3_VM_IPS} ${NET_1_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
76 @{NET_2_L3_VM_IPS} ${NET_2_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
77 @{NET_3_L3_VM_IPS} ${NET_3_L3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_3_VMS}
78 BuiltIn.Set Suite Variable ${NET_1_L3_VM_IPS}
79 BuiltIn.Set Suite Variable ${NET_2_L3_VM_IPS}
80 BuiltIn.Set Suite Variable ${NET_3_L3_VM_IPS}
81 BuiltIn.Should Not Contain ${NET_1_L3_VM_IPS} None
82 BuiltIn.Should Not Contain ${NET_2_L3_VM_IPS} None
83 BuiltIn.Should Not Contain ${NET_3_L3_VM_IPS} None
84 BuiltIn.Should Not Contain ${NET_1_L3_DHCP_IP} None
85 BuiltIn.Should Not Contain ${NET_2_L3_DHCP_IP} None
86 BuiltIn.Should Not Contain ${NET_3_L3_DHCP_IP} None
87 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS} @{NET_3_VMS}
88 ... AND OpenStackOperations.Get Test Teardown Debugs
91 [Documentation] Create Router
92 OpenStackOperations.Create Router ${ROUTER}
94 Add Interfaces To Router
95 [Documentation] Add Interfaces
96 : FOR ${interface} IN @{SUBNETS}
97 \ OpenStackOperations.Add Router Interface ${ROUTER} ${interface}
99 Ping Vm Instance1 In net_2 From net_1 (vxlan to vlan)
100 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
101 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[0]
103 Ping Vm Instance2 In net_2 From net_1 (vxlan to vlan)
104 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
105 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[1]
107 Ping Vm Instance3 In net_2 From net_1 (vxlan to vlan)
108 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
109 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_2_L3_VM_IPS}[2]
111 Ping Vm Instance1 In net_1 From net_2 (vlan to vxlan)
112 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
113 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[0]
115 Ping Vm Instance2 In net_1 From net_2 (vlan to vxlan)
116 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
117 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[1]
119 Ping Vm Instance3 In net_1 From net_2 (vlan to vxlan)
120 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
121 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_1_L3_VM_IPS}[2]
123 Ping Vm Instance1 In net_3 From net_2 (vxlan to vxlan)
124 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
125 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_3_L3_VM_IPS}[0]
127 Ping Vm Instance2 In net_3 From net_2 (vxlan to vxlan)
128 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
129 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_3_L3_VM_IPS}[1]
131 Ping Vm Instance3 In net_3 From net_2 (vxlan to vxlan)
132 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
133 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_3_L3_VM_IPS}[2]
135 Connectivity Tests From Vm Instance1 In net_1
136 [Documentation] Login to the VM instance and test operations
137 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
138 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[0] ${dst_list}
140 Connectivity Tests From Vm Instance2 In net_1
141 [Documentation] Login to the vm instance and test operations
142 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
143 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[1] ${dst_list}
145 Connectivity Tests From Vm Instance3 In net_1
146 [Documentation] Login to the vm instance and test operations
147 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
148 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_L3_VM_IPS}[2] ${dst_list}
150 Connectivity Tests From Vm Instance1 In net_2
151 [Documentation] Login to the vm instance and test operations
152 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
153 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_L3_VM_IPS}[0] ${dst_list}
155 Connectivity Tests From Vm Instance2 In net_2
156 [Documentation] Logging to the vm instance using generated key pair.
157 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
158 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_L3_VM_IPS}[1] ${dst_list}
160 Connectivity Tests From Vm Instance3 In net_2
161 [Documentation] Logging to the vm instance using generated key pair.
162 ${dst_list} = BuiltIn.Create List @{NET_1_L3_VM_IPS} @{NET_2_L3_VM_IPS}
163 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_L3_VM_IPS}[2] ${dst_list}
165 Delete Vm Instances In net_1
166 [Documentation] Delete Vm instances using instance names in net_1.
167 : FOR ${vm} IN @{NET_1_VMS}
168 \ OpenStackOperations.Delete Vm Instance ${vm}
170 Delete Vm Instances In net_2
171 [Documentation] Delete Vm instances using instance names in net_2.
172 : FOR ${vm} IN @{NET_2_VMS}
173 \ OpenStackOperations.Delete Vm Instance ${vm}
175 Delete Vm Instances In net_3
176 [Documentation] Delete Vm instances using instance names in net_3.
177 : FOR ${vm} IN @{NET_3_VMS}
178 \ OpenStackOperations.Delete Vm Instance ${vm}
180 Delete Router Interfaces
181 [Documentation] Remove Interface to the subnets.
182 : FOR ${interface} IN @{SUBNETS}
183 \ OpenStackOperations.Remove Interface ${ROUTER} ${interface}
186 [Documentation] Delete Router and Interface to the subnets.
187 OpenStackOperations.Delete Router ${ROUTER}
189 Delete Sub Network In net_1
190 [Documentation] Delete Sub Net for the Network with neutron request.
191 OpenStackOperations.Delete SubNet l3_sub_1
193 Delete Sub Network In net_2
194 [Documentation] Delete Sub Net for the Network with neutron request.
195 OpenStackOperations.Delete SubNet l3_sub_2
197 Delete Sub Network In net_3
198 [Documentation] Delete Sub Net for the Network with neutron request.
199 OpenStackOperations.Delete SubNet l3_sub_3
202 [Documentation] Delete Networks with neutron request.
203 : FOR ${network} IN @{NETWORKS}
204 \ OpenStackOperations.Delete Network ${network}
206 Delete Security Group
207 [Documentation] Delete security group with neutron request
208 OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
211 [Documentation] Verify that flows have been cleaned up properly after removing all neutron configurations
212 DataModels.Verify Flows Are Cleaned Up On All OpenStack Nodes