2 Documentation Test suite to verify packet flows between vm instances.
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 ../../../libraries/KarafKeywords.robot
16 Resource ../../../variables/netvirt/Variables.robot
19 ${SECURITY_GROUP} l2_sg
20 @{NETWORKS} l2_net_1 l2_net_2
21 @{SUBNETS} l2_sub_1 l2_sub_2
22 @{NET_1_VMS} l2_net_1_vm_1 l2_net_1_vm_2 l2_net_1_vm_3
23 @{NET_2_VMS} l2_net_2_vm_1 l2_net_2_vm_2 l2_net_2_vm_3
24 @{SUBNET_CIDRS} 21.0.0.0/24 22.0.0.0/24
28 Create VLAN Network net_1
29 [Documentation] Create Network with neutron request.
30 # in the case that the controller under test is using legacy netvirt features, vlan segmentation is not supported,
31 # and we cannot create a vlan network. If those features are installed we will instead stick with vxlan.
32 ${feature_check_status} = OpenStackOperations.Is Feature Installed ${legacy_feature_list}
33 BuiltIn.Run Keyword If '${feature_check_status}' == 'True' OpenStackOperations.Create Network @{NETWORKS}[0]
34 ... ELSE OpenStackOperations.Create Network @{NETWORKS}[0] --provider-network-type vlan --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} --provider-segment ${NET_1_VLAN_ID}
36 Create Subnet For net_1
37 [Documentation] Create Sub Nets for the Networks with neutron request.
38 OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] @{SUBNET_CIDRS}[0]
40 Create VXLAN Network net_2
41 [Documentation] Create Network with neutron request.
42 OpenStackOperations.Create Network @{NETWORKS}[1]
44 Create Subnet For net_2
45 [Documentation] Create Sub Nets for the Networks with neutron request.
46 OpenStackOperations.Create SubNet @{NETWORKS}[1] @{SUBNETS}[1] @{SUBNET_CIDRS}[1]
48 Add Ssh Allow All Rule
49 [Documentation] Allow all TCP/UDP/ICMP packets for this suite
50 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
52 Create Vm Instances For net_1
53 [Documentation] Create Vm instances using flavor and image names for a network.
54 OpenStackOperations.Create Vm Instances @{NETWORKS}[0] ${NET_1_VMS} sg=${SECURITY_GROUP}
56 Create Vm Instances For net_2
57 [Documentation] Create Vm instances using flavor and image names for a network.
58 OpenStackOperations.Create Vm Instances @{NETWORKS}[1] ${NET_2_VMS} sg=${SECURITY_GROUP}
60 Check Vm Instances Have Ip Address
61 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
62 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
63 BuiltIn.Set Suite Variable @{NET_1_VM_IPS}
64 BuiltIn.Set Suite Variable @{NET_2_VM_IPS}
65 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
66 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
67 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
68 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
69 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS}
70 ... AND OpenStackOperations.Get Test Teardown Debugs
72 Ping Vm Instance1 In net_1
73 [Documentation] Check reachability of vm instances by pinging to them.
74 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_1_VM_IPS}[0]
76 Ping Vm Instance2 In net_1
77 [Documentation] Check reachability of vm instances by pinging to them.
78 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_1_VM_IPS}[1]
80 Ping Vm Instance3 In net_1
81 [Documentation] Check reachability of vm instances by pinging to them.
82 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[0] @{NET_1_VM_IPS}[2]
84 Ping Vm Instance1 In net_2
85 [Documentation] Check reachability of vm instances by pinging to them.
86 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_2_VM_IPS}[0]
88 Ping Vm Instance2 In net_2
89 [Documentation] Check reachability of vm instances by pinging to them.
90 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_2_VM_IPS}[1]
92 Ping Vm Instance3 In net_2
93 [Documentation] Check reachability of vm instances by pinging to them.
94 OpenStackOperations.Ping Vm From DHCP Namespace @{NETWORKS}[1] @{NET_2_VM_IPS}[2]
96 Connectivity Tests From Vm Instance1 In net_1
97 [Documentation] Login to the vm instance and test some operations
98 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ${NET_1_VM_IPS}
100 Connectivity Tests From Vm Instance2 In net_1
101 [Documentation] Login to the vm instance and test operations
102 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ${NET_1_VM_IPS}
104 Connectivity Tests From Vm Instance3 In net_1
105 [Documentation] Login to the vm instance and test operations
106 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[2] ${NET_1_VM_IPS}
108 Connectivity Tests From Vm Instance1 In net_2
109 [Documentation] Login to the vm instance and test operations
110 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ${NET_2_VM_IPS}
112 Connectivity Tests From Vm Instance2 In net_2
113 [Documentation] Logging to the vm instance using generated key pair.
114 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[1] ${NET_2_VM_IPS}
116 Connectivity Tests From Vm Instance3 In net_2
117 [Documentation] Login to the vm instance using generated key pair.
118 OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[2] ${NET_2_VM_IPS}
121 [Documentation] Delete Vm instances using instance names.
122 OpenStackOperations.Delete Vm Instance @{NET_1_VMS}[0]
124 No Ping For Deleted Vm
125 [Documentation] Check non reachability of deleted vm instances by pinging to them.
126 OpenStackOperations.Ping From DHCP Should Not Succeed @{NETWORKS}[0] @{NET_1_VM_IPS}[0]
128 Delete Vm Instances In net_1
129 [Documentation] Delete Vm instances using instance names in net_1.
130 : FOR ${vm} IN @{NET_1_VMS}
131 \ OpenStackOperations.Delete Vm Instance ${vm}
133 Delete Vm Instances In net_2
134 [Documentation] Delete Vm instances using instance names in net_2.
135 : FOR ${vm} IN @{NET_2_VMS}
136 \ OpenStackOperations.Delete Vm Instance ${vm}
138 Delete Sub Network In net_1
139 [Documentation] Delete Sub Net for the Networks with neutron request.
140 OpenStackOperations.Delete SubNet @{SUBNETS}[0]
142 Delete Sub Network In net_2
143 [Documentation] Delete Sub Net for the Networks with neutron request.
144 OpenStackOperations.Delete SubNet @{SUBNETS}[1]
147 [Documentation] Delete Networks with neutron request.
148 : FOR ${networks} IN @{NETWORKS}
149 \ OpenStackOperations.Delete Network ${networks}
151 Delete Security Group
152 [Documentation] Delete security group with neutron request
153 OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
156 [Documentation] Verify that flows have been cleaned up properly after removing all neutron configurations
157 ${feature_check_status}= Run Keyword And Return Status Verify Feature Is Installed odl-vtn-manager-neutron
158 BuiltIn.Run Keyword If '${feature_check_status}' != 'True' DataModels.Verify Flows Are Cleaned Up On All OpenStack Nodes