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 Library ../../../libraries/Common.py
14 Variables ../../../variables/Variables.py
15 Resource ../../../libraries/ClusterKeywords.robot
18 @{NETWORKS_NAME} l2_net_1 l2_net_2
19 @{SUBNETS_NAME} l2_sub_net_1 l2_sub_net_2
20 @{NET_1_VM_INSTANCES} VmInstance1_l2_net_1 VmInstance2_net_1 VmInstance3_net_1
21 @{NET_2_VM_INSTANCES} VmInstance1_l2_net_2 VmInstance2_net_2 VmInstance3_net_2
22 @{NET_1_VM_IPS} 70.0.0.3 70.0.0.4 70.0.0.5
23 @{NET_2_VM_IPS} 80.0.0.3 80.0.0.4 80.0.0.5
24 @{VM_IPS_NOT_DELETED} 70.0.0.4
25 @{GATEWAY_IPS} 70.0.0.1 80.0.0.1
26 @{DHCP_IPS} 70.0.0.2 80.0.0.2
27 @{cluster_down_list} 1 2
28 @{SUBNETS_RANGE} 70.0.0.0/24 80.0.0.0/24
32 [Documentation] Create original cluster list.
33 ${original_cluster_list} ClusterKeywords.Create Controller Index List
34 Set Suite Variable ${original_cluster_list}
35 Log ${original_cluster_list}
37 Check OVS Manager Connection Status
38 [Documentation] This will verify if the OVS manager is connected
39 ${output}= Wait Until Keyword Succeeds 5s 1s Verify OVS Reports Connected ${OS_CONTROL_NODE_IP}
41 Set Suite Variable ${status} is_connected: true
42 ${dictionary}= Create Dictionary ${status}=9
43 Utils.Check Item Occurrence ${output} ${dictionary}
46 [Documentation] Create Network with neutron request.
47 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
48 \ Create Network ${NetworkElement}
50 Create Subnets For l2_net_1
51 [Documentation] Create Sub Nets for the Networks with neutron request.
52 Create SubNet l2_net_1 l2_sub_net_1 @{SUBNETS_RANGE}[0]
54 Create Subnets For l2_net_2
55 [Documentation] Create Sub Nets for the Networks with neutron request.
56 Create SubNet l2_net_2 l2_sub_net_2 @{SUBNETS_RANGE}[1]
59 [Documentation] Kill the karaf in First Controller
60 ClusterKeywords.Kill Multiple Controllers 1
61 ${new_cluster_list} ClusterKeywords.Create Controller Index List
62 Remove Values From List ${new_cluster_list} 1
63 Set Suite Variable ${new_cluster_list}
65 Create Vm Instances For l2_net_1
66 [Documentation] Create Vm instances using flavor and image names for a network.
67 Log ${devstack_conn_id}
68 Create Vm Instances l2_net_1 ${NET_1_VM_INSTANCES}
69 [Teardown] Show Debugs ${NET_1_VM_INSTANCES}
72 [Documentation] Bring up ODL1 again
73 ClusterKeywords.Start Multiple Controllers 300s 1
74 ${new_cluster_list} ClusterKeywords.Create Controller Index List
75 Set Suite Variable ${new_cluster_list}
78 [Documentation] Kill the karaf in Second Controller
79 ClusterKeywords.Kill Multiple Controllers 2
80 ${new_cluster_list} ClusterKeywords.Create Controller Index List
81 Remove Values From List ${new_cluster_list} 2
82 Set Suite Variable ${new_cluster_list}
84 Create Vm Instances For l2_net_2
85 [Documentation] Create Vm instances using flavor and image names for a network.
86 Create Vm Instances l2_net_2 ${NET_2_VM_INSTANCES}
87 [Teardown] Show Debugs ${NET_2_VM_INSTANCES}
90 [Documentation] Bring up ODL2 again
91 ClusterKeywords.Start Multiple Controllers 300s 2
92 ${new_cluster_list} ClusterKeywords.Create Controller Index List
93 Set Suite Variable ${new_cluster_list}
95 Ping Vm Instance1 In l2_net_1
96 [Documentation] Check reachability of vm instances by pinging to them.
97 Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[0]
99 Ping Vm Instance2 In l2_net_1
100 [Documentation] Check reachability of vm instances by pinging to them.
101 Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[1]
103 Ping Vm Instance3 In l2_net_1
104 [Documentation] Check reachability of vm instances by pinging to them.
105 Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[2]
107 Ping Vm Instance1 In l2_net_2
108 [Documentation] Check reachability of vm instances by pinging to them.
109 Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[0]
111 Ping Vm Instance2 In l2_net_2
112 [Documentation] Check reachability of vm instances by pinging to them.
113 Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[1]
115 Ping Vm Instance3 In l2_net_2
116 [Documentation] Check reachability of vm instances by pinging to them.
117 Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[2]
120 [Documentation] Kill the karaf in Third Controller
121 ClusterKeywords.Kill Multiple Controllers 3
122 ${new_cluster_list} ClusterKeywords.Create Controller Index List
123 Remove Values From List ${new_cluster_list} 3
124 Set Suite Variable ${new_cluster_list}
126 Connectivity Tests From Vm Instance1 In l2_net_1
127 [Documentation] Logging to the vm instance using generated key pair.
128 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[1] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
130 Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[0] ${dst_ip_list}
132 Connectivity Tests From Vm Instance2 In l2_net_1
133 [Documentation] Logging to the vm instance using generated key pair.
134 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
136 Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[1] ${dst_ip_list}
138 Connectivity Tests From Vm Instance3 In l2_net_1
139 [Documentation] Logging to the vm instance using generated key pair.
140 ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1]
142 Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[2] ${dst_ip_list}
145 [Documentation] Bring up ODL3 again
146 ClusterKeywords.Start Multiple Controllers 300s 3
147 ${new_cluster_list} ClusterKeywords.Create Controller Index List
148 Set Suite Variable ${new_cluster_list}
150 Take Down ODL1 and ODL2
151 [Documentation] Kill the karaf in First and Second Controller
152 : FOR ${index} IN @{cluster_down_list}
153 \ ClusterKeywords.Kill Multiple Controllers ${index}
155 Connectivity Tests From Vm Instance1 In l2_net_2
156 [Documentation] Logging to the vm instance using generated key pair.
157 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[1] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
159 Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[0] ${dst_ip_list}
161 Connectivity Tests From Vm Instance2 In l2_net_2
162 [Documentation] Logging to the vm instance using generated key pair.
163 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
165 Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[1] ${dst_ip_list}
167 Connectivity Tests From Vm Instance3 In l2_net_2
168 [Documentation] Logging to the vm instance using generated key pair.
169 ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[1]
171 Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[2] ${dst_ip_list}
173 Bring Up ODL1 and ODL2
174 [Documentation] Bring up ODL1 and ODL2 again.
175 : FOR ${index} IN @{cluster_down_list}
176 \ ClusterKeywords.Start Multiple Controllers 300s ${index}
179 [Documentation] Delete Vm instances using instance names.
180 Delete Vm Instance VmInstance1_l2_net_1
182 Ping All Vm Instances
183 [Documentation] Check reachability of vm instances by pinging to them.
184 ${net_id}= Get Net Id l2_net_1
185 : FOR ${VmIpElement} IN @{VM_IPS_NOT_DELETED}
186 \ ${output}= Ping Vm From DHCP Namespace ${net_id} ${VmIpElement}
187 \ Should Contain ${output} 64 bytes
189 No Ping For Deleted Vm
190 [Documentation] Check non reachability of deleted vm instances by pinging to them.
191 ${output}= Ping Vm From DHCP Namespace ${net_id} @{NET_1_VM_IPS}[0]
192 Should Contain ${output} Destination Host Unreachable
194 Delete Vm Instances In network_1
195 [Documentation] Delete Vm instances using instance names in network_1.
196 : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
197 \ Delete Vm Instance ${VmElement}
199 Delete Vm Instances In network_2
200 [Documentation] Delete Vm instances using instance names in network_2.
201 : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
202 \ Delete Vm Instance ${VmElement}
204 Delete Sub Networks In network_1
205 [Documentation] Delete Sub Nets for the Networks with neutron request.
206 Delete SubNet l2_sub_net_1
208 Delete Sub Networks In network_2
209 [Documentation] Delete Sub Nets for the Networks with neutron request.
210 Delete SubNet l2_sub_net_2
213 [Documentation] Delete Networks with neutron request.
214 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
215 \ Delete Network ${NetworkElement}