Enable tempest tests for netvirt 43/39343/2
authorSam Hague <shague@redhat.com>
Tue, 24 May 2016 12:41:38 +0000 (08:41 -0400)
committerJamo Luhrsen <jluhrsen@redhat.com>
Wed, 25 May 2016 16:25:47 +0000 (16:25 +0000)
Change-Id: I20a624a2dae1d0d38c1e68e42ef1ec1dc9943af0
Signed-off-by: Sam Hague <shague@redhat.com>
csit/suites/netvirt/Devstack_Tempest_Tests/01__single_node_devstack_tempest_tests.robot [new file with mode: 0644]
csit/suites/netvirt/Devstack_Tempest_Tests/02__additional_flows_verification_tests.robot [new file with mode: 0644]
csit/testplans/netvirt-tempest.txt [new file with mode: 0644]

diff --git a/csit/suites/netvirt/Devstack_Tempest_Tests/01__single_node_devstack_tempest_tests.robot b/csit/suites/netvirt/Devstack_Tempest_Tests/01__single_node_devstack_tempest_tests.robot
new file mode 100644 (file)
index 0000000..a4229f7
--- /dev/null
@@ -0,0 +1,155 @@
+*** Settings ***
+Documentation     Test suite to deploy devstack with networking-odl
+Suite Setup       Devstack Suite Setup
+Library           SSHLibrary
+Library           OperatingSystem
+Library           RequestsLibrary
+Resource          ../../../libraries/Utils.robot
+Resource          ../../../libraries/OpenStackOperations.robot
+Resource          ../../../libraries/DevstackUtils.robot
+
+*** Variables ***
+@{NETWORKS_NAME}    net1_network    net2_network
+@{SUBNETS_NAME}    subnet1    subnet2
+@{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
+    Write Commands Until Prompt    unset GIT_BASE
+    Write Commands Until Prompt    env
+    ${output}=    Write Commands Until Prompt    ./devstack-gate/devstack-vm-gate-wrap.sh    timeout=3600s    #60min
+    Log    ${output}
+    Should Not Contain    ${output}    ERROR: the main setup script run by this job failed
+    # workaround for https://bugs.launchpad.net/networking-odl/+bug/1512418
+    Write Commands Until Prompt    cd /opt/stack/new/tempest-lib
+    Write Commands Until Prompt    sudo python setup.py install
+    [Teardown]    Show Devstack Debugs
+
+Validate Neutron and Networking-ODL Versions
+    ${output}=    Write Commands Until Prompt    cd /opt/stack/new/neutron; git branch;
+    Should Contain    ${output}    * ${OPENSTACK_BRANCH}
+    ${output}=    Write Commands Until Prompt    cd /opt/stack/new/networking-odl; git branch;
+    Should Contain    ${output}    * ${NETWORKING-ODL_BRANCH}
+
+tempest.api.network
+    Run Tempest Tests    ${TEST_NAME}
+
+Create Networks
+    [Documentation]    Create Network with neutron request.
+    : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
+    \    Create Network    ${NetworkElement}
+
+Create Subnets For net1_network
+    [Documentation]    Create Sub Nets for the Networks with neutron request.
+    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    @{SUBNETS_RANGE}[1]
+
+List Ports
+    ${output}=    Write Commands Until Prompt    neutron -v port-list
+    Log    ${output}
+
+List Available Networks
+    ${output}=    Write Commands Until Prompt    neutron -v net-list
+    Log    ${output}
+
+List Tenants
+    ${output}=    Write Commands Until Prompt    keystone tenant-list
+    Log    ${output}
+
+List Nova
+    ${output}=    Write Commands Until Prompt    nova list
+    Log    ${output}
+
+List Nova Images
+    ${output}=    Write Commands Until Prompt    nova image-list
+    Log    ${output}
+
+List Nova Flavor
+    ${output}=    Write Commands Until Prompt    nova flavor-list
+    Log    ${output}
+
+Create Vm Instances For net1_network
+    [Documentation]    Create Vm instances using flavor and image names.
+    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.
+    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.
+    ${output}=    Write Commands Until Prompt    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
+    Log    ${output}
+    : FOR    ${VmIpElement}    IN    @{VM_IPS}
+    \    Should Contain    ${output}    ${VmIpElement}
+
+Create Routers
+    [Documentation]    Create Router and Add Interface to the subnets.
+    Create Router    router_1
+
+Verify Gateway Ip After Interface Added
+    [Documentation]    Verify the existence of the gateway ips with the dump flow in Beryllium.
+    Run Keyword If    "${ODL_VERSION}" == "lithium-latest"    Run Keyword And Ignore Error    Verify Gateway Ips
+    ...    ELSE IF    "${ODL_VERSION}" != "lithium-latest"    Verify Gateway Ips
+
+Verify Dhcp Flow Entries
+    [Documentation]    Verify Created SubNets for the Networks with the dump flow in Beryllium.
+    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 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
+    [Documentation]    Verify the non-existence of the vm instance ips in the dump flow.
+    : FOR    ${VmIpElement}    IN    @{VM_IPS}
+    \    ${output}=    Write Commands Until Prompt    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
+    \    Log    ${output}
+    \    Should Not Contain    ${output}    ${VmIpElement}
+
+Delete Router Interfaces
+    [Documentation]    Remove Interface to the subnets.
+    : FOR     ${interface}    IN     @{SUBNETS_NAME}
+    \     Remove Interface     router_1     ${interface}
+
+Delete Routers
+    [Documentation]    Delete Router and Interface to the subnets.
+    Delete Router    router_1
+
+Verify Deleted Routers
+    [Documentation]    Verify Deleted Routers for the Networks with dump flow.
+    Verify No Gateway Ips
+
+Delete Sub Networks In net1_network
+    [Documentation]    Delete Sub Nets for the Networks with neutron request.
+    Delete SubNet    subnet1
+
+Delete Sub Networks In net2_network
+    [Documentation]    Delete Sub Nets for the Networks with neutron request.
+    Delete SubNet    subnet2
+
+Delete Networks
+    [Documentation]    Delete Networks with neutron request.
+    : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
+    \    Delete Network    ${NetworkElement}
+
+Verify Deleted Subnets
+    [Documentation]    Verify Deleted SubNets for the Networks with dump flow.
+    Verify No Dhcp Ips
diff --git a/csit/suites/netvirt/Devstack_Tempest_Tests/02__additional_flows_verification_tests.robot b/csit/suites/netvirt/Devstack_Tempest_Tests/02__additional_flows_verification_tests.robot
new file mode 100644 (file)
index 0000000..05ab624
--- /dev/null
@@ -0,0 +1,120 @@
+*** Settings ***
+Documentation     Test suite to verify packet flows between vm instances.
+Suite Setup       Devstack Suite Setup
+Library           SSHLibrary
+Library           OperatingSystem
+Library           RequestsLibrary
+Resource          ../../../libraries/Utils.robot
+Resource          ../../../libraries/OpenStackOperations.robot
+Resource          ../../../libraries/DevstackUtils.robot
+
+*** Variables ***
+@{NETWORKS_NAME}    network_1    network_2
+@{SUBNETS_NAME}    subnet_1    subnet_2
+@{NET_1_VM_INSTANCES}    MyFirstInstance_1    MySecondInstance_1
+@{NET_2_VM_INSTANCES}    MyFirstInstance_2    MySecondInstance_2
+@{NET_1_VM_IPS}    30.0.0.3    30.0.0.4
+@{NET_2_VM_IPS}    40.0.0.3    40.0.0.4
+@{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
+    [Documentation]    Create Network with neutron request.
+    : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
+    \    Create Network    ${NetworkElement}
+
+Create Subnets For network_1
+    [Documentation]    Create Sub Nets for the Networks with neutron request.
+    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    @{SUBNETS_RANGE}[1]
+
+Create Vm Instances For network_1
+    [Documentation]    Create Four Vm instances using flavor and image names for a network.
+    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.
+    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}
+
+Ping Vm Instance1 In network_1
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace    network_1    @{NET_1_VM_IPS}[0]
+
+Ping Vm Instance2 In network_1
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace    network_1    @{NET_1_VM_IPS}[1]
+
+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]
+
+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
+
+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]
+
+Delete Vm Instances In network_1
+    [Documentation]    Delete Vm instances using instance names in network_1.
+    : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
+    \    Delete Vm Instance    ${VmElement}
+
+Delete Vm Instances In network_2
+    [Documentation]    Delete Vm instances using instance names in network_2.
+    : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
+    \    Delete Vm Instance    ${VmElement}
+
+Delete Sub Networks In network_1
+    [Documentation]    Delete Sub Nets for the Networks with neutron request.
+    Delete SubNet    subnet_1
+
+Delete Sub Networks In network_2
+    [Documentation]    Delete Sub Nets for the Networks with neutron request.
+    Delete SubNet    subnet_2
+
+Delete Networks
+    [Documentation]    Delete Networks with neutron request.
+    : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
+    \    Delete Network    ${NetworkElement}
diff --git a/csit/testplans/netvirt-tempest.txt b/csit/testplans/netvirt-tempest.txt
new file mode 100644 (file)
index 0000000..3d48765
--- /dev/null
@@ -0,0 +1,2 @@
+# Place the suites in run order:
+integration/test/csit/suites/netvirt/Devstack_Tempest_Tests