2 Documentation Test suite to verify packet flows between vm instances.
3 Suite Setup Devstack Suite Setup source_pwd=yes
4 Suite Teardown Close All Connections
5 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
6 Test Teardown Get Test Teardown Debugs
8 Library OperatingSystem
9 Library RequestsLibrary
11 Resource ../../../libraries/Utils.robot
12 Resource ../../../libraries/OpenStackOperations.robot
13 Resource ../../../libraries/DevstackUtils.robot
14 Resource ../../../libraries/OVSDB.robot
15 Resource ../../../libraries/ClusterOvsdb.robot
16 Resource ../../../libraries/ClusterManagement.robot
17 Resource ../../../libraries/SetupUtils.robot
18 Variables ../../../variables/Variables.py
21 @{NETWORKS_NAME} l2_net_1 l2_net_2
22 @{SUBNETS_NAME} l2_sub_net_1 l2_sub_net_2
23 @{NET_1_VM_INSTANCES} VmInstance1_l2_net_1 VmInstance2_net_1 VmInstance3_net_1
24 @{NET_2_VM_INSTANCES} VmInstance1_l2_net_2 VmInstance2_net_2 VmInstance3_net_2
25 @{VM_IPS_NOT_DELETED} 70.0.0.4
26 @{cluster_down_list} ${1} ${2}
27 @{SUBNETS_RANGE} 70.0.0.0/24 80.0.0.0/24
30 Create All Controller Sessions
31 [Documentation] Create sessions for all three contorllers.
32 ClusterManagement.ClusterManagement Setup
35 [Documentation] Create Network with neutron request.
36 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
37 \ OpenStackOperations.Create Network ${NetworkElement}
39 Create Subnets For l2_net_1
40 [Documentation] Create Sub Nets for the Networks with neutron request.
41 OpenStackOperations.Create SubNet l2_net_1 l2_sub_net_1 @{SUBNETS_RANGE}[0]
43 Create Subnets For l2_net_2
44 [Documentation] Create Sub Nets for the Networks with neutron request.
45 OpenStackOperations.Create SubNet l2_net_2 l2_sub_net_2 @{SUBNETS_RANGE}[1]
47 Create Bridge Manually and Verify Before Fail
48 [Documentation] Create bridge with OVS command and verify it gets applied from all instances.
49 ClusterOvsdb.Create Sample Bridge Manually And Verify ${OS_CONTROL_NODE_IP}
51 Add Tap Device Manually and Verify Before Fail
52 [Documentation] Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
53 ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify ${OS_CONTROL_NODE_IP}
55 Delete the Bridge Manually and Verify Before Fail
56 [Documentation] Delete bridge with OVS command and verify it gets deleted from all instances.
57 ClusterOvsdb.Delete Sample Bridge Manually And Verify ${OS_CONTROL_NODE_IP}
60 [Documentation] Kill the karaf in First Controller
61 ${new_cluster_list} = ClusterManagement.Kill Single Member 1
62 Set Suite Variable ${new_cluster_list}
64 Create Bridge Manually and Verify After Fail
65 [Documentation] Create bridge with OVS command and verify it gets applied from all instances.
66 ClusterOvsdb.Create Sample Bridge Manually And Verify ${OS_CONTROL_NODE_IP} ${new_cluster_list}
68 Add Tap Device Manually and Verify After Fail
69 [Documentation] Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
70 ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify ${OS_CONTROL_NODE_IP} ${new_cluster_list}
72 Delete the Bridge Manually and Verify After Fail
73 [Documentation] Delete bridge with OVS command and verify it gets deleted from all instances.
74 ClusterOvsdb.Delete Sample Bridge Manually And Verify ${OS_CONTROL_NODE_IP} ${new_cluster_list}
77 [Documentation] Bring up ODL1 again
78 ClusterManagement.Start Single Member 1
79 [Teardown] Get Test Teardown Debugs Allow Model Dump Failures
81 Create Bridge Manually and Verify After Recover
82 [Documentation] Create bridge with OVS command and verify it gets applied from all instances.
83 ClusterOvsdb.Create Sample Bridge Manually And Verify ${OS_CONTROL_NODE_IP}
85 Add Tap Device Manually and Verify After Recover
86 [Documentation] Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
87 ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify ${OS_CONTROL_NODE_IP}
89 Delete the Bridge Manually and Verify After Recover
90 [Documentation] Delete bridge with OVS command and verify it gets deleted from all instances.
91 ClusterOvsdb.Delete Sample Bridge Manually And Verify ${OS_CONTROL_NODE_IP}
94 [Documentation] Kill the karaf in Second Controller
95 ClusterManagement.Kill Single Member 2
97 Create Vm Instances For l2_net_2
98 [Documentation] Create Vm instances using flavor and image names for a network.
99 OpenStackOperations.Create Vm Instances l2_net_2 ${NET_2_VM_INSTANCES} sg=csit
101 Create Vm Instances For l2_net_1
102 [Documentation] Create Vm instances using flavor and image names for a network.
103 Log ${devstack_conn_id}
104 OpenStackOperations.Create Vm Instances l2_net_1 ${NET_1_VM_INSTANCES} sg=csit
106 Check Vm Instances Have Ip Address
107 [Documentation] Test case to verify that all created VMs are ready and have received their ip addresses.
108 ... We are polling first and longest on the last VM created assuming that if it's received it's address
109 ... already the other instances should have theirs already or at least shortly thereafter.
110 # first, ensure all VMs are in ACTIVE state. if not, we can just fail the test case and not waste time polling
112 : FOR ${vm} IN @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
113 \ Wait Until Keyword Succeeds 15s 5s Verify VM Is ACTIVE ${vm}
114 : FOR ${index} IN RANGE 1 5
115 \ ${NET1_VM_IPS} ${NET1_DHCP_IP} Verify VMs Received DHCP Lease @{NET_1_VM_INSTANCES}
116 \ ${NET2_VM_IPS} ${NET2_DHCP_IP} Verify VMs Received DHCP Lease @{NET_2_VM_INSTANCES}
117 \ ${VM_IPS}= Collections.Combine Lists ${NET1_VM_IPS} ${NET2_VM_IPS}
118 \ ${status} ${message} Run Keyword And Ignore Error List Should Not Contain Value ${VM_IPS} None
119 \ Exit For Loop If '${status}' == 'PASS'
121 : FOR ${vm} IN @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
122 \ Write Commands Until Prompt nova console-log ${vm} 30s
123 Append To List ${NET1_VM_IPS} ${NET1_DHCP_IP}
124 Set Suite Variable ${NET1_VM_IPS}
125 Append To List ${NET2_VM_IPS} ${NET2_DHCP_IP}
126 Set Suite Variable ${NET2_VM_IPS}
127 Should Not Contain ${NET1_VM_IPS} None
128 Should Not Contain ${NET2_VM_IPS} None
129 [Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
130 ... AND Get Test Teardown Debugs
133 [Documentation] Bring up ODL2 again
134 ClusterManagement.Start Single Member 2
135 [Teardown] Get Test Teardown Debugs Allow Model Dump Failures
137 Ping Vm Instance1 In l2_net_1
138 [Documentation] Check reachability of vm instances by pinging to them.
140 OpenStackOperations.Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[0]
142 Ping Vm Instance2 In l2_net_1
143 [Documentation] Check reachability of vm instances by pinging to them.
145 OpenStackOperations.Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[1]
147 Ping Vm Instance3 In l2_net_1
148 [Documentation] Check reachability of vm instances by pinging to them.
150 OpenStackOperations.Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[2]
152 Ping Vm Instance1 In l2_net_2
153 [Documentation] Check reachability of vm instances by pinging to them.
155 OpenStackOperations.Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[0]
157 Ping Vm Instance2 In l2_net_2
158 [Documentation] Check reachability of vm instances by pinging to them.
160 OpenStackOperations.Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[1]
162 Ping Vm Instance3 In l2_net_2
163 [Documentation] Check reachability of vm instances by pinging to them.
165 OpenStackOperations.Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[2]
168 [Documentation] Kill the karaf in Third Controller
169 ClusterManagement.Kill Single Member 3
171 Connectivity Tests From Vm Instance1 In l2_net_1
172 [Documentation] Logging to the vm instance using generated key pair.
173 OpenStackOperations.Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[0] ${NET_1_VM_IPS}
175 Connectivity Tests From Vm Instance2 In l2_net_1
176 [Documentation] Logging to the vm instance using generated key pair.
177 OpenStackOperations.Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[1] ${NET_1_VM_IPS}
179 Connectivity Tests From Vm Instance3 In l2_net_1
180 [Documentation] Logging to the vm instance using generated key pair.
181 OpenStackOperations.Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[2] ${NET_1_VM_IPS}
184 [Documentation] Bring up ODL3 again
185 ClusterManagement.Start Single Member 3
186 [Teardown] Get Test Teardown Debugs Allow Model Dump Failures
188 Take Down ODL1 and ODL2
189 [Documentation] Kill the karaf in First and Second Controller
190 ClusterManagement.Kill Members From List Or All ${cluster_down_list}
192 Connectivity Tests From Vm Instance1 In l2_net_2
193 [Documentation] Logging to the vm instance using generated key pair.
194 OpenStackOperations.Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[0] ${NET_2_VM_IPS}
196 Connectivity Tests From Vm Instance2 In l2_net_2
197 [Documentation] Logging to the vm instance using generated key pair.
198 OpenStackOperations.Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[1] ${NET_2_VM_IPS}
200 Connectivity Tests From Vm Instance3 In l2_net_2
201 [Documentation] Logging to the vm instance using generated key pair.
202 OpenStackOperations.Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[2] ${NET_2_VM_IPS}
204 Bring Up ODL1 and ODL2
205 [Documentation] Bring up ODL1 and ODL2 again.
206 ClusterManagement.Start Members From List Or All ${cluster_down_list}
207 [Teardown] Get Test Teardown Debugs Allow Model Dump Failures
210 [Documentation] Delete Vm instances using instance names.
211 OpenStackOperations.Delete Vm Instance VmInstance1_l2_net_1
213 No Ping For Deleted Vm
214 [Documentation] Check non reachability of deleted vm instances by pinging to them.
215 ${output}= OpenStackOperations.Ping From DHCP Should Not Succeed l2_network_1 @{NET_1_VM_IPS}[0]
217 Delete Vm Instances In network_1
218 [Documentation] Delete Vm instances using instance names in network_1.
219 : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
220 \ OpenStackOperations.Delete Vm Instance ${VmElement}
222 Delete Vm Instances In network_2
223 [Documentation] Delete Vm instances using instance names in network_2.
224 : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
225 \ OpenStackOperations.Delete Vm Instance ${VmElement}
227 Delete Sub Networks In network_1
228 [Documentation] Delete Sub Nets for the Networks with neutron request.
229 OpenStackOperations.Delete SubNet l2_sub_net_1
231 Delete Sub Networks In network_2
232 [Documentation] Delete Sub Nets for the Networks with neutron request.
233 OpenStackOperations.Delete SubNet l2_sub_net_2
236 [Documentation] Delete Networks with neutron request.
237 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
238 \ OpenStackOperations.Delete Network ${NetworkElement}