From 6b14113e016dc7e0b584024832ca2b2bf7d6eaa8 Mon Sep 17 00:00:00 2001 From: Tomer Pearl Date: Tue, 4 Apr 2017 18:51:31 +0300 Subject: [PATCH] Add External Network PNF Tests Two changes in this commit: 1. Add external network PNF test - this uses ttl=1 to make sure PNF connectivity is not traversing any routers (in our case, the external gateway) 2. Change current external connectivity tests to use "internet address" this change is required because since the PNF commit support, pings originating form external gateway IP are not traversing the default gw rules, so this change is required in order to maintain the original coverage of these tests. Depends On: https://git.opendaylight.org/gerrit/54405 Change-Id: I021c3a13b73283d844d614e06a3edb2b9d867f88 Signed-off-by: Tomer Pearl --- csit/libraries/OpenStackOperations.robot | 12 ++++++------ .../03_external_network_tests.robot | 18 ++++++++++++++---- csit/suites/openstack/tempest/tempest.robot | 4 +++- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/csit/libraries/OpenStackOperations.robot b/csit/libraries/OpenStackOperations.robot index bad852df2d..182127865e 100644 --- a/csit/libraries/OpenStackOperations.robot +++ b/csit/libraries/OpenStackOperations.robot @@ -315,12 +315,12 @@ Ping From DHCP Should Not Succeed Should Not Contain ${output} 64 bytes Ping Vm From Control Node - [Arguments] ${vm_floating_ip} + [Arguments] ${vm_floating_ip} ${additional_args}=${EMPTY} [Documentation] Ping VM floating IP from control node Log ${vm_floating_ip} ${devstack_conn_id}= Get ControlNode Connection Switch Connection ${devstack_conn_id} - ${output}= Write Commands Until Prompt ping -c 3 ${vm_floating_ip} 20s + ${output}= Write Commands Until Prompt ping ${additional_args} -c 3 ${vm_floating_ip} 20s Log ${output} Close Connection Should Contain ${output} 64 bytes @@ -355,9 +355,9 @@ Exit From Vm Console Run Keyword If ${rcode} Write Commands Until Prompt exit Check Ping - [Arguments] ${ip_address} + [Arguments] ${ip_address} ${ttl}=64 [Documentation] Run Ping command on the IP available as argument - ${output}= Write Commands Until Expected Prompt ping -c 3 ${ip_address} ${OS_SYSTEM_PROMPT} + ${output}= Write Commands Until Expected Prompt ping -t ${ttl} -c 3 ${ip_address} ${OS_SYSTEM_PROMPT} Should Contain ${output} 64 bytes Check Metadata Access @@ -382,7 +382,7 @@ Execute Command on VM Instance [Return] ${output} Test Operations From Vm Instance - [Arguments] ${net_name} ${src_ip} ${dest_ips} ${user}=cirros ${password}=cubswin:) + [Arguments] ${net_name} ${src_ip} ${dest_ips} ${user}=cirros ${password}=cubswin:) ${ttl}=64 [Documentation] Login to the vm instance using ssh in the network. ${devstack_conn_id}= Get ControlNode Connection Switch Connection ${devstack_conn_id} @@ -400,7 +400,7 @@ Test Operations From Vm Instance \ Log ${dest_ip} \ ${string_empty}= Run Keyword And Return Status Should Be Empty ${dest_ip} \ Run Keyword If ${string_empty} Continue For Loop - \ Run Keyword If ${rcode} Check Ping ${dest_ip} + \ Run Keyword If ${rcode} Check Ping ${dest_ip} ttl=${ttl} Run Keyword If ${rcode} Check Metadata Access [Teardown] Exit From Vm Console diff --git a/csit/suites/openstack/connectivity/03_external_network_tests.robot b/csit/suites/openstack/connectivity/03_external_network_tests.robot index 8424a6d46a..2c4e36575d 100644 --- a/csit/suites/openstack/connectivity/03_external_network_tests.robot +++ b/csit/suites/openstack/connectivity/03_external_network_tests.robot @@ -19,8 +19,12 @@ Resource ../../../libraries/Utils.robot @{VM_INSTANCES_FLOATING} VmInstanceFloating1 VmInstanceFloating2 @{VM_INSTANCES_SNAT} VmInstanceSnat3 VmInstanceSnat4 @{SUBNETS_RANGE} 90.0.0.0/24 +# Parameter values below are based on releng/builder - changing them requires updates in releng/builder as well ${external_gateway} 10.10.10.250 +${external_pnf} 10.10.10.253 ${external_subnet} 10.10.10.0/24 +${external_subnet_allocation_pool} start=10.10.10.2,end=10.10.10.249 +${external_internet_addr} 10.9.9.9 ${external_net_name} external-net ${external_subnet_name} external-subnet ${network1_vlan_id} 167 @@ -75,7 +79,7 @@ Check Vm Instances Have Ip Address Create External Network And Subnet Create Network ${external_net_name} --router:external --provider:network_type=vlan --provider:physical_network=${PUBLIC_PHYSICAL_NETWORK} --provider:segmentation_id=${network1_vlan_id} - Create Subnet ${external_net_name} ${external_subnet_name} ${external_subnet} --gateway ${external_gateway} + Create Subnet ${external_net_name} ${external_subnet_name} ${external_subnet} --gateway ${external_gateway} --allocation-pool ${external_subnet_allocation_pool} Create Router [Documentation] Create Router and Add Interface to the subnets. @@ -105,15 +109,21 @@ Create And Associate Floating IPs for VMs Ping External Gateway From Control Node [Documentation] Check reachability of external gateway by pinging it from the control node. - OpenStackOperations.Ping Vm From Control Node ${external_gateway} + OpenStackOperations.Ping Vm From Control Node ${external_gateway} additional_args=-I ${external_internet_addr} Ping Vm Instance1 Floating IP From Control Node [Documentation] Check reachability of VM instance through floating IP by pinging them. - OpenStackOperations.Ping Vm From Control Node @{VM_FLOATING_IPS}[0] + OpenStackOperations.Ping Vm From Control Node @{VM_FLOATING_IPS}[0] additional_args=-I ${external_internet_addr} Ping Vm Instance2 Floating IP From Control Node [Documentation] Check reachability of VM instance through floating IP by pinging them. - OpenStackOperations.Ping Vm From Control Node @{VM_FLOATING_IPS}[1] + OpenStackOperations.Ping Vm From Control Node @{VM_FLOATING_IPS}[1] additional_args=-I ${external_internet_addr} + +Ping External Network PNF from Vm Instance 1 + [Documentation] Check reachability of External Network PNF from VM instance (with ttl=1 to make sure no router hops) + Pass Execution If "${ODL_STREAM}" == "boron" PNF subnet route support is not available in boron or earlier + ${dst_ip}= Create List ${external_pnf} + OpenStackOperations.Test Operations From Vm Instance @{NETWORKS_NAME}[0] @{FLOATING_VM_IPS}[0] ${dst_ip} ttl=1 Prepare SNAT - Install Netcat On Controller Install Netcat On Controller diff --git a/csit/suites/openstack/tempest/tempest.robot b/csit/suites/openstack/tempest/tempest.robot index c47dcc2ea8..4633a42a4d 100644 --- a/csit/suites/openstack/tempest/tempest.robot +++ b/csit/suites/openstack/tempest/tempest.robot @@ -22,7 +22,9 @@ ${tempest_config_file} /opt/stack/tempest/etc/tempest.conf ${external_physical_network} physnet1 ${external_net_name} external-net ${external_subnet_name} external-subnet +# Parameter values below are based on releng/builder - changing them requires updates in releng/builder as well ${external_gateway} 10.10.10.250 +${external_subnet_allocation_pool} start=10.10.10.2,end=10.10.10.249 ${external_subnet} 10.10.10.0/24 ${network_vlan_id} 167 @@ -95,7 +97,7 @@ Log In To Tempest Executor And Setup Test Environment \ Exit For Loop If '${feature_check_status}' == 'True' Run Keyword If '${feature_check_status}' == 'True' Create Network ${external_net_name} --router:external --provider:network_type=flat --provider:physical_network=${external_physical_network} ... ELSE Create Network ${external_net_name} --router:external --provider:network_type=vlan --provider:physical_network=${PUBLIC_PHYSICAL_NETWORK} --provider:segmentation_id=${network_vlan_id} - Create Subnet ${external_net_name} ${external_subnet_name} ${external_subnet} --gateway ${external_gateway} + Create Subnet ${external_net_name} ${external_subnet_name} ${external_subnet} --gateway ${external_gateway} --allocation-pool ${external_subnet_allocation_pool} List Networks ${control_node_conn_id}= SSHLibrary.Open Connection ${OS_CONTROL_NODE_IP} prompt=${DEFAULT_LINUX_PROMPT_STRICT} Utils.Flexible SSH Login ${OS_USER} -- 2.36.6