Updated the versions of TSDR tools to use the new versions
[integration/test.git] / csit / suites / openstack / connectivity / 01_l2_tests.robot
1 *** Settings ***
2 Documentation     Test suite to verify packet flows between vm instances.
3 Suite Setup       Devstack Suite Setup Tests
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}    devstack_path=/opt/stack/devstack
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     [Teardown]    Show Debugs      ${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     [Teardown]    Show Debugs      ${NET_2_VM_INSTANCES}
48
49 Ping All Vm Instances In network_1
50     [Documentation]    Check reachability of vm instances by pinging to them.
51     ${net_id}=    Get Net Id    network_1
52     : FOR    ${VmIpElement}    IN    @{NET_1_VM_IPS}
53     \    ${output}    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
54     \    Should Contain    ${output}    64 bytes
55
56 Ping All Vm Instances In network_2
57     [Documentation]    Check reachability of vm instances by pinging to them.
58     ${net_id}=    Get Net Id    network_2
59     : FOR    ${VmIpElement}    IN    @{NET_2_VM_IPS}
60     \    ${output}    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
61     \    Should Contain    ${output}    64 bytes
62
63 Login to Vm Instances In network_1 Using Ssh
64     [Documentation]    Logging to the vm instance using generated key pair.
65     ${net_id}=    Get Net Id    network_1
66     Ssh Vm Instance    ${net_id}    30.0.0.3
67
68 Ping Vm Instance From Instance In network_1
69     [Documentation]    Check reachability of vm instances by pinging.
70     ${output}=    Ping From Instance    30.0.0.4
71     Should Contain    ${output}    64 bytes
72
73 Ping Dhcp Server From Instance In network_1
74     [Documentation]    ping the dhcp server from instance.
75     ${output}=    Ping From Instance    30.0.0.2
76     Should Contain    ${output}    64 bytes
77
78 Ping Metadata Server From Instance In network_1
79     [Documentation]    ping the metadata server from instance.
80     Curl Metadata Server
81
82 Login to Vm Instances In network_2 Using Ssh
83     [Documentation]    Logging to the vm instance using generated key pair.
84     ${net_id}=    Get Net Id    network_2
85     Ssh Vm Instance    ${net_id}    40.0.0.3
86
87 Ping Vm Instance From Instance In network_2
88     [Documentation]    Check reachability of vm instances by pinging.
89     ${output}=    Ping From Instance    40.0.0.4
90     Should Contain    ${output}    64 bytes
91
92 Ping Dhcp Server From Instance In network_2
93     [Documentation]    ping the dhcp server from instance.
94     ${output}=    Ping From Instance    40.0.0.2
95     Should Contain    ${output}    64 bytes
96
97 Ping Metadata Server From Instance In network_2
98     [Documentation]    ping the metadata server from instance.
99     Curl Metadata Server
100
101 Delete Vm Instance
102     [Documentation]    Delete Vm instances using instance names.
103     Delete Vm Instance    MyFirstInstance_1
104
105 Ping All Vm Instances
106     [Documentation]    Check reachability of vm instances by pinging to them.
107     ${net_id}=    Get Net Id    network_1
108     : FOR    ${VmIpElement}    IN    @{VM_IPS_NOT_DELETED}
109     \    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
110     \    Should Contain    ${output}    64 bytes
111
112 No Ping For Deleted Vm
113     [Documentation]    Check non reachability of deleted vm instances by pinging to them.
114     ${output}=    Ping Vm From DHCP Namespace    ${net_id}    30.0.0.3
115     Should Contain    ${output}    Destination Host Unreachable
116
117 Delete Vm Instances In network_1
118     [Documentation]    Delete Vm instances using instance names in network_1.
119     : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
120     \    Delete Vm Instance    ${VmElement}
121
122 Delete Vm Instances In network_2
123     [Documentation]    Delete Vm instances using instance names in network_2.
124     : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
125     \    Delete Vm Instance    ${VmElement}
126
127 Delete Sub Networks In network_1
128     [Documentation]    Delete Sub Nets for the Networks with neutron request.
129     Delete SubNet    subnet_1
130
131 Delete Sub Networks In network_2
132     [Documentation]    Delete Sub Nets for the Networks with neutron request.
133     Delete SubNet    subnet_2
134
135 Delete Networks
136     [Documentation]    Delete Networks with neutron request.
137     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
138     \    Delete Network    ${NetworkElement}