Tidied new and updated suites
[integration/test.git] / csit / suites / ovsdb / Devstack_Tempest_Tests / 01__single_node_devstack_tempest_tests.robot
1 *** Settings ***
2 Documentation     Test suite to deploy devstack with networking-odl
3 Suite Setup       Devstack Suite Setup
4 Library           SSHLibrary
5 Library           OperatingSystem
6 Library           RequestsLibrary
7 Resource          ../../../libraries/Utils.robot
8 Resource          ../../../libraries/OpenStackOperations.robot
9 Resource          ../../../libraries/DevstackUtils.robot
10
11 *** Variables ***
12 @{NETWORKS_NAME}    net1_network    net2_network
13 @{SUBNETS_NAME}    subnet1    subnet2
14 @{NET_1_VM_INSTANCES}    MyFirstInstance_1    MySecondInstance_1
15 @{NET_2_VM_INSTANCES}    MyFirstInstance_2    MySecondInstance_2
16 @{VM_IPS}         10.0.0.3    20.0.0.3
17 @{GATEWAY_IPS}    10.0.0.1    20.0.0.1
18 @{DHCP_IPS}       10.0.0.2    20.0.0.2
19 @{SUBNETS_RANGE}    10.0.0.0/24    20.0.0.0/24
20
21 *** Test Cases ***
22 Run Devstack Gate Wrapper
23     Write Commands Until Prompt    unset GIT_BASE
24     Write Commands Until Prompt    env
25     ${output}=    Write Commands Until Prompt    ./devstack-gate/devstack-vm-gate-wrap.sh    timeout=3600s    #60min
26     Log    ${output}
27     Should Not Contain    ${output}    ERROR: the main setup script run by this job failed
28     # workaround for https://bugs.launchpad.net/networking-odl/+bug/1512418
29     Write Commands Until Prompt    cd /opt/stack/new/tempest-lib
30     Write Commands Until Prompt    sudo python setup.py install
31     [Teardown]    Show Devstack Debugs
32
33 Validate Neutron and Networking-ODL Versions
34     ${output}=    Write Commands Until Prompt    cd /opt/stack/new/neutron; git branch;
35     Should Contain    ${output}    * ${OPENSTACK_BRANCH}
36     ${output}=    Write Commands Until Prompt    cd /opt/stack/new/networking-odl; git branch;
37     Should Contain    ${output}    * ${NETWORKING-ODL_BRANCH}
38
39 tempest.api.network
40     Run Tempest Tests    ${TEST_NAME}
41
42 Create Networks
43     [Documentation]    Create Network with neutron request.
44     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
45     \    Create Network    ${NetworkElement}
46
47 Create Subnets For net1_network
48     [Documentation]    Create Sub Nets for the Networks with neutron request.
49     Create SubNet    net1_network    subnet1    @{SUBNETS_RANGE}[0]
50
51 Create Subnets For net2_network
52     [Documentation]    Create Sub Nets for the Networks with neutron request.
53     Create SubNet    net2_network    subnet2    @{SUBNETS_RANGE}[1]
54
55 List Ports
56     ${output}=    Write Commands Until Prompt    neutron -v port-list
57     Log    ${output}
58
59 List Available Networks
60     ${output}=    Write Commands Until Prompt    neutron -v net-list
61     Log    ${output}
62
63 List Tenants
64     ${output}=    Write Commands Until Prompt    keystone tenant-list
65     Log    ${output}
66
67 List Nova
68     ${output}=    Write Commands Until Prompt    nova list
69     Log    ${output}
70
71 List Nova Images
72     ${output}=    Write Commands Until Prompt    nova image-list
73     Log    ${output}
74
75 List Nova Flavor
76     ${output}=    Write Commands Until Prompt    nova flavor-list
77     Log    ${output}
78
79 Create Vm Instances For net1_network
80     [Documentation]    Create Vm instances using flavor and image names.
81     Create Vm Instances    net1_network    ${NET_1_VM_INSTANCES}
82     [Teardown]    Show Debugs    ${NET_1_VM_INSTANCES}
83
84 Create Vm Instances For net2_network
85     [Documentation]    Create Vm instances using flavor and image names.
86     Create Vm Instances    net2_network    ${NET_2_VM_INSTANCES}
87     [Teardown]    Show Debugs    ${NET_2_VM_INSTANCES}
88
89 Verify Created Vm Instance In Dump Flow
90     [Documentation]    Verify the existence of the created vm instance ips in the dump flow.
91     ${output}=    Write Commands Until Prompt    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
92     Log    ${output}
93     : FOR    ${VmIpElement}    IN    @{VM_IPS}
94     \    Should Contain    ${output}    ${VmIpElement}
95
96 Create Routers
97     [Documentation]    Create Router and Add Interface to the subnets.
98     Create Router    router_1
99
100 Verify Gateway Ip After Interface Added
101     [Documentation]    Verify the existence of the gateway ips with the dump flow in Beryllium.
102     Run Keyword If    "${ODL_VERSION}" == "lithium-latest"    Run Keyword And Ignore Error    Verify Gateway Ips
103     ...    ELSE IF    "${ODL_VERSION}" != "lithium-latest"    Verify Gateway Ips
104
105 Verify Dhcp Flow Entries
106     [Documentation]    Verify Created SubNets for the Networks with the dump flow in Beryllium.
107     Run Keyword If    "${ODL_VERSION}" == "lithium-latest"    Run Keyword And Ignore Error    Verify Dhcp Ips
108     ...    ELSE IF    "${ODL_VERSION}" != "lithium-latest"    Verify Dhcp Ips
109
110 Delete Vm Instances In net1_network
111     [Documentation]    Delete Vm instances using instance names in net1_network.
112     : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
113     \    Delete Vm Instance    ${VmElement}
114
115 Delete Vm Instances In net2_network
116     [Documentation]    Delete Vm instances using instance names in net2_network.
117     : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
118     \    Delete Vm Instance    ${VmElement}
119
120 Verify Deleted Vm Instance Removed In Dump Flow
121     [Documentation]    Verify the non-existence of the vm instance ips in the dump flow.
122     : FOR    ${VmIpElement}    IN    @{VM_IPS}
123     \    ${output}=    Write Commands Until Prompt    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
124     \    Log    ${output}
125     \    Should Not Contain    ${output}    ${VmIpElement}
126
127 Delete Router Interfaces
128     [Documentation]    Remove Interface to the subnets.
129     : FOR    ${interface}    IN    @{SUBNETS_NAME}
130     \    Remove Interface    router_1    ${interface}
131
132 Delete Routers
133     [Documentation]    Delete Router and Interface to the subnets.
134     Delete Router    router_1
135
136 Verify Deleted Routers
137     [Documentation]    Verify Deleted Routers for the Networks with dump flow.
138     Verify No Gateway Ips
139
140 Delete Sub Networks In net1_network
141     [Documentation]    Delete Sub Nets for the Networks with neutron request.
142     Delete SubNet    subnet1
143
144 Delete Sub Networks In net2_network
145     [Documentation]    Delete Sub Nets for the Networks with neutron request.
146     Delete SubNet    subnet2
147
148 Delete Networks
149     [Documentation]    Delete Networks with neutron request.
150     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
151     \    Delete Network    ${NetworkElement}
152
153 Verify Deleted Subnets
154     [Documentation]    Verify Deleted SubNets for the Networks with dump flow.
155     Verify No Dhcp Ips