Tidied new and updated suites
[integration/test.git] / csit / suites / ovsdb / Devstack_Tempest_Tests / 02__additional_flows_verification_tests.robot
1 *** Settings ***
2 Documentation     Test suite to verify packet flows between vm instances.
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}    network_1    network_2
13 @{SUBNETS_NAME}    subnet_1    subnet_2
14 @{NET_1_VM_INSTANCES}    MyFirstInstance_1    MySecondInstance_1
15 @{NET_2_VM_INSTANCES}    MyFirstInstance_2    MySecondInstance_2
16 @{NET_1_VM_IPS}    30.0.0.3    30.0.0.4
17 @{NET_2_VM_IPS}    40.0.0.3    40.0.0.4
18 @{VM_IPS_NOT_DELETED}    30.0.0.4
19 @{GATEWAY_IPS}    30.0.0.1    40.0.0.1
20 @{DHCP_IPS}       30.0.0.2    40.0.0.2
21
22 *** Test Cases ***
23 Create Networks
24     [Documentation]    Create Network with neutron request.
25     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
26     \    Create Network    ${NetworkElement}
27
28 Create Subnets For network_1
29     [Documentation]    Create Sub Nets for the Networks with neutron request.
30     Create SubNet    network_1    subnet_1    30.0.0.0/24
31
32 Create Subnets For network_2
33     [Documentation]    Create Sub Nets for the Networks with neutron request.
34     Create SubNet    network_2    subnet_2    40.0.0.0/24
35
36 Create Vm Instances For network_1
37     [Documentation]    Create Four Vm instances using flavor and image names for a network.
38     ${net_id}=    Get Net Id    network_1
39     Create Vm Instances    ${net_id}    ${NET_1_VM_INSTANCES}
40     View Vm Console    ${NET_1_VM_INSTANCES}
41
42 Create Vm Instances For network_2
43     [Documentation]    Create Four Vm instances using flavor and image names for a network.
44     ${net_id}=    Get Net Id    network_2
45     Set Suite Variable    ${net_id}
46     Create Vm Instances    ${net_id}    ${NET_2_VM_INSTANCES}
47     View Vm Console    ${NET_2_VM_INSTANCES}
48
49 List Networks With Namespaces
50     ${output}=    Write Commands Until Prompt    sudo ip netns list
51     Log    ${output}
52
53 Show Details of Created Vm Instance In network_1
54     [Documentation]    View Details of the created vm instances using nova show.
55     : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
56     \    ${output}=    Write Commands Until Prompt    nova show ${VmElement}
57     \    Log    ${output}
58
59 Ping All Vm Instances In network_1
60     [Documentation]    Check reachability of vm instances by pinging to them.
61     ${net_id}=    Get Net Id    network_1
62     : FOR    ${VmIpElement}    IN    @{NET_1_VM_IPS}
63     \    ${output}    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
64     \    Should Contain    ${output}    64 bytes
65
66 Show Details of Created Vm Instance In network_2
67     [Documentation]    View Details of the created vm instances using nova show.
68     : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
69     \    ${output}=    Write Commands Until Prompt    nova show ${VmElement}
70     \    Log    ${output}
71
72 Ping All Vm Instances In network_2
73     [Documentation]    Check reachability of vm instances by pinging to them.
74     ${net_id}=    Get Net Id    network_2
75     : FOR    ${VmIpElement}    IN    @{NET_2_VM_IPS}
76     \    ${output}    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
77     \    Should Contain    ${output}    64 bytes
78
79 Add Key-Pair For Vm Instance
80     [Documentation]    Creates key pair to ssh to the vm instance.
81     ${output}=    Write Commands Until Prompt    nova keypair-add test > test.pem
82     Log    ${output}
83     ${output}=    Write Commands Until Prompt    chmod 600 test.pem
84     Log    ${output}
85
86 List The Availalbe Key Pair List
87     [Documentation]    Check the existing key pairs available.
88     ${output}=    Write Commands Until Prompt    nova keypair-list
89     Log    ${output}
90
91 Login to Vm Instances In network_1 Using Ssh
92     [Documentation]    Logging to the vm instance using generated key pair.
93     ${net_id}=    Get Net Id    network_1
94     Ssh Vm Instance    ${net_id}    30.0.0.3
95
96 Ping Vm Instance From Instance In network_1
97     [Documentation]    Check reachability of vm instances by pinging.
98     ${output}=    Ping From Instance    30.0.0.4
99     Should Contain    ${output}    64 bytes
100
101 Ping Dhcp Server From Instance In network_1
102     [Documentation]    ping the dhcp server from instance.
103     ${output}=    Ping From Instance    30.0.0.2
104     Should Contain    ${output}    64 bytes
105
106 Ping Metadata Server From Instance In network_1
107     [Documentation]    ping the metadata server from instance.
108     Curl Metadata Server
109
110 Close Vm Instance In network_1
111     [Documentation]    Close the connection with Vm Instance in a network.
112     Close Vm Instance
113
114 Login to Vm Instances In network_2 Using Ssh
115     [Documentation]    Logging to the vm instance using generated key pair.
116     ${net_id}=    Get Net Id    network_2
117     Ssh Vm Instance    ${net_id}    40.0.0.3
118
119 Ping Vm Instance From Instance In network_2
120     [Documentation]    Check reachability of vm instances by pinging.
121     ${output}=    Ping From Instance    40.0.0.4
122     Should Contain    ${output}    64 bytes
123
124 Ping Dhcp Server From Instance In network_2
125     [Documentation]    ping the dhcp server from instance.
126     ${output}=    Ping From Instance    40.0.0.2
127     Should Contain    ${output}    64 bytes
128
129 Ping Metadata Server From Instance In network_2
130     [Documentation]    ping the metadata server from instance.
131     Curl Metadata Server
132
133 Close Vm Instance In network_2
134     [Documentation]    Close the connection with Vm Instance in a network.
135     Close Vm Instance
136
137 Delete Vm Instance
138     [Documentation]    Delete Vm instances using instance names.
139     Delete Vm Instance    MyFirstInstance_1
140
141 Ping All Vm Instances
142     [Documentation]    Check reachability of vm instances by pinging to them.
143     ${net_id}=    Get Net Id    network_1
144     : FOR    ${VmIpElement}    IN    @{VM_IPS_NOT_DELETED}
145     \    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
146     \    Should Contain    ${output}    64 bytes
147
148 No Ping For Deleted Vm
149     [Documentation]    Check non reachability of deleted vm instances by pinging to them.
150     ${output}=    Ping Vm From DHCP Namespace    ${net_id}    30.0.0.3
151     Should Contain    ${output}    Destination Host Unreachable
152
153 Delete Vm Instances In network_1
154     [Documentation]    Delete Vm instances using instance names in network_1.
155     : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
156     \    Delete Vm Instance    ${VmElement}
157
158 Delete Vm Instances In network_2
159     [Documentation]    Delete Vm instances using instance names in network_2.
160     : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
161     \    Delete Vm Instance    ${VmElement}
162
163 Delete Sub Networks In network_1
164     [Documentation]    Delete Sub Nets for the Networks with neutron request.
165     Delete SubNet    subnet_1
166
167 Delete Sub Networks In network_2
168     [Documentation]    Delete Sub Nets for the Networks with neutron request.
169     Delete SubNet    subnet_2
170
171 Delete Networks
172     [Documentation]    Delete Networks with neutron request.
173     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
174     \    Delete Network    ${NetworkElement}