2 Documentation Test suite for ARP Request. More test cases to be added in subsequent patches.
4 Library RequestsLibrary
6 Resource ../../../libraries/DevstackUtils.robot
7 Resource ../../../libraries/OpenStackOperations.robot
8 Resource ../../../libraries/SetupUtils.robot
9 Resource ../../../libraries/VpnOperations.robot
10 Resource ../../../variables/netvirt/Variables.robot
11 Resource ../../../variables/Variables.robot
13 Suite Setup Suite Setup
14 Suite Teardown Suite Teardown
15 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
16 Test Teardown OpenStackOperations.Get Test Teardown Debugs
20 ${SECURITY_GROUP} vpna_sg
21 @{NETWORKS} vpna_net_1 vpna_net_2 vpna_net_3
22 @{SUBNETS} vpna_sub_1 vpna_sub_2 vpna_sub_3
23 @{SUBNET_CIDRS} 10.10.10.0/24 10.20.20.0/24 10.30.30.0/24
31 @{NET_1_VMS} vpna_net_1_vm_1 vpna_net_1_vm_2
32 @{NET_2_VMS} vpna_net_2_vm_1 vpna_net_2_vm_2
33 @{NET_3_VMS} vpna_net_3_vm_1 vpna_net_3_vm_2
35 @{VPN_INSTANCE_IDS} 4ae8cd92-48ca-49b5-94e1-b2921a261111
39 ${EXPORT_RT} ["2200:2","2200:3"]
40 ${IMPORT_RT} ["2200:2","2200:3"]
42 @{EXTRA_NW_IP} 192.168.10.110 192.168.20.110
43 ${FIB_ENTRY_2} 192.168.10.110
44 ${RPING_MIP_IP} sudo arping -I eth0:1 -c 5 -b -s 192.168.10.110 192.168.10.110
45 ${RPING_MIP_IP_2} sudo arping -I eth0:1 -c 5 -b -s 192.168.20.110 192.168.20.110
46 ${RPING_EXP_STR} broadcast
51 [Documentation] Verify that VMs received ip and ping is happening between different VMs.
52 ... For this, we ssh to the VM using the dhcp-namespace on the controller node and verify ping
53 ... reachability to the second VM on the same network and VMs on other network (i.e., east-west routing)
54 ${vms} = BuiltIn.Create List @{NET_1_VM_IPS} @{NET_2_VM_IPS} @{NET_3_VM_IPS}
55 BuiltIn.Wait Until Keyword Succeeds
58 ... Utils.Check For Elements At URI
59 ... ${FIB_ENTRIES_URL}
61 Verify Ping On Same Networks
62 Verify Ping On Different Networks
65 [Documentation] Verify that GARP request is sent to controller and controller learns this info.
66 ... In this test-case, before we validate the GARPs, we ensure that the necessary pipeline
67 ... flows for the VMs spawned on the networks are as expected (along with the FIB Entries
68 ... in the ODL Datastore). For triggering GARPs, we create an alias interface (eth0:1) on
69 ... VM1_net0, configure it with an extra_route_ip, trigger 5 GARPs from the VM for the
70 ... extra_route_ip and ensure that ODL learns (by looking at odl-fib:fibEntries) the
71 ... extra_route_ip info with the nexthop pointing to Compute-1 (where VM1_net0 is spawned)
72 ... hostIP. Finally, we verify ping reachability to the extra_route_ip from other VMs on
74 BuiltIn.Pass Execution If "${OPENSTACK_TOPO}" == "1cmb-0ctl-0cmp" "Test is not supported for combo node"
75 BuiltIn.Set Test Variable ${fib_entry_1} ${NET_1_VM_IPS}[0]
76 BuiltIn.Set Test Variable ${fib_entry_3} ${NET_1_VM_IPS}[1]
77 Verify Flows Are Present On All Compute Nodes
78 ${output} = VpnOperations.Get Fib Entries session
79 ${resp} = BuiltIn.Should Match Regexp ${output} destPrefix\\":\\"${fib_entry_3}\/32".*"${OS_CMP2_IP}\\"
80 ${resp} = BuiltIn.Should Match Regexp ${output} destPrefix\\":\\"${fib_entry_1}\/32".*"${OS_CMP1_IP}\\"
81 ${rx_packet1_before} = OpenStackOperations.Execute Command on VM Instance
83 ... ${NET_1_VM_IPS}[1]
85 ${rx_packet0_before} = OpenStackOperations.Execute Command on VM Instance
87 ... ${NET_1_VM_IPS}[0]
89 ${config_extra_route_ip1} = BuiltIn.Catenate
90 ... sudo ifconfig ${SUB_IF} ${EXTRA_NW_IP}[0] netmask 255.255.255.0 up
91 ${output} = OpenStackOperations.Execute Command on VM Instance
93 ... ${NET_1_VM_IPS}[1]
94 ... ${config_extra_route_ip1}
95 ${output} = OpenStackOperations.Execute Command on VM Instance
97 ... ${NET_1_VM_IPS}[1]
99 BuiltIn.Should Contain ${output} ${SUB_IF}
100 ${output} = OpenStackOperations.Execute Command on VM Instance
102 ... ${NET_1_VM_IPS}[1]
104 BuiltIn.Should Contain ${output} broadcast
105 BuiltIn.Should Contain ${output} Received 0 reply
106 ${rx_packet1_after} = OpenStackOperations.Execute Command on VM Instance
108 ... ${NET_1_VM_IPS}[1]
110 ${rx_packet0_after} = OpenStackOperations.Execute Command on VM Instance
112 ... ${NET_1_VM_IPS}[0]
114 BuiltIn.Should Not Be Equal ${rx_packet0_before} ${rx_packet0_after}
115 BuiltIn.Should Not Be Equal ${rx_packet1_before} ${rx_packet1_after}
116 Verify Flows Are Present On All Compute Nodes
117 BuiltIn.Wait Until Keyword Succeeds 5s 1s Verify Learnt IP ${FIB_ENTRY_2} session
118 ${output} = VpnOperations.Get Fib Entries session
119 ${resp} = BuiltIn.Should Match Regexp ${output} destPrefix\\":\\"${fib_entry_3}\\/32".*"${OS_CMP2_IP}\\"
120 ${resp} = BuiltIn.Should Match Regexp ${output} destPrefix\\":\\"${fib_entry_1}\\/32".*"${OS_CMP1_IP}\\"
121 ${resp} = BuiltIn.Should Match Regexp ${output} destPrefix\\":\\"${FIB_ENTRY_2}\\/32".*"${OS_CMP2_IP}\\"
122 Verify Ping To Sub Interface ${FIB_ENTRY_2}
125 [Documentation] Verify that after migration of movable ip across compute nodes, the controller updates the routes.
126 ... Unconfigure the extra_route_ip on VM1_net0 and configure it on vm0_net0 (on Compute-0 host).
127 ... Trigger 5 GARPs from the VM for the extra_route_ip and ensure that ODL learns/updates
128 ... the extra_route_ip info with nexthop in the FIB entry pointing to Compute-0 hostip.
129 BuiltIn.Pass Execution If "${OPENSTACK_TOPO}" == "1cmb-0ctl-0cmp" "Test is not supported for combo node"
130 ${unconfig_extra_route_ip1} = BuiltIn.Catenate sudo ifconfig ${SUB_IF} down
131 ${output} = OpenStackOperations.Execute Command on VM Instance
133 ... ${NET_1_VM_IPS}[1]
134 ... ${unconfig_extra_route_ip1}
135 ${output} = OpenStackOperations.Execute Command on VM Instance
137 ... ${NET_1_VM_IPS}[1]
139 BuiltIn.Should Not Contain ${output} ${SUB_IF}
140 ${config_extra_route_ip1} = BuiltIn.Catenate
141 ... sudo ifconfig ${SUB_IF} ${EXTRA_NW_IP}[0] netmask 255.255.255.0 up
142 ${output} = OpenStackOperations.Execute Command on VM Instance
144 ... ${NET_1_VM_IPS}[0]
145 ... ${config_extra_route_ip1}
146 ${output} = OpenStackOperations.Execute Command on VM Instance
148 ... ${NET_1_VM_IPS}[0]
150 BuiltIn.Should Contain ${output} ${SUB_IF}
151 ${output} = OpenStackOperations.Execute Command on VM Instance
153 ... ${NET_1_VM_IPS}[0]
154 ... ifconfig ${SUB_IF}
155 ${output} = OpenStackOperations.Execute Command on VM Instance
157 ... ${NET_1_VM_IPS}[0]
159 BuiltIn.Should Contain ${output} Received 0 reply
160 BuiltIn.Should Contain ${output} broadcast
161 BuiltIn.Wait Until Keyword Succeeds 5s 1s Verify Learnt IP ${FIB_ENTRY_2} session
162 ${output} = OpenStackOperations.Execute Command on VM Instance
164 ... ${NET_1_VM_IPS}[0]
166 ${output} = VpnOperations.Get Fib Entries session
167 ${resp} = BuiltIn.Should Match Regexp ${output} destPrefix\\":\\"${FIB_ENTRY_2}\\/32".*"${OS_CMP1_IP}\\"
168 Verify Ping To Sub Interface ${FIB_ENTRY_2}
169 ${unconfig_extra_route_ip1} = BuiltIn.Catenate sudo ifconfig ${SUB_IF} down
170 ${output} = OpenStackOperations.Execute Command on VM Instance
172 ... ${NET_1_VM_IPS}[0]
173 ... ${unconfig_extra_route_ip1}
175 Verify ping to subnet gateway
176 [Documentation] Verify ping happens to subnet gateway. To be submitted in next patch
177 [Tags] not-implemented exclude
180 If anything other than subnet ip then no reply
181 [Documentation] If anything other than subnet ip then no reply. To be submitted in next patch
182 [Tags] not-implemented exclude
185 Validate multiple mip migration
186 [Documentation] Validate multiple mip migration. To be submitted in next patch
187 [Tags] not-implemented exclude
190 Same DPN MIP Migration
191 [Documentation] Same DPN MIP Migration. To be submitted in next patch
192 [Tags] not-implemented exclude
198 [Documentation] Suite Setup to create the necessary resources.
199 ... Create three tenant networks with a subnet in each network and an allow-all Security Group.
200 ... In each of the networks, create two ports (i.e., total of 6 ports, two in each network)
201 ... Create two VMs in each network (so total of 6 VMs). VM0_net0 on Compute-0 and VM1_net0 on Compute-1.
202 ... Create a Neutron Router and associate subnet1 and subnet2.
203 ... Create an L3VPN instance and associate the L3VPN instance to the neutron router.
204 VpnOperations.Basic Suite Setup
205 FOR ${network} IN @{NETWORKS}
206 OpenStackOperations.Create Network ${network}
208 ${neutron_networks} = OpenStackOperations.List Networks
209 FOR ${network} IN @{NETWORKS}
210 BuiltIn.Should Contain ${neutron_networks} ${network}
212 ${NET_ID} = OpenStackOperations.Get Net Id ${NETWORKS}[0]
213 BuiltIn.Set Suite Variable ${NET_ID}
214 FOR ${i} IN RANGE 0 3
215 OpenStackOperations.Create SubNet ${NETWORKS}[${i}] ${SUBNETS}[${i}] ${SUBNET_CIDRS}[${i}]
217 ${neutron_subnets} = OpenStackOperations.List Subnets
218 FOR ${subnet} IN @{SUBNETS}
219 BuiltIn.Should Contain ${neutron_subnets} ${subnet}
221 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
222 OpenStackOperations.Create Port
225 ... sg=${SECURITY_GROUP}
226 ... allowed_address_pairs=@{EXTRA_NW_IP}
227 OpenStackOperations.Create Port
230 ... sg=${SECURITY_GROUP}
231 ... allowed_address_pairs=@{EXTRA_NW_IP}
232 OpenStackOperations.Create Port
235 ... sg=${SECURITY_GROUP}
236 ... allowed_address_pairs=@{EXTRA_NW_IP}
237 OpenStackOperations.Create Port
240 ... sg=${SECURITY_GROUP}
241 ... allowed_address_pairs=@{EXTRA_NW_IP}
242 OpenStackOperations.Create Port
245 ... sg=${SECURITY_GROUP}
246 ... allowed_address_pairs=@{EXTRA_NW_IP}
247 OpenStackOperations.Create Port
250 ... sg=${SECURITY_GROUP}
251 ... allowed_address_pairs=@{EXTRA_NW_IP}
252 Wait Until Keyword Succeeds
255 ... Check For Elements At URI
256 ... ${CONFIG_API}/neutron:neutron/ports/
258 OpenStackOperations.Create Vm Instance With Port On Compute Node
261 ... ${OS_CMP1_HOSTNAME}
262 ... sg=${SECURITY_GROUP}
263 OpenStackOperations.Create Vm Instance With Port On Compute Node
266 ... ${OS_CMP2_HOSTNAME}
267 ... sg=${SECURITY_GROUP}
268 OpenStackOperations.Create Vm Instance With Port On Compute Node
271 ... ${OS_CMP1_HOSTNAME}
272 ... sg=${SECURITY_GROUP}
273 OpenStackOperations.Create Vm Instance With Port On Compute Node
276 ... ${OS_CMP2_HOSTNAME}
277 ... sg=${SECURITY_GROUP}
278 OpenStackOperations.Create Vm Instance With Port On Compute Node
281 ... ${OS_CMP1_HOSTNAME}
282 ... sg=${SECURITY_GROUP}
283 OpenStackOperations.Create Vm Instance With Port On Compute Node
286 ... ${OS_CMP2_HOSTNAME}
287 ... sg=${SECURITY_GROUP}
288 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
289 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
290 @{NET_3_VM_IPS} ${NET_3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_3_VMS}
291 BuiltIn.Set Suite Variable @{NET_1_VM_IPS}
292 BuiltIn.Set Suite Variable @{NET_2_VM_IPS}
293 BuiltIn.Set Suite Variable @{NET_3_VM_IPS}
294 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
295 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
296 BuiltIn.Should Not Contain ${NET_3_VM_IPS} None
297 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
298 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
299 BuiltIn.Should Not Contain ${NET_3_DHCP_IP} None
300 OpenStackOperations.Create Router ${ROUTER}
301 OpenStackOperations.Add Router Interface ${ROUTER} ${SUBNETS}[1]
302 OpenStackOperations.Add Router Interface ${ROUTER} ${SUBNETS}[2]
303 ${tenant_id} = OpenStackOperations.Get Tenant ID From Network ${NET_ID}
304 VpnOperations.VPN Create L3VPN
305 ... vpnid=${VPN_INSTANCE_IDS}[0]
306 ... name=${VPN_NAMES[0]}
308 ... exportrt=${EXPORT_RT}
309 ... importrt=${IMPORT_RT}
310 ... tenantid=${tenant_id}
311 ${resp} = VpnOperations.VPN Get L3VPN vpnid=${VPN_INSTANCE_IDS}[0]
312 BuiltIn.Should Contain ${resp} ${VPN_INSTANCE_IDS}[0]
313 Associate L3VPN To ROUTER
314 OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS} @{NET_3_VMS}
315 OpenStackOperations.Get Suite Debugs
318 [Documentation] Delete the setup
319 BuiltIn.Run Keyword And Ignore Error
320 ... VpnOperations.Dissociate L3VPN From Networks
321 ... networkid=${NET_ID}
322 ... vpnid=${VPN_INSTANCE_IDS}[0]
323 BuiltIn.Run Keyword And Ignore Error
324 ... VpnOperations.Dissociate VPN to Router
325 ... routerid=${ROUTER_ID}
326 ... vpnid=${VPN_INSTANCE_IDS}[0]
327 BuiltIn.Run Keyword And Ignore Error VpnOperations.VPN Delete L3VPN vpnid=${VPN_INSTANCE_IDS}[0]
328 OpenStackOperations.OpenStack Suite Teardown
330 Associate L3VPN To ROUTER
331 VpnOperations.Associate L3VPN To Network networkid=${NET_ID} vpnid=${VPN_INSTANCE_IDS}[0]
332 ${resp} = VpnOperations.VPN Get L3VPN vpnid=${VPN_INSTANCE_IDS}[0]
333 BuiltIn.Should Contain ${resp} ${NET_ID}
334 ${ROUTER_ID} = OpenStackOperations.Get Router Id ${ROUTER}
335 BuiltIn.Set Suite Variable ${ROUTER_ID}
336 VpnOperations.Associate VPN to Router routerid=${ROUTER_ID} vpnid=${VPN_INSTANCE_IDS}[0]
337 ${resp} = VpnOperations.VPN Get L3VPN vpnid=${VPN_INSTANCE_IDS}[0]
338 BuiltIn.Should Contain ${resp} ${ROUTER_ID}
340 Verify Ping On Same Networks
341 [Documentation] Verify ping among VM of same network
342 ${output} = OpenStackOperations.Execute Command on VM Instance
344 ... ${NET_1_VM_IPS}[0]
345 ... ping -c 3 ${NET_1_VM_IPS}[1]
346 BuiltIn.Should Contain ${output} ${PING_REGEXP}
347 ${output} = OpenStackOperations.Execute Command on VM Instance
349 ... ${NET_2_VM_IPS}[0]
350 ... ping -c 3 ${NET_2_VM_IPS}[1]
351 BuiltIn.Should Contain ${output} ${PING_REGEXP}
352 ${output} = OpenStackOperations.Execute Command on VM Instance
354 ... ${NET_1_VM_IPS}[1]
355 ... ping -c 3 ${NET_1_VM_IPS}[0]
356 BuiltIn.Should Contain ${output} ${PING_REGEXP}
357 ${output} = OpenStackOperations.Execute Command on VM Instance
359 ... ${NET_2_VM_IPS}[1]
360 ... ping -c 3 ${NET_2_VM_IPS}[0]
361 BuiltIn.Should Contain ${output} ${PING_REGEXP}
362 ${output} = OpenStackOperations.Execute Command on VM Instance
364 ... ${NET_3_VM_IPS}[0]
365 ... ping -c 3 ${NET_3_VM_IPS}[1]
366 BuiltIn.Should Contain ${output} ${PING_REGEXP}
368 Verify Ping On Different Networks
369 [Documentation] Verify ping among VMs of different network
370 ${output} = OpenStackOperations.Execute Command on VM Instance
372 ... ${NET_1_VM_IPS}[0]
373 ... ping -c 3 ${NET_2_VM_IPS}[0]
374 BuiltIn.Should Contain ${output} ${PING_REGEXP}
375 ${output} = OpenStackOperations.Execute Command on VM Instance
377 ... ${NET_2_VM_IPS}[0]
378 ... ping -c 3 ${NET_3_VM_IPS}[0]
379 BuiltIn.Should Contain ${output} ${PING_REGEXP}
380 ${output} = OpenStackOperations.Execute Command on VM Instance
382 ... ${NET_1_VM_IPS}[1]
383 ... ping -c 3 ${NET_2_VM_IPS}[1]
384 BuiltIn.Should Contain ${output} ${PING_REGEXP}
385 ${output} = OpenStackOperations.Execute Command on VM Instance
387 ... ${NET_2_VM_IPS}[1]
388 ... ping -c 3 ${NET_3_VM_IPS}[1]
389 BuiltIn.Should Contain ${output} ${PING_REGEXP}
390 ${output} = OpenStackOperations.Execute Command on VM Instance
392 ... ${NET_3_VM_IPS}[0]
393 ... ping -c 3 ${NET_1_VM_IPS}[1]
394 BuiltIn.Should Contain ${output} ${PING_REGEXP}
396 Verify Flows Are Present
397 [Documentation] Verify Flows Are Present
398 ... Verify that Flows to support L3 Connectivity (like ELAN_SMAC_TABLE, FIB_TABLE)
399 ... and a FIB entry to reach all the VMs in the network exist in the OVS pipeline.
401 ${flow_output} = Utils.Run Command On Remote System
403 ... sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
404 BuiltIn.Log ${flow_output}
405 ${resp} = BuiltIn.Should Contain ${flow_output} table=50
406 ${resp} = BuiltIn.Should Contain ${flow_output} table=21,
407 @{vm_ips} = BuiltIn.Create List @{NET_1_VM_IPS} @{NET_2_VM_IPS} @{NET_3_VM_IPS}
408 ${resp} = Should Match regexp ${flow_output} table=0.*goto_table:36
409 ${resp} = Should Match regexp ${flow_output} table=0.*goto_table:17
410 FOR ${ip} IN @{vm_ips}
411 ${resp} = Should Match regexp ${flow_output} table=21.*nw_dst=${ip}
414 Verify Flows Are Present On All Compute Nodes
415 [Documentation] Verify Flows Are Present On All Compute Nodes
416 FOR ${ip} IN @{OS_CMP_IPS}
417 BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Flows Are Present ${ip}
420 Verify Ping To Sub Interface
421 [Documentation] Verify ping to the sub-interface
422 [Arguments] ${sub_interface_ip}
423 ${output} = OpenStackOperations.Execute Command on VM Instance
425 ... ${NET_1_VM_IPS}[0]
426 ... ping -c 3 ${sub_interface_ip}
427 BuiltIn.Should Contain ${output} ${PING_REGEXP}
428 ${output} = OpenStackOperations.Execute Command on VM Instance
430 ... ${NET_2_VM_IPS}[0]
431 ... ping -c 3 ${sub_interface_ip}
432 BuiltIn.Should Contain ${output} ${PING_REGEXP}
433 ${output} = OpenStackOperations.Execute Command on VM Instance
435 ... ${NET_3_VM_IPS}[0]
436 ... ping -c 3 ${sub_interface_ip}
437 BuiltIn.Should Contain ${output} ${PING_REGEXP}
440 [Documentation] Check that sub interface ip has been learnt after ARP request
441 [Arguments] ${ip} ${session}
442 ${resp} = RequestsLibrary.Get Request
444 ... /restconf/operational/odl-l3vpn:learnt-vpn-vip-to-port-data/
445 BuiltIn.Log ${resp.text}
446 BuiltIn.Should Contain ${resp.text} ${ip}
449 Fail "Not implemented"