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