Fix CSIT Tests as per the recent changes in Keywords 64/38964/8
authorpriya.ramasubbu <priya.ramasubbu@hcl.com>
Tue, 17 May 2016 15:13:58 +0000 (20:43 +0530)
committergvrangan <venkatrangang@hcl.com>
Thu, 19 May 2016 21:07:34 +0000 (21:07 +0000)
  * Fix the Openstack Tests
  * Fixed the  tests added to Tempest suite as well
  * Removed the Ping All as it is not necessary now

Change-Id: I11c56586f11d29c5ebaa94686b86a01f02b5a920
Signed-off-by: priya.ramasubbu <priya.ramasubbu@hcl.com>
csit/libraries/DevstackUtils.robot
csit/libraries/OpenStackOperations.robot
csit/suites/openstack/clustering/01_l2_tests.robot
csit/suites/openstack/clustering/02_l3_tests.robot
csit/suites/openstack/connectivity/01_l2_tests.robot
csit/suites/ovsdb/Devstack_Tempest_Tests/01__single_node_devstack_tempest_tests.robot
csit/suites/ovsdb/Devstack_Tempest_Tests/02__additional_flows_verification_tests.robot

index f7d4c374123ebb5090f1f05de381f3bc54952164..c3caf13ff562f3cf32421d642d3ea93ce18c677b 100644 (file)
@@ -44,8 +44,12 @@ Devstack Suite Setup Tests
     SSHLibrary.Set Client Configuration    timeout=${default_devstack_prompt_timeout}
 
 Devstack Suite Setup
+    [Arguments]    ${source_pwd}=no
     [Documentation]    Login to the Openstack Control Node to run tempest suite
-    SSHLibrary.Open Connection    ${DEVSTACK_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}
+    ${devstack_conn_id}=   SSHLibrary.Open Connection    ${DEVSTACK_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}
+    Set Suite Variable    ${devstack_conn_id}
+    Set Suite Variable    ${source_pwd}
+    Log    ${devstack_conn_id}
     Utils.Flexible SSH Login    ${DEVSTACK_SYSTEM_USER}    ${DEVSTACK_SYSTEM_PASSWORD}
     SSHLibrary.Set Client Configuration    timeout=${default_devstack_prompt_timeout}
     Run Keyword If    ${CLEAN_DEVSTACK_HOST}    Clean DevStack Host In Case It Is Not Sterile
index fa83dc3f1920b5575c5a08d5f8716bfb1892fb8e..48f7445fd1598877d97cd08c3f385ee300f3a2bf 100644 (file)
@@ -133,6 +133,17 @@ Ping Vm From DHCP Namespace
     Log    ${output}
     Should Contain    ${output}    64 bytes
 
+Ping From DHCP Should Not Succeed
+    [Arguments]    ${net_name}    ${vm_ip}
+    [Documentation]    Should Not Reach Vm Instance with the net id of the Netowrk.
+    Log    ${vm_ip}
+    Switch Connection    ${devstack_conn_id}
+    ${net_id}=    Get Net Id      ${net_name}
+    Log    ${net_id}
+    ${output}=    Write Commands Until Prompt    sudo ip netns exec qdhcp-${net_id} ping -c 3 ${vm_ip}    20s
+    Log    ${output}
+    Should Not Contain    ${output}    64 bytes
+
 Ping From Instance
     [Arguments]    ${dest_vm}
     [Documentation]    Ping to the expected destination ip.
@@ -219,7 +230,7 @@ Create Router
     [Documentation]    Create Router and Add Interface to the subnets.
     Switch Connection    ${devstack_conn_id}
     Source Password
-    ${output}=    Write Commands Until Prompt    neutron -v router-create ${router_name}
+    ${output}=    Write Commands Until Prompt    neutron -v router-create ${router_name}     30s
     Should Contain    ${output}    Created a new router
 
 Add Router Interface
index fc88c2c0094974d415ac45d4483ca276418d2320..4cd41f281939f06dd397126bfbb3232f3ef0a8e7 100644 (file)
@@ -179,17 +179,9 @@ Delete Vm Instance
     [Documentation]    Delete Vm instances using instance names.
     Delete Vm Instance    VmInstance1_l2_net_1
 
-Ping All Vm Instances
-    [Documentation]    Check reachability of vm instances by pinging to them.
-    ${net_id}=    Get Net Id    l2_net_1
-    : FOR    ${VmIpElement}    IN    @{VM_IPS_NOT_DELETED}
-    \    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
-    \    Should Contain    ${output}    64 bytes
-
 No Ping For Deleted Vm
     [Documentation]    Check non reachability of deleted vm instances by pinging to them.
-    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    @{NET_1_VM_IPS}[0]
-    Should Contain    ${output}    Destination Host Unreachable
+    ${output}=    Ping From DHCP Should Not Succeed    l2_network_1    @{NET_1_VM_IPS}[0]
 
 Delete Vm Instances In network_1
     [Documentation]    Delete Vm instances using instance names in network_1.
index e0613a65467356e9cb2a34f345cd0ba48e764310..0b82ee7179ed0b723132c4e887efe5ec74423353 100644 (file)
@@ -114,15 +114,15 @@ Ping Vm Instance3 In l3_net_2 From l3_net_1
     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
     Ping Vm From DHCP Namespace    l3_net_1    @{NET_2_VM_IPS}[2]
 
-Ping Vm Instance In l3_net_1 From l3_net_2
+Ping Vm Instance1 In l3_net_1 From l3_net_2
     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
     Ping Vm From DHCP Namespace    l3_net_2    @{NET_1_VM_IPS}[0]
 
-Ping Vm Instance In l3_net_1 From l3_net_2
+Ping Vm Instance2 In l3_net_1 From l3_net_2
     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
     Ping Vm From DHCP Namespace    l3_net_2    @{NET_1_VM_IPS}[1]
 
-Ping Vm Instance In l3_net_1 From l3_net_2
+Ping Vm Instance3 In l3_net_1 From l3_net_2
     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
     Ping Vm From DHCP Namespace    l3_net_2    @{NET_1_VM_IPS}[2]
 
index 94f7d9decbaff32b88e46b036ff60ec0438a8e7d..f96e85cce0b7e451235fcf28753f0c05d71dd30c 100644 (file)
@@ -14,9 +14,9 @@ Resource    ../../../libraries/DevstackUtils.robot
 @{SUBNETS_NAME}    l2_subnet_1    l2_subnet_2
 @{NET_1_VM_INSTANCES}    MyFirstInstance_1    MySecondInstance_1      MyThirdInstance_1
 @{NET_2_VM_INSTANCES}    MyFirstInstance_2    MySecondInstance_2      MyThirdInstance_2
-@{NET_1_VM_IPS}    30.0.0.3    30.0.0.4     30.0.0.5
-@{NET_2_VM_IPS}    40.0.0.3    40.0.0.4     40.0.0.5
-@{VM_IPS_NOT_DELETED}    30.0.0.4
+@{NET_1_VM_IPS}    30.0.0.3    30.0.0.4    30.0.0.5
+@{NET_2_VM_IPS}    40.0.0.3    40.0.0.4    40.0.0.5
+@{VM_IPS_NOT_DELETED}    30.0.0.4    30.0.0.5
 @{GATEWAY_IPS}    30.0.0.1    40.0.0.1
 @{DHCP_IPS}       30.0.0.2    40.0.0.2
 @{SUBNETS_RANGE}    30.0.0.0/24    40.0.0.0/24
@@ -70,19 +70,19 @@ Ping Vm Instance3 In l2_network_2
     Ping Vm From DHCP Namespace    l2_network_2     @{NET_2_VM_IPS}[2]
 
 Connectivity Tests From Vm Instance1 In l2_network_1
-    [Documentation]    Logging to the vm instance1 
+    [Documentation]    Logging to the vm instance1
     ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[1]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[2]
     Log    ${dst_ip_list}
     Test Operations From Vm Instance      l2_network_1     @{NET_1_VM_IPS}[0]    ${dst_ip_list}
 
 Connectivity Tests From Vm Instance2 In l2_network_1
-    [Documentation]    Logging to the vm instance2 
+    [Documentation]    Logging to the vm instance2
     ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[2]
     Log    ${dst_ip_list}
     Test Operations From Vm Instance      l2_network_1    @{NET_1_VM_IPS}[1]    ${dst_ip_list}
 
 Connectivity Tests From Vm Instance3 In l2_network_1
-    [Documentation]    Logging to the vm instance2 
+    [Documentation]    Logging to the vm instance2
     ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[1]
     Log    ${dst_ip_list}
     Test Operations From Vm Instance      l2_network_1    @{NET_1_VM_IPS}[2]    ${dst_ip_list}
@@ -105,17 +105,13 @@ Connectivity Tests From Vm Instance3 In l2_network_2
     Log    ${dst_ip_list}
     Test Operations From Vm Instance      l2_network_2     @{NET_2_VM_IPS}[2]    ${dst_ip_list}
 
-Ping All Vm Instances
-    [Documentation]    Check reachability of vm instances by pinging to them.
-    ${net_id}=    Get Net Id    l2_network_1
-    : FOR    ${VmIpElement}    IN    @{VM_IPS_NOT_DELETED}
-    \    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
-    \    Should Contain    ${output}    64 bytes
+Delete A Vm Instance
+    [Documentation]    Delete Vm instances using instance names.
+    Delete Vm Instance    MyFirstInstance_1
 
 No Ping For Deleted Vm
     [Documentation]    Check non reachability of deleted vm instances by pinging to them.
-    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    @{NET_1_VM_IPS}[0]
-    Should Contain    ${output}    Destination Host Unreachable
+    ${output}=    Ping From DHCP Should Not Succeed    l2_network_1    @{NET_1_VM_IPS}[0]
 
 Delete Vm Instances In l2_network_1
     [Documentation]    Delete Vm instances using instance names in l2_network_1.
index fb4b228e28d97a3e78793cd01adf5ed276a5ac48..a4229f78db8cb55df137ed6f25b3e18f968107ac 100644 (file)
@@ -11,10 +11,12 @@ Resource          ../../../libraries/DevstackUtils.robot
 *** Variables ***
 @{NETWORKS_NAME}    net1_network    net2_network
 @{SUBNETS_NAME}    subnet1    subnet2
-@{VM_INSTANCES_NAME}    MyFirstInstance    MySecondInstance
+@{NET_1_VM_INSTANCES}    MyFirstInstance_1    MySecondInstance_1
+@{NET_2_VM_INSTANCES}    MyFirstInstance_2    MySecondInstance_2
 @{VM_IPS}         10.0.0.3    20.0.0.3
 @{GATEWAY_IPS}    10.0.0.1    20.0.0.1
 @{DHCP_IPS}       10.0.0.2    20.0.0.2
+@{SUBNETS_RANGE}    10.0.0.0/24    20.0.0.0/24
 
 *** Test Cases ***
 Run Devstack Gate Wrapper
@@ -44,11 +46,11 @@ Create Networks
 
 Create Subnets For net1_network
     [Documentation]    Create Sub Nets for the Networks with neutron request.
-    Create SubNet    net1_network    subnet1    10.0.0.0/24
+    Create SubNet    net1_network    subnet1    @{SUBNETS_RANGE}[0]
 
 Create Subnets For net2_network
     [Documentation]    Create Sub Nets for the Networks with neutron request.
-    Create SubNet    net2_network    subnet2    20.0.0.0/24
+    Create SubNet    net2_network    subnet2    @{SUBNETS_RANGE}[1]
 
 List Ports
     ${output}=    Write Commands Until Prompt    neutron -v port-list
@@ -76,19 +78,13 @@ List Nova Flavor
 
 Create Vm Instances For net1_network
     [Documentation]    Create Vm instances using flavor and image names.
-    ${net_id}=    Get Net Id    net1_network
-    Create Vm Instances    ${net_id}    ${VM_INSTANCES_NAME}
+    Create Vm Instances    net1_network    ${NET_1_VM_INSTANCES}
+    [Teardown]    Show Debugs      ${NET_1_VM_INSTANCES}
 
 Create Vm Instances For net2_network
     [Documentation]    Create Vm instances using flavor and image names.
-    ${net_id}=    Get Net Id    net2_network
-    Create Vm Instances    ${net_id}    ${VM_INSTANCES_NAME}
-
-Show Details of Created Vm Instance
-    [Documentation]    View Details of the created vm instances using nova show.
-    : FOR    ${VmElement}    IN    @{VM_INSTANCES_NAME}
-    \    ${output}=    Write Commands Until Prompt    nova show ${VmElement}
-    \    Log    ${output}
+    Create Vm Instances    net2_network    ${NET_2_VM_INSTANCES}
+    [Teardown]    Show Debugs      ${NET_2_VM_INSTANCES}
 
 Verify Created Vm Instance In Dump Flow
     [Documentation]    Verify the existence of the created vm instance ips in the dump flow.
@@ -111,9 +107,14 @@ Verify Dhcp Flow Entries
     Run Keyword If    "${ODL_VERSION}" == "lithium-latest"    Run Keyword And Ignore Error    Verify Dhcp Ips
     ...    ELSE IF    "${ODL_VERSION}" != "lithium-latest"    Verify Dhcp Ips
 
-Delete Vm Instances
-    [Documentation]    Delete Vm instances using instance names.
-    : FOR    ${VmElement}    IN    @{VM_INSTANCES_NAME}
+Delete Vm Instances In net1_network
+    [Documentation]    Delete Vm instances using instance names in net1_network.
+    : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
+    \    Delete Vm Instance    ${VmElement}
+
+Delete Vm Instances In net2_network
+    [Documentation]    Delete Vm instances using instance names in net2_network.
+    : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
     \    Delete Vm Instance    ${VmElement}
 
 Verify Deleted Vm Instance Removed In Dump Flow
@@ -125,7 +126,8 @@ Verify Deleted Vm Instance Removed In Dump Flow
 
 Delete Router Interfaces
     [Documentation]    Remove Interface to the subnets.
-    Remove Interface    router_1
+    : FOR     ${interface}    IN     @{SUBNETS_NAME}
+    \     Remove Interface     router_1     ${interface}
 
 Delete Routers
     [Documentation]    Delete Router and Interface to the subnets.
index 411e7c4e6f2e2c68ba8d29f1114b79d15b620369..05ab6247e711faf9714faf0ab861ef226f05e4ef 100644 (file)
@@ -18,6 +18,7 @@ Resource          ../../../libraries/DevstackUtils.robot
 @{VM_IPS_NOT_DELETED}    30.0.0.4
 @{GATEWAY_IPS}    30.0.0.1    40.0.0.1
 @{DHCP_IPS}       30.0.0.2    40.0.0.2
+@{SUBNETS_RANGE}    30.0.0.0/24    40.0.0.0/24
 
 *** Test Cases ***
 Create Networks
@@ -27,128 +28,73 @@ Create Networks
 
 Create Subnets For network_1
     [Documentation]    Create Sub Nets for the Networks with neutron request.
-    Create SubNet    network_1    subnet_1    30.0.0.0/24
+    Create SubNet    network_1    subnet_1    @{SUBNETS_RANGE}[0]
 
 Create Subnets For network_2
     [Documentation]    Create Sub Nets for the Networks with neutron request.
-    Create SubNet    network_2    subnet_2    40.0.0.0/24
+    Create SubNet    network_2    subnet_2    @{SUBNETS_RANGE}[1]
 
 Create Vm Instances For network_1
     [Documentation]    Create Four Vm instances using flavor and image names for a network.
-    ${net_id}=    Get Net Id    network_1
-    Create Vm Instances    ${net_id}    ${NET_1_VM_INSTANCES}
-    View Vm Console    ${NET_1_VM_INSTANCES}
+    Create Vm Instances    network_1    ${NET_1_VM_INSTANCES}
+    [Teardown]    Show Debugs      ${NET_1_VM_INSTANCES}
 
 Create Vm Instances For network_2
     [Documentation]    Create Four Vm instances using flavor and image names for a network.
-    ${net_id}=    Get Net Id    network_2
-    Set Suite Variable    ${net_id}
-    Create Vm Instances    ${net_id}    ${NET_2_VM_INSTANCES}
-    View Vm Console    ${NET_2_VM_INSTANCES}
+    Create Vm Instances    network_2    ${NET_2_VM_INSTANCES}
+    [Teardown]    Show Debugs      ${NET_2_VM_INSTANCES}
 
 List Networks With Namespaces
     ${output}=    Write Commands Until Prompt    sudo ip netns list
     Log    ${output}
 
-Show Details of Created Vm Instance In network_1
-    [Documentation]    View Details of the created vm instances using nova show.
-    : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
-    \    ${output}=    Write Commands Until Prompt    nova show ${VmElement}
-    \    Log    ${output}
-
-Ping All Vm Instances In network_1
+Ping Vm Instance1 In network_1
     [Documentation]    Check reachability of vm instances by pinging to them.
-    ${net_id}=    Get Net Id    network_1
-    : FOR    ${VmIpElement}    IN    @{NET_1_VM_IPS}
-    \    ${output}    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
-    \    Should Contain    ${output}    64 bytes
+    Ping Vm From DHCP Namespace    network_1    @{NET_1_VM_IPS}[0]
 
-Show Details of Created Vm Instance In network_2
-    [Documentation]    View Details of the created vm instances using nova show.
-    : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
-    \    ${output}=    Write Commands Until Prompt    nova show ${VmElement}
-    \    Log    ${output}
-
-Ping All Vm Instances In network_2
+Ping Vm Instance2 In network_1
     [Documentation]    Check reachability of vm instances by pinging to them.
-    ${net_id}=    Get Net Id    network_2
-    : FOR    ${VmIpElement}    IN    @{NET_2_VM_IPS}
-    \    ${output}    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
-    \    Should Contain    ${output}    64 bytes
-
-Add Key-Pair For Vm Instance
-    [Documentation]    Creates key pair to ssh to the vm instance.
-    ${output}=    Write Commands Until Prompt    nova keypair-add test > test.pem
-    Log    ${output}
-    ${output}=    Write Commands Until Prompt    chmod 600 test.pem
-    Log    ${output}
-
-List The Availalbe Key Pair List
-    [Documentation]    Check the existing key pairs available.
-    ${output}=    Write Commands Until Prompt    nova keypair-list
-    Log    ${output}
-
-Login to Vm Instances In network_1 Using Ssh
-    [Documentation]    Logging to the vm instance using generated key pair.
-    ${net_id}=    Get Net Id    network_1
-    Ssh Vm Instance    ${net_id}    30.0.0.3
-
-Ping Vm Instance From Instance In network_1
-    [Documentation]    Check reachability of vm instances by pinging.
-    ${output}=    Ping From Instance    30.0.0.4
-    Should Contain    ${output}    64 bytes
+    Ping Vm From DHCP Namespace    network_1    @{NET_1_VM_IPS}[1]
 
-Ping Dhcp Server From Instance In network_1
-    [Documentation]    ping the dhcp server from instance.
-    ${output}=    Ping From Instance    30.0.0.2
-    Should Contain    ${output}    64 bytes
-
-Ping Metadata Server From Instance In network_1
-    [Documentation]    ping the metadata server from instance.
-    Curl Metadata Server
-
-Close Vm Instance In network_1
-    [Documentation]    Close the connection with Vm Instance in a network.
-    Close Vm Instance
-
-Login to Vm Instances In network_2 Using Ssh
-    [Documentation]    Logging to the vm instance using generated key pair.
-    ${net_id}=    Get Net Id    network_2
-    Ssh Vm Instance    ${net_id}    40.0.0.3
-
-Ping Vm Instance From Instance In network_2
-    [Documentation]    Check reachability of vm instances by pinging.
-    ${output}=    Ping From Instance    40.0.0.4
-    Should Contain    ${output}    64 bytes
-
-Ping Dhcp Server From Instance In network_2
-    [Documentation]    ping the dhcp server from instance.
-    ${output}=    Ping From Instance    40.0.0.2
-    Should Contain    ${output}    64 bytes
-
-Ping Metadata Server From Instance In network_2
-    [Documentation]    ping the metadata server from instance.
-    Curl Metadata Server
+Ping Vm Instance1 In network_2
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace    network_2    @{NET_2_VM_IPS}[0]
 
-Close Vm Instance In network_2
-    [Documentation]    Close the connection with Vm Instance in a network.
-    Close Vm Instance
+Ping Vm Instance2 In network_2
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace    network_2    @{NET_2_VM_IPS}[1]
+
+Connectivity Tests From Vm Instance1 In network_1
+    [Documentation]    Logging to the vm instance1
+    ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[1]    @{DHCP_IPS}[0]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      network_1     @{NET_1_VM_IPS}[0]    ${dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In network_1
+    [Documentation]    Logging to the vm instance2
+    ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      network_1     @{NET_1_VM_IPS}[1]    ${dst_ip_list}
+
+Connectivity Tests From Vm Instance1 In network_2
+    [Documentation]    Logging to the vm instance1
+    ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[1]    @{DHCP_IPS}[1]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      network_2     @{NET_2_VM_IPS}[0]    ${dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In network_2
+    [Documentation]    Logging to the vm instance2
+    ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      network_2     @{NET_2_VM_IPS}[1]    ${dst_ip_list}
 
 Delete Vm Instance
     [Documentation]    Delete Vm instances using instance names.
     Delete Vm Instance    MyFirstInstance_1
 
-Ping All Vm Instances
-    [Documentation]    Check reachability of vm instances by pinging to them.
-    ${net_id}=    Get Net Id    network_1
-    : FOR    ${VmIpElement}    IN    @{VM_IPS_NOT_DELETED}
-    \    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
-    \    Should Contain    ${output}    64 bytes
-
 No Ping For Deleted Vm
     [Documentation]    Check non reachability of deleted vm instances by pinging to them.
-    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    30.0.0.3
-    Should Contain    ${output}    Destination Host Unreachable
+    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    @{NET_1_VM_IPS}[0]
 
 Delete Vm Instances In network_1
     [Documentation]    Delete Vm instances using instance names in network_1.