4cc9dd23fbb0944b353fe1e1950fcf9bdf3cde78
[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 @{VM_INSTANCES_NAME}    MyFirstInstance    MySecondInstance
15 @{VM_IPS}         10.0.0.3    20.0.0.3
16 @{GATEWAY_IPS}    10.0.0.1    20.0.0.1
17 @{DHCP_IPS}       10.0.0.2    20.0.0.2
18
19 *** Test Cases ***
20 Run Devstack Gate Wrapper
21     Write Commands Until Prompt    unset GIT_BASE
22     Write Commands Until Prompt    env
23     ${output}=    Write Commands Until Prompt    ./devstack-gate/devstack-vm-gate-wrap.sh    timeout=3600s    #60min
24     Log    ${output}
25     Should Not Contain    ${output}    ERROR: the main setup script run by this job failed
26     # workaround for https://bugs.launchpad.net/networking-odl/+bug/1512418
27     Write Commands Until Prompt    cd /opt/stack/new/tempest-lib
28     Write Commands Until Prompt    sudo python setup.py install
29     [Teardown]    Show Devstack Debugs
30
31 Validate Neutron and Networking-ODL Versions
32     ${output}=    Write Commands Until Prompt    cd /opt/stack/new/neutron; git branch;
33     Should Contain    ${output}    * ${OPENSTACK_BRANCH}
34     ${output}=    Write Commands Until Prompt    cd /opt/stack/new/networking-odl; git branch;
35     Should Contain    ${output}    * ${NETWORKING-ODL_BRANCH}
36
37 tempest.api.network
38     Run Tempest Tests    ${TEST_NAME}
39
40 Create Networks
41     [Documentation]    Create Network with neutron request.
42     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
43     \    Create Network    ${NetworkElement}
44
45 Create Subnets
46     [Documentation]    Create Sub Nets for the Networks with neutron request.
47     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
48     \    Create SubNet    ${NetworkElement}
49
50 List Ports
51     ${output}=    Write Commands Until Prompt    neutron -v port-list
52     Log    ${output}
53
54 List Available Networks
55     ${output}=    Write Commands Until Prompt    neutron -v net-list
56     Log    ${output}
57
58 List Tenants
59     ${output}=    Write Commands Until Prompt    keystone tenant-list
60     Log    ${output}
61
62 List Nova
63     ${output}=    Write Commands Until Prompt    nova list
64     Log    ${output}
65
66 List Nova Images
67     ${output}=    Write Commands Until Prompt    nova image-list
68     Log    ${output}
69
70 List Nova Flavor
71     ${output}=    Write Commands Until Prompt    nova flavor-list
72     Log    ${output}
73
74 Create Vm Instances
75     [Documentation]    Create Vm instances using flavor and image names.
76     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
77     \    ${net_id}=    Get Net Id    ${NetworkElement}
78     \    Create Vm Instance    ${net_id}    ${NetworkElement}
79
80 Show Details of Created Vm Instance
81     [Documentation]    View Details of the created vm instances using nova show.
82     : FOR    ${VmElement}    IN    @{VM_INSTANCES_NAME}
83     \    ${output}=    Write Commands Until Prompt    nova show ${VmElement}
84     \    Log    ${output}
85
86 Verify Created Vm Instance In Dump Flow
87     [Documentation]    Verify the existence of the created vm instance ips in the dump flow.
88     ${output}=    Write Commands Until Prompt    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
89     Log    ${output}
90     : FOR    ${VmIpElement}    IN    @{VM_IPS}
91     \    Should Contain    ${output}    ${VmIpElement}
92
93 Create Routers
94     [Documentation]    Create Router and Add Interface to the subnets.
95     Create Router
96
97 Verify Gateway Ip After Interface Added
98     [Documentation]    Verify the existence of the gateway ips with the dump flow in Beryllium.
99     Run Keyword If    "${ODL_VERSION}" == "lithium-latest"    Run Keyword And Ignore Error    Verify Gateway Ips
100     ...    ELSE IF    "${ODL_VERSION}" != "lithium-latest"    Verify Gateway Ips
101
102 Verify Dhcp Flow Entries
103     [Documentation]    Verify Created SubNets for the Networks with the dump flow in Beryllium.
104     Run Keyword If    "${ODL_VERSION}" == "lithium-latest"    Run Keyword And Ignore Error    Verify Dhcp Ips
105     ...    ELSE IF    "${ODL_VERSION}" != "lithium-latest"    Verify Dhcp Ips
106
107 Delete Vm Instances
108     [Documentation]    Delete Vm instances using instance names.
109     : FOR    ${VmElement}    IN    @{VM_INSTANCES_NAME}
110     \    Delete Vm Instance    ${VmElement}
111
112 Verify Deleted Vm Instance Removed In Dump Flow
113     [Documentation]    Verify the non-existence of the vm instance ips in the dump flow.
114     : FOR    ${VmIpElement}    IN    @{VM_IPS}
115     \    ${output}=    Write Commands Until Prompt    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
116     \    Log    ${output}
117     \    Should Not Contain    ${output}    ${VmIpElement}
118
119 Delete Router Interfaces
120     [Documentation]    Remove Interface to the subnets.
121     Remove Interface
122
123 Delete Routers
124     [Documentation]    Delete Router and Interface to the subnets.
125     Delete Router
126
127 Verify Deleted Routers
128     [Documentation]    Verify Deleted Routers for the Networks with dump flow.
129     Verify No Gateway Ips
130
131 Delete Sub Networks
132     [Documentation]    Delete Sub Nets for the Networks with neutron request.
133     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
134     \    Delete SubNet    ${NetworkElement}
135
136 Delete Networks
137     [Documentation]    Delete Networks with neutron request.
138     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
139     \    Delete Network    ${NetworkElement}
140
141 Verify Deleted Subnets
142     [Documentation]    Verify Deleted SubNets for the Networks with dump flow.
143     Verify No Dhcp Ips