Add External Network PNF Tests 17/54317/12
authorTomer Pearl <tomer.pearl@hpe.com>
Tue, 4 Apr 2017 15:51:31 +0000 (18:51 +0300)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 7 Apr 2017 00:04:07 +0000 (00:04 +0000)
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 <tomer.pearl@hpe.com>
csit/libraries/OpenStackOperations.robot
csit/suites/openstack/connectivity/03_external_network_tests.robot
csit/suites/openstack/tempest/tempest.robot

index bad852df2dae537a9ece3c9c929c5df49f681786..182127865e3986598975b9f081226d03c2cd5b57 100644 (file)
@@ -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
 
index 8424a6d46a616109489f66b847aea239ecfd1bdf..2c4e36575d929a7c4d4e01c3967135be9ab4010a 100644 (file)
@@ -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
index c47dcc2ea87f75cc98d7476080819558a77393ef..4633a42a4da972014c720212e49b9b005f7a0392 100644 (file)
@@ -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}