2 Documentation Test suite to verify packet flows between vm instances.
3 Suite Setup Devstack Suite Setup Tests source_pwd=yes
4 Suite Teardown Close All Connections
6 Library OperatingSystem
7 Library RequestsLibrary
9 Resource ../../../libraries/Utils.robot
10 Resource ../../../libraries/OpenStackOperations.robot
11 Resource ../../../libraries/DevstackUtils.robot
12 Resource ../../../libraries/OVSDB.robot
13 Resource ../../../libraries/ClusterOvsdb.robot
14 Library ../../../libraries/Common.py
15 Variables ../../../variables/Variables.py
16 Resource ../../../libraries/ClusterKeywords.robot
19 @{NETWORKS_NAME} l2_net_1 l2_net_2
20 @{SUBNETS_NAME} l2_sub_net_1 l2_sub_net_2
21 @{NET_1_VM_INSTANCES} VmInstance1_l2_net_1 VmInstance2_net_1 VmInstance3_net_1
22 @{NET_2_VM_INSTANCES} VmInstance1_l2_net_2 VmInstance2_net_2 VmInstance3_net_2
23 @{NET_1_VM_IPS} 70.0.0.3 70.0.0.4 70.0.0.5
24 @{NET_2_VM_IPS} 80.0.0.3 80.0.0.4 80.0.0.5
25 @{VM_IPS_NOT_DELETED} 70.0.0.4
26 @{GATEWAY_IPS} 70.0.0.1 80.0.0.1
27 @{DHCP_IPS} 70.0.0.2 80.0.0.2
28 @{cluster_down_list} 1 2
29 @{SUBNETS_RANGE} 70.0.0.0/24 80.0.0.0/24
32 Create All Controller Sessions
33 [Documentation] Create sessions for all three contorllers.
34 ClusterKeywords.Create Controller Sessions
37 [Documentation] Create original cluster list.
38 ${original_cluster_list} ClusterKeywords.Create Controller Index List
39 Set Suite Variable ${original_cluster_list}
40 Log ${original_cluster_list}
42 Check OVS Manager Connection Status
43 [Documentation] This will verify if the OVS manager is connected
44 ${output}= Wait Until Keyword Succeeds 5s 1s Verify OVS Reports Connected ${OS_CONTROL_NODE_IP}
46 Set Suite Variable ${status} is_connected: true
47 ${dictionary}= Create Dictionary ${status}=9
48 Utils.Check Item Occurrence ${output} ${dictionary}
51 [Documentation] Create Network with neutron request.
52 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
53 \ Create Network ${NetworkElement}
55 Create Subnets For l2_net_1
56 [Documentation] Create Sub Nets for the Networks with neutron request.
57 Create SubNet l2_net_1 l2_sub_net_1 @{SUBNETS_RANGE}[0]
59 Create Subnets For l2_net_2
60 [Documentation] Create Sub Nets for the Networks with neutron request.
61 Create SubNet l2_net_2 l2_sub_net_2 @{SUBNETS_RANGE}[1]
63 Create Bridge Manually and Verify Before Fail
64 [Documentation] Create bridge with OVS command and verify it gets applied from all instances.
65 ClusterOvsdb.Create Sample Bridge Manually And Verify ${original_cluster_list} ${OS_CONTROL_NODE_IP}
67 Add Tap Device Manually and Verify Before Fail
68 [Documentation] Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
69 ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify ${original_cluster_list} ${OS_CONTROL_NODE_IP}
71 Delete the Bridge Manually and Verify Before Fail
72 [Documentation] Delete bridge with OVS command and verify it gets deleted from all instances.
73 ClusterOvsdb.Delete Sample Bridge Manually And Verify ${original_cluster_list} ${OS_CONTROL_NODE_IP}
76 [Documentation] Kill the karaf in First Controller
77 ClusterKeywords.Kill Multiple Controllers 1
78 ${new_cluster_list} ClusterKeywords.Create Controller Index List
79 Remove From List ${new_cluster_list} 0
80 Set Suite Variable ${new_cluster_list}
82 Create Bridge Manually and Verify After Fail
83 [Documentation] Create bridge with OVS command and verify it gets applied from all instances.
84 ClusterOvsdb.Create Sample Bridge Manually And Verify ${new_cluster_list} ${OS_CONTROL_NODE_IP}
86 Add Tap Device Manually and Verify After Fail
87 [Documentation] Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
88 ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify ${new_cluster_list} ${OS_CONTROL_NODE_IP}
90 Delete the Bridge Manually and Verify After Fail
91 [Documentation] Delete bridge with OVS command and verify it gets deleted from all instances.
92 ClusterOvsdb.Delete Sample Bridge Manually And Verify ${new_cluster_list} ${OS_CONTROL_NODE_IP}
94 Create Vm Instances For l2_net_1
95 [Documentation] Create Vm instances using flavor and image names for a network.
96 Log ${devstack_conn_id}
97 Create Vm Instances l2_net_1 ${NET_1_VM_INSTANCES}
98 [Teardown] Show Debugs ${NET_1_VM_INSTANCES}
101 [Documentation] Bring up ODL1 again
102 ClusterKeywords.Start Multiple Controllers 300s 1
103 ${new_cluster_list} ClusterKeywords.Create Controller Index List
104 Set Suite Variable ${new_cluster_list}
106 Create Bridge Manually and Verify After Recover
107 [Documentation] Create bridge with OVS command and verify it gets applied from all instances.
108 ClusterOvsdb.Create Sample Bridge Manually And Verify ${original_cluster_list} ${OS_CONTROL_NODE_IP}
110 Add Tap Device Manually and Verify After Recover
111 [Documentation] Add tap devices to the bridge with OVS command and verify it gets applied from all instances.
112 ClusterOvsdb.Add Sample Tap Device To The Manual Bridge And Verify ${original_cluster_list} ${OS_CONTROL_NODE_IP}
114 Delete the Bridge Manually and Verify After Recover
115 [Documentation] Delete bridge with OVS command and verify it gets deleted from all instances.
116 ClusterOvsdb.Delete Sample Bridge Manually And Verify ${original_cluster_list} ${OS_CONTROL_NODE_IP}
119 [Documentation] Kill the karaf in Second Controller
120 ClusterKeywords.Kill Multiple Controllers 2
121 ${new_cluster_list} ClusterKeywords.Create Controller Index List
122 Remove From List ${new_cluster_list} 1
123 Set Suite Variable ${new_cluster_list}
125 Create Vm Instances For l2_net_2
126 [Documentation] Create Vm instances using flavor and image names for a network.
127 Create Vm Instances l2_net_2 ${NET_2_VM_INSTANCES}
128 [Teardown] Show Debugs ${NET_2_VM_INSTANCES}
131 [Documentation] Bring up ODL2 again
132 ClusterKeywords.Start Multiple Controllers 300s 2
133 ${new_cluster_list} ClusterKeywords.Create Controller Index List
134 Set Suite Variable ${new_cluster_list}
136 Ping Vm Instance1 In l2_net_1
137 [Documentation] Check reachability of vm instances by pinging to them.
138 Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[0]
140 Ping Vm Instance2 In l2_net_1
141 [Documentation] Check reachability of vm instances by pinging to them.
142 Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[1]
144 Ping Vm Instance3 In l2_net_1
145 [Documentation] Check reachability of vm instances by pinging to them.
146 Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[2]
148 Ping Vm Instance1 In l2_net_2
149 [Documentation] Check reachability of vm instances by pinging to them.
150 Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[0]
152 Ping Vm Instance2 In l2_net_2
153 [Documentation] Check reachability of vm instances by pinging to them.
154 Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[1]
156 Ping Vm Instance3 In l2_net_2
157 [Documentation] Check reachability of vm instances by pinging to them.
158 Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[2]
161 [Documentation] Kill the karaf in Third Controller
162 ClusterKeywords.Kill Multiple Controllers 3
163 ${new_cluster_list} ClusterKeywords.Create Controller Index List
164 Remove From List ${new_cluster_list} 2
165 Set Suite Variable ${new_cluster_list}
167 Connectivity Tests From Vm Instance1 In l2_net_1
168 [Documentation] Logging to the vm instance using generated key pair.
169 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[1] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
171 Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[0] ${dst_ip_list}
173 Connectivity Tests From Vm Instance2 In l2_net_1
174 [Documentation] Logging to the vm instance using generated key pair.
175 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
177 Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[1] ${dst_ip_list}
179 Connectivity Tests From Vm Instance3 In l2_net_1
180 [Documentation] Logging to the vm instance using generated key pair.
181 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1]
183 Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[2] ${dst_ip_list}
186 [Documentation] Bring up ODL3 again
187 ClusterKeywords.Start Multiple Controllers 300s 3
188 ${new_cluster_list} ClusterKeywords.Create Controller Index List
189 Set Suite Variable ${new_cluster_list}
191 Take Down ODL1 and ODL2
192 [Documentation] Kill the karaf in First and Second Controller
193 : FOR ${index} IN @{cluster_down_list}
194 \ ClusterKeywords.Kill Multiple Controllers ${index}
196 Connectivity Tests From Vm Instance1 In l2_net_2
197 [Documentation] Logging to the vm instance using generated key pair.
198 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[1] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
200 Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[0] ${dst_ip_list}
202 Connectivity Tests From Vm Instance2 In l2_net_2
203 [Documentation] Logging to the vm instance using generated key pair.
204 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
206 Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[1] ${dst_ip_list}
208 Connectivity Tests From Vm Instance3 In l2_net_2
209 [Documentation] Logging to the vm instance using generated key pair.
210 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[1]
212 Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[2] ${dst_ip_list}
214 Bring Up ODL1 and ODL2
215 [Documentation] Bring up ODL1 and ODL2 again.
216 : FOR ${index} IN @{cluster_down_list}
217 \ ClusterKeywords.Start Multiple Controllers 300s ${index}
220 [Documentation] Delete Vm instances using instance names.
221 Delete Vm Instance VmInstance1_l2_net_1
223 No Ping For Deleted Vm
224 [Documentation] Check non reachability of deleted vm instances by pinging to them.
225 ${output}= Ping From DHCP Should Not Succeed l2_network_1 @{NET_1_VM_IPS}[0]
227 Delete Vm Instances In network_1
228 [Documentation] Delete Vm instances using instance names in network_1.
229 : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
230 \ Delete Vm Instance ${VmElement}
232 Delete Vm Instances In network_2
233 [Documentation] Delete Vm instances using instance names in network_2.
234 : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
235 \ Delete Vm Instance ${VmElement}
237 Delete Sub Networks In network_1
238 [Documentation] Delete Sub Nets for the Networks with neutron request.
239 Delete SubNet l2_sub_net_1
241 Delete Sub Networks In network_2
242 [Documentation] Delete Sub Nets for the Networks with neutron request.
243 Delete SubNet l2_sub_net_2
246 [Documentation] Delete Networks with neutron request.
247 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
248 \ Delete Network ${NetworkElement}