2 Documentation Test Suite for verification of HWVTEP usecases
3 Suite Setup Basic Suite Setup
4 Suite Teardown Basic Suite Teardown
5 Test Teardown Get L2gw Debug Info
6 Resource ../../libraries/L2GatewayOperations.robot
7 Resource ../../libraries/CompareStream.robot
10 TC01 Configure Hwvtep Manager OVS Manager Controller And Verify
11 [Documentation] Configure ODL at ${ODL_IP} as manager for HWVTEP
12 L2GatewayOperations.Add Vtep Manager And Verify ${ODL_IP}
14 TC02 Create First Set Of Network Subnet And Ports
15 [Documentation] Create Networks and Ports
16 OpenStackOperations.Create Network ${NET_1} ${NET_ADDT_ARG} ${NET_1_SEGID}
17 ${output}= OpenStackOperations.List Networks
18 Should Contain ${output} ${NET_1}
19 OpenStackOperations.Create SubNet ${NET_1} ${SUBNET_1} ${SUBNET_RANGE1} ${SUBNET_ADDT_ARG}
20 ${output}= OpenStackOperations.List Subnets
21 Should Contain ${output} ${SUBNET_1}
22 OpenStackOperations.Create And Configure Security Group ${SECURITY_GROUP_L2GW}
23 OpenStackOperations.Create Port ${NET_1} ${OVS_PORT_1} sg=${SECURITY_GROUP_L2GW}
24 OpenStackOperations.Create Neutron Port With Additional Params ${NET_1} ${HWVTEP_PORT_1} ${SECURITY_GROUP_L2GW_NONE}
25 ${port_mac}= Get Port Mac ${OVS_PORT_1} #port_mac[0]
26 ${port_ip}= Get Port Ip ${OVS_PORT_1} #port_ip[0]
27 Append To List ${port_mac_list} ${port_mac}
28 Append To List ${port_ip_list} ${port_ip}
29 ${port_mac}= Get Port Mac ${HWVTEP_PORT_1} #port_mac[1]
30 ${port_ip}= Get Port Ip ${HWVTEP_PORT_1} #port_ip[1]
31 Append To List ${port_mac_list} ${port_mac}
32 Append To List ${port_ip_list} ${port_ip}
34 TC03 Update Port For Hwvtep And Attach Port To Namespace
35 [Documentation] Update the Neutron Ports for required to connect to HWVTEP and attach that port to tap port in namespace
36 L2GatewayOperations.Update Port For Hwvtep ${HWVTEP_PORT_1}
37 Wait Until Keyword Succeeds 30s 2s L2GatewayOperations.Attach Port To Hwvtep Namespace ${port_mac_list[1]} ${HWVTEP_NS1} ${NS_TAP1}
39 TC04 Create Vms On Compute Node
40 [Documentation] Create VM on compute node and verify that VM got IP address
41 # FIXME! Don't need this in queens, but do in earlier releases
42 OpenStackOperations.Create Nano Flavor
43 OpenStackOperations.Create Vm Instance With Port On Compute Node ${OVS_PORT_1} ${OVS_VM1_NAME} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP_L2GW}
44 ${vm_ip}= Wait Until Keyword Succeeds 60s 2s L2GatewayOperations.Verify Nova VM IP ${OVS_VM1_NAME}
46 Should Contain ${vm_ip} ${port_ip_list[0]}
48 TC05 Create L2Gateway And Connection And Verify
49 [Documentation] Create L2GW and Connection using Neutron CLI. Verify info in hardware_vtep db in HWVTEP emulator.
50 ${output}= L2GatewayOperations.Create Verify L2Gateway ${HWVTEP_BRIDGE} ${NS_PORT1} ${L2GW_NAME1}
52 ${output}= Wait Until Keyword Succeeds 30s 2s L2GatewayOperations.Create Verify L2Gateway Connection ${L2GW_NAME1} ${NET_1}
54 Wait Until Keyword Succeeds 30s 2s L2GatewayOperations.Verify Ovs Tunnel ${HWVTEP_IP} ${OVS_IP}
55 ${output}= ITM Get Tunnels
57 Should Contain ${output} physicalswitch/${HWVTEP_BRIDGE}
58 Wait Until Keyword Succeeds 30s 1s L2GatewayOperations.Verify Vtep List ${hwvtep_conn_id} ${TUNNEL_TABLE} enable="true"
59 ${phy_port_out}= Get Vtep List ${PHYSICAL_PORT_TABLE}
60 Validate Regexp In String ${phy_port_out} ${VLAN_BINDING_REGEX} 1
61 ${list}= Create List ${OVS_IP} ${HWVTEP_IP}
62 Wait Until Keyword Succeeds 30s 1s L2GatewayOperations.Verify Vtep List ${hwvtep_conn_id} ${PHYSICAL_LOCATOR_TABLE} @{list}
63 Wait Until Keyword Succeeds 30s 1s L2GatewayOperations.Verify Vtep List ${hwvtep_conn_id} ${UCAST_MACS_REMOTE_TABLE} ${port_mac_list[0]}
65 TC06 Dhcp Ip Allocation For Hwvtep Tap Port
66 [Documentation] Verify that HWVTEP port gets an IP address
67 Wait Until Keyword Succeeds 180s 10s L2GatewayOperations.Namespace Dhclient Verify ${HWVTEP_NS1} ${NS_TAP1} ${port_ip_list[1]}
69 TC07 Verify Ping From Compute Node Vm To Hwvtep
70 [Documentation] Verify that VM on Compute Node can ping HWVTEP port
71 ${output}= Wait Until Keyword Succeeds 60s 10s Execute Command on VM Instance ${NET_1} ${port_ip_list[0]}
72 ... ping -c 3 ${port_ip_list[1]}
74 Should Not Contain ${output} ${PACKET_LOSS}
75 ${src_mac_list}= Create List ${port_mac_list[0]}
76 ${dst_mac_list}= Create List ${port_mac_list[1]}
77 Wait Until Keyword Succeeds 30s 5s L2GatewayOperations.Verify Elan Flow Entries ${OVS_IP} ${src_mac_list} ${dst_mac_list}
79 TC08 Ping Verification From Namespace Tap To Ovs Vm
80 [Documentation] Verify that HWVTEP port can ping VM on compute node
81 Wait Until Keyword Succeeds 30s 5s L2GatewayOperations.Verify Ping In Namespace Extra Timeout ${HWVTEP_NS1} ${port_mac_list[1]} ${port_ip_list[0]}
83 TC09 Additional Network Subnet Port Creation
84 [Documentation] Create 2nd network and ports
85 OpenStackOperations.Create Network ${NET_2} ${NET_ADDT_ARG} ${NET_2_SEGID}
86 ${output}= OpenStackOperations.List Networks
87 Should Contain ${output} ${NET_2}
88 OpenStackOperations.Create SubNet ${NET_2} ${SUBNET_2} ${SUBNET_RANGE2} ${SUBNET_ADDT_ARG}
89 ${output}= OpenStackOperations.List Subnets
90 Should Contain ${output} ${SUBNET_2}
91 OpenStackOperations.Create Port ${NET_2} ${OVS_PORT_2} sg=${SECURITY_GROUP_L2GW}
92 OpenStackOperations.Create Neutron Port With Additional Params ${NET_2} ${HWVTEP_PORT_2} ${SECURITY_GROUP_L2GW_NONE}
93 ${port_mac}= Get Port Mac ${OVS_PORT_2} #port_mac[2]
94 ${port_ip}= Get Port Ip ${OVS_PORT_2} #port_ip[2]
95 Append To List ${port_mac_list} ${port_mac}
96 Append To List ${port_ip_list} ${port_ip}
97 ${port_mac}= Get Port Mac ${HWVTEP_PORT_2} #port_mac[3]
98 ${port_ip}= Get Port Ip ${HWVTEP_PORT_2} #port_ip[3]
99 Append To List ${port_mac_list} ${port_mac}
100 Append To List ${port_ip_list} ${port_ip}
102 TC10 Update And Attach Second Port To Hwvtep Create L2gw Connection
103 [Documentation] Update ports in Neutron so they can be connected to HWVTEP, create 2nd L2GW and Connection, and Verify
104 L2GatewayOperations.Update Port For Hwvtep ${HWVTEP_PORT_2}
105 Wait Until Keyword Succeeds 30s 2s L2GatewayOperations.Attach Port To Hwvtep Namespace ${port_mac_list[3]} ${HWVTEP_NS2} ${NS2_TAP1}
106 OpenStackOperations.Create Vm Instance With Port On Compute Node ${OVS_PORT_2} ${OVS_VM2_NAME} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP_L2GW}
107 ${vm_ip}= Wait Until Keyword Succeeds 60s 2s L2GatewayOperations.Verify Nova VM IP ${OVS_VM2_NAME}
109 Should Contain ${vm_ip} ${port_ip_list[2]}
110 ${output}= L2GatewayOperations.Create Verify L2Gateway ${HWVTEP_BRIDGE} ${NS_PORT2} ${L2GW_NAME2}
112 ${output}= L2GatewayOperations.Create Verify L2Gateway Connection ${L2GW_NAME2} ${NET_2}
114 ${phy_port_out}= Get Vtep List ${PHYSICAL_PORT_TABLE}
115 Validate Regexp In String ${phy_port_out} ${VLAN_BINDING_REGEX} 2
117 TC11 Dhcp Ip Allocation And Ping Validation Within Second Network
118 [Documentation] Verify that port in namespace got an IP. Verify flow entries, verify IP connectivity between HWVTEP port and VM
119 Wait Until Keyword Succeeds 180s 10s L2GatewayOperations.Namespace Dhclient Verify ${HWVTEP_NS2} ${NS2_TAP1} ${port_ip_list[3]}
120 ${output}= Wait Until Keyword Succeeds 60s 10s Execute Command on VM Instance ${NET_2} ${port_ip_list[2]}
121 ... ping -c 3 ${port_ip_list[3]}
123 Should Not Contain ${output} ${PACKET_LOSS}
124 ${src_mac_list}= Create List ${port_mac_list[2]}
125 ${dst_mac_list}= Create List ${port_mac_list[3]}
126 Wait Until Keyword Succeeds 30s 5s L2GatewayOperations.Verify Elan Flow Entries ${OVS_IP} ${src_mac_list} ${dst_mac_list}
127 Wait Until Keyword Succeeds 30s 5s L2GatewayOperations.Verify Ping In Namespace Extra Timeout ${HWVTEP_NS2} ${port_mac_list[3]} ${port_ip_list[2]}
129 TC12 Ping Between Vm In Second Network To Namespace In First Network
130 [Documentation] Verify IP Connectivity between VM in 2nd network to NS in 1st network
131 ${output}= Wait Until Keyword Succeeds 60s 10s Execute Command on VM Instance ${NET_2} ${port_ip_list[2]}
132 ... ping -c 3 ${port_ip_list[1]}
134 Should Contain ${output} ${PACKET_LOSS}
136 TC13 Ping Between Namespace In Second Network To Vm In First Network
137 [Documentation] Verify IP Connectivity between port in NS in 2nd network to VM in 1st network
138 Wait Until Keyword Succeeds 30s 5s L2GatewayOperations.Verify Ping Fails In Namespace ${HWVTEP_NS2} ${port_mac_list[3]} ${port_ip_list[0]}
140 TC14 Create, Update And Attach 2nd Neutron Port to Hwvtep Namespace 1
141 [Documentation] Create and attach 2nd port to HWVTEP in network 1
142 CompareStream.Run_Keyword_If_At_Most_Nitrogen BuiltIn.Pass_Execution Only run on oxygen and later
143 OpenStackOperations.Create Neutron Port With Additional Params ${NET_1} ${HWVTEP_PORT_3} ${SECURITY_GROUP_L2GW_NONE}
144 ${port_mac}= Get Port Mac ${HWVTEP_PORT_3} #port_mac[4]
145 ${port_ip}= Get Port Ip ${HWVTEP_PORT_3} #port_ip[4]
146 Append To List ${port_mac_list} ${port_mac}
147 Append To List ${port_ip_list} ${port_ip}
148 Namespace Add Port Hwvtep1
149 L2GatewayOperations.Update Port For Hwvtep ${HWVTEP_PORT_3}
150 Wait Until Keyword Succeeds 30s 2s L2GatewayOperations.Attach Port To Hwvtep Namespace ${port_mac_list[4]} ${HWVTEP_NS1} ${NS_TAP1}
152 TC15 Update Existing L2Gateway With 2nd Port And Verify
153 [Documentation] Add the new port ${NS_PORT3} to existing L2GW ${L2GW_NAME1} that has an existing connection. ${NS_PORT1} is already attached, adding ${NS_PORT3}
154 ${output}= Wait Until Keyword Succeeds 30s 2s L2GatewayOperations.Update And Verify L2Gateway ${HWVTEP_BRIDGE} ${L2GW_NAME1}
155 ... ${NS_PORT1} ${NS_PORT3}
157 TC16 Verify L2Gateway Connection
158 [Documentation] Verify the L2GW connection has the 2nd port. Verify db in hardware vtep emulator tables.
159 Wait Until Keyword Succeeds 30s 2s L2GatewayOperations.Verify L2Gateway Connection ${L2GW_NAME1} ${NET_1}
160 Wait Until Keyword Succeeds 30s 2s L2GatewayOperations.Verify Ovs Tunnel ${HWVTEP_IP} ${OVS_IP}
161 ${output}= ITM Get Tunnels
163 Should Contain ${output} physicalswitch/${HWVTEP_BRIDGE}
164 Wait Until Keyword Succeeds 30s 1s L2GatewayOperations.Verify Vtep List ${hwvtep_conn_id} ${TUNNEL_TABLE} enable="true"
165 ${phy_port_out}= Get Vtep List ${PHYSICAL_PORT_TABLE}
166 Validate Regexp In String ${phy_port_out} ${VLAN_BINDING_REGEX} 3
167 ${list}= Create List ${OVS_IP} ${HWVTEP_IP}
168 Wait Until Keyword Succeeds 30s 1s L2GatewayOperations.Verify Vtep List ${hwvtep_conn_id} ${PHYSICAL_LOCATOR_TABLE} @{list}
169 Wait Until Keyword Succeeds 30s 1s L2GatewayOperations.Verify Vtep List ${hwvtep_conn_id} ${UCAST_MACS_REMOTE_TABLE} ${port_mac_list[0]}
170 Wait Until Keyword Succeeds 30s 1s L2GatewayOperations.Verify Vtep List ${hwvtep_conn_id} ${UCAST_MACS_REMOTE_TABLE} ${port_mac_list[2]}
172 TC17 Dhcp Ip Allocation For Hwvtep Tap Port
173 [Documentation] Verify the 2nd HWVTEP port was able to get an IP address
174 Wait Until Keyword Succeeds 180s 10s L2GatewayOperations.Namespace Dhclient Verify ${HWVTEP_NS1} ${NS_TAP1} ${port_ip_list[4]}
176 TC18 Verify Ping From Compute Node Vm To Hwvtep Port 2
177 [Documentation] Verify IP connectivity between VM in net1 and 2nd HWVTEP port in net 1
178 ${output}= Wait Until Keyword Succeeds 60s 10s Execute Command on VM Instance ${NET_1} ${port_ip_list[0]}
179 ... ping -c 3 ${port_ip_list[4]}
181 Should Not Contain ${output} ${PACKET_LOSS}
182 ${src_mac_list}= Create List ${port_mac_list[0]}
183 ${dst_mac_list}= Create List ${port_mac_list[4]}
184 Wait Until Keyword Succeeds 30s 5s L2GatewayOperations.Verify Elan Flow Entries ${OVS_IP} ${src_mac_list} ${dst_mac_list}
186 TC19 Ping Verification From Namespace Tap To Ovs Vm
187 [Documentation] Verify IP connectivity between 2nd HWVTEP port and VM in compute node
188 Wait Until Keyword Succeeds 30s 5s L2GatewayOperations.Verify Ping In Namespace Extra Timeout ${HWVTEP_NS1} ${port_mac_list[4]} ${port_ip_list[0]}
190 TC99 Cleanup L2Gateway Connection Itm Tunnel Port Subnet And Network
191 L2GatewayOperations.Delete L2Gateway Connection ${L2GW_NAME1}
192 L2GatewayOperations.Delete L2Gateway Connection ${L2GW_NAME2} check_for_null=True
193 L2GatewayOperations.Delete L2Gateway ${L2GW_NAME1}
194 L2GatewayOperations.Delete L2Gateway ${L2GW_NAME2} check_for_null=True
195 OpenStackOperations.Delete Vm Instance ${OVS_VM1_NAME}
196 OpenStackOperations.Delete Vm Instance ${OVS_VM2_NAME}
197 OpenStackOperations.Delete Port ${OVS_PORT_1}
198 OpenStackOperations.Delete Port ${OVS_PORT_2}
199 OpenStackOperations.Delete Port ${HWVTEP_PORT_1}
200 OpenStackOperations.Delete Port ${HWVTEP_PORT_2}
201 Cleanup L2GW Optional Resources
202 OpenStackOperations.Delete SubNet ${SUBNET_1}
203 OpenStackOperations.Delete SubNet ${SUBNET_2}
204 OpenStackOperations.Delete Network ${NET_1}
205 OpenStackOperations.Delete Network ${NET_2}
209 [Documentation] Basic Suite Setup required for the HWVTEP Test Suite
210 OpenStackOperations.OpenStack Suite Setup
211 OpenStackOperations.Get ControlNode Connection
212 Write Commands Until Prompt cd ${DEVSTACK_DEPLOY_PATH}; source openrc admin admin 30s
213 ${port_mac_list}= Create List
214 Set Suite Variable ${port_mac_list}
215 ${port_ip_list}= Create List
216 Set Suite Variable ${port_ip_list}
221 OpenStackOperations.OpenStack Suite Teardown
224 [Documentation] Suite Setup to configure HWVTEP Emulator for L2 Gateway Testcase Verification.
225 ${hwvtep_conn_id}= Create And Set Hwvtep Connection Id ${HWVTEP_IP}
226 Set Suite Variable ${hwvtep_conn_id}
227 Hwvtep Cleanup ${hwvtep_conn_id} ${HWVTEP_BRIDGE}
229 Hwvtep Initiate ${hwvtep_conn_id} ${HWVTEP_IP} ${HWVTEP_BRIDGE}
230 Namespace Intiate Hwvtep1
231 Wait Until Keyword Succeeds 30s 1s Hwvtep Validation
234 [Documentation] Stop Suite to cleanup Hwvtep configuration
235 Hwvtep Cleanup ${hwvtep_conn_id} ${HWVTEP_BRIDGE}
239 [Arguments] ${conn_id} ${hwvtep_bridge}
240 [Documentation] Cleanup any existing VTEP, VSWITCHD or OVSDB processes.
241 Switch Connection ${conn_id}
242 Write Commands Until Prompt ${DEL_OVS_BRIDGE} ${hwvtep_bridge} 30s
243 Write Commands Until Prompt ${KILL_VTEP_PROC} 30s
244 Write Commands Until Prompt ${KILL_VSWITCHD_PROC} 30s
245 Write Commands Until Prompt ${KILL_OVSDB_PROC} 30s
246 ${stdout}= Write Commands Until Prompt ${GREP_OVS} 30s
248 Write Commands Until Prompt ${REM_OVSDB} 30s
249 Write Commands Until Prompt ${REM_VTEPDB} 30s
252 [Documentation] Cleanup the existing namespaces and ports.
253 Switch Connection ${hwvtep_conn_id}
254 ${stdout}= Write Commands Until Prompt ${IP_LINK} 30s
256 Write Commands Until Prompt ${IP_LINK_DEL} ${NS_PORT1} 30s
257 Write Commands Until Prompt ${IP_LINK_DEL} ${NS_PORT2} 30s
258 ${stdout}= Write Commands Until Prompt ${NETNS} 30s
260 Write Commands Until Prompt ${NETNS_DEL} ${HWVTEP_NS1} 30s
261 Write Commands Until Prompt ${NETNS_DEL} ${HWVTEP_NS2} 30s
262 ${stdout}= Write Commands Until Prompt ${IP_LINK} 30s
266 [Arguments] ${conn_id} ${hwvtep_ip} ${hwvtep_bridge}
267 [Documentation] Configure the Hwvtep Emulation
268 Switch Connection ${conn_id}
269 Write Commands Until Prompt ${CREATE_OVSDB} 30s
270 Write Commands Until Prompt ${CREATE VTEP} 30s
271 Write Commands Until Prompt ${START_OVSDB_SERVER} 30s
272 ${stdout}= Write Commands Until Prompt ${GREP_OVS} 30s
274 Write Commands Until Prompt ${INIT_VSCTL} 30s
275 Write Commands Until Prompt ${DETACH_VSWITCHD} 30s
276 Write Commands Until Prompt ${CREATE_OVS_BRIDGE} ${hwvtep_bridge} 30s
277 ${stdout}= Write Commands Until Prompt ${OVS_SHOW} 30s
279 Write Commands Until Prompt ${ADD_VTEP_PS} ${hwvtep_bridge} 30s
280 Write Commands Until Prompt ${SET_VTEP_PS} ${hwvtep_bridge} tunnel_ips=${hwvtep_ip} 30s
281 Write Commands Until Prompt ${START_OVSVTEP} ${hwvtep_bridge} 30s
282 ${stdout}= Write Commands Until Prompt ${GREP_OVS} 30s
285 Namespace Intiate Hwvtep1
286 [Documentation] Create and configure the namespace, bridges and ports.
287 Switch Connection ${hwvtep_conn_id}
288 Create Configure Namespace ${HWVTEP_NS1} ${NS_PORT1} ${NS_TAP1} ${HWVTEP_BRIDGE}
289 Create Configure Namespace ${HWVTEP_NS2} ${NS_PORT2} ${NS2_TAP1} ${HWVTEP_BRIDGE}
291 Namespace Add Port Hwvtep1
292 [Documentation] Configure the namespace, bridges and ports.
293 Switch Connection ${hwvtep_conn_id}
294 Configure Namespace ${HWVTEP_NS1} ${NS_PORT3} ${NS_TAP3} ${HWVTEP_BRIDGE}
296 Create Configure Namespace
297 [Arguments] ${ns_name} ${ns_port_name} ${tap_port_name} ${hwvtep_bridge}
298 Write Commands Until Prompt ${NETNS_ADD} ${ns_name} 30s
299 Configure Namespace ${ns_name} ${ns_port_name} ${tap_port_name} ${hwvtep_bridge}
302 [Arguments] ${ns_name} ${ns_port_name} ${tap_port_name} ${hwvtep_bridge}
303 Write Commands Until Prompt ${IP_LINK_ADD} ${tap_port_name} type veth peer name ${ns_port_name} 30s
304 Write Commands Until Prompt ${CREATE_OVS_PORT} ${hwvtep_bridge} ${ns_port_name} 30s
305 Write Commands Until Prompt ${IP_LINK_SET} ${tap_port_name} netns ${ns_name} 30s
306 Write Commands Until Prompt ${NETNS_EXEC} ${ns_name} ${IPLINK_SET} ${tap_port_name} up 30s
307 Write Commands Until Prompt sudo ${IPLINK_SET} ${ns_port_name} up 30s
308 ${stdout}= Write Commands Until Prompt ${NETNS_EXEC} ${ns_name} ${IFCONF} 30s
312 [Documentation] Initial validation of the Hwvtep Configuration to confirm Physical_Switch table entries
313 Switch Connection ${hwvtep_conn_id}
314 ${stdout}= Write Commands Until Prompt ${VTEP LIST} ${PHYSICAL_SWITCH_TABLE} 30s
315 Should Contain ${stdout} ${HWVTEP_BRIDGE}
316 Should Contain ${stdout} ${HWVTEP_IP}
317 ${stdout}= Write Commands Until Prompt ${VTEP LIST} ${PHYSICAL_PORT_TABLE} 30s
318 Should Contain ${stdout} ${NS_PORT1}
319 Should Contain ${stdout} ${NS_PORT2}
321 Create And Set Hwvtep Connection Id
322 [Arguments] ${hwvtep_ip}
323 [Documentation] To create connection and return connection id for hwvtep_ip received
324 ${conn_id}= SSHLibrary.Open Connection ${hwvtep_ip} prompt=${DEFAULT_LINUX_PROMPT} timeout=30s
326 Flexible SSH Login ${DEFAULT_USER} ${DEFAULT_PASSWORD}