3node Tests for the Openstack Integration
[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 For net1_network
46     [Documentation]    Create Sub Nets for the Networks with neutron request.
47     Create SubNet    net1_network    subnet1    10.0.0.0/24
48
49 Create Subnets For net2_network
50     [Documentation]    Create Sub Nets for the Networks with neutron request.
51     Create SubNet    net2_network    subnet2    20.0.0.0/24
52
53 List Ports
54     ${output}=    Write Commands Until Prompt    neutron -v port-list
55     Log    ${output}
56
57 List Available Networks
58     ${output}=    Write Commands Until Prompt    neutron -v net-list
59     Log    ${output}
60
61 List Tenants
62     ${output}=    Write Commands Until Prompt    keystone tenant-list
63     Log    ${output}
64
65 List Nova
66     ${output}=    Write Commands Until Prompt    nova list
67     Log    ${output}
68
69 List Nova Images
70     ${output}=    Write Commands Until Prompt    nova image-list
71     Log    ${output}
72
73 List Nova Flavor
74     ${output}=    Write Commands Until Prompt    nova flavor-list
75     Log    ${output}
76
77 Create Vm Instances For net1_network
78     [Documentation]    Create Vm instances using flavor and image names.
79     ${net_id}=    Get Net Id    net1_network
80     Create Vm Instances    ${net_id}    ${VM_INSTANCES_NAME}
81
82 Create Vm Instances For net2_network
83     [Documentation]    Create Vm instances using flavor and image names.
84     ${net_id}=    Get Net Id    net2_network
85     Create Vm Instances    ${net_id}    ${VM_INSTANCES_NAME}
86
87 Show Details of Created Vm Instance
88     [Documentation]    View Details of the created vm instances using nova show.
89     : FOR    ${VmElement}    IN    @{VM_INSTANCES_NAME}
90     \    ${output}=    Write Commands Until Prompt    nova show ${VmElement}
91     \    Log    ${output}
92
93 Verify Created Vm Instance In Dump Flow
94     [Documentation]    Verify the existence of the created vm instance ips in the dump flow.
95     ${output}=    Write Commands Until Prompt    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
96     Log    ${output}
97     : FOR    ${VmIpElement}    IN    @{VM_IPS}
98     \    Should Contain    ${output}    ${VmIpElement}
99
100 Create Routers
101     [Documentation]    Create Router and Add Interface to the subnets.
102     Create Router    router_1
103
104 Verify Gateway Ip After Interface Added
105     [Documentation]    Verify the existence of the gateway ips with the dump flow in Beryllium.
106     Run Keyword If    "${ODL_VERSION}" == "lithium-latest"    Run Keyword And Ignore Error    Verify Gateway Ips
107     ...    ELSE IF    "${ODL_VERSION}" != "lithium-latest"    Verify Gateway Ips
108
109 Verify Dhcp Flow Entries
110     [Documentation]    Verify Created SubNets for the Networks with the dump flow in Beryllium.
111     Run Keyword If    "${ODL_VERSION}" == "lithium-latest"    Run Keyword And Ignore Error    Verify Dhcp Ips
112     ...    ELSE IF    "${ODL_VERSION}" != "lithium-latest"    Verify Dhcp Ips
113
114 Delete Vm Instances
115     [Documentation]    Delete Vm instances using instance names.
116     : FOR    ${VmElement}    IN    @{VM_INSTANCES_NAME}
117     \    Delete Vm Instance    ${VmElement}
118
119 Verify Deleted Vm Instance Removed In Dump Flow
120     [Documentation]    Verify the non-existence of the vm instance ips in the dump flow.
121     : FOR    ${VmIpElement}    IN    @{VM_IPS}
122     \    ${output}=    Write Commands Until Prompt    sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
123     \    Log    ${output}
124     \    Should Not Contain    ${output}    ${VmIpElement}
125
126 Delete Router Interfaces
127     [Documentation]    Remove Interface to the subnets.
128     Remove Interface    router_1
129
130 Delete Routers
131     [Documentation]    Delete Router and Interface to the subnets.
132     Delete Router    router_1
133
134 Verify Deleted Routers
135     [Documentation]    Verify Deleted Routers for the Networks with dump flow.
136     Verify No Gateway Ips
137
138 Delete Sub Networks In net1_network
139     [Documentation]    Delete Sub Nets for the Networks with neutron request.
140     Delete SubNet    subnet1
141
142 Delete Sub Networks In net2_network
143     [Documentation]    Delete Sub Nets for the Networks with neutron request.
144     Delete SubNet    subnet2
145
146 Delete Networks
147     [Documentation]    Delete Networks with neutron request.
148     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
149     \    Delete Network    ${NetworkElement}
150
151 Verify Deleted Subnets
152     [Documentation]    Verify Deleted SubNets for the Networks with dump flow.
153     Verify No Dhcp Ips