Tidied new and updated suites
[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 Suite Teardown    Close All Connections
5 Library           SSHLibrary
6 Library           OperatingSystem
7 Library           RequestsLibrary
8 Resource          ../../../libraries/Utils.robot
9 Resource          ../../../libraries/OpenStackOperations.robot
10 Resource          ../../../libraries/DevstackUtils.robot
11
12 *** Variables ***
13 @{NETWORKS_NAME}    l2_network_1    l2_network_2
14 @{SUBNETS_NAME}    l2_subnet_1    l2_subnet_2
15 @{NET_1_VM_INSTANCES}    MyFirstInstance_1    MySecondInstance_1    MyThirdInstance_1
16 @{NET_2_VM_INSTANCES}    MyFirstInstance_2    MySecondInstance_2    MyThirdInstance_2
17 @{NET_1_VM_IPS}    30.0.0.3    30.0.0.4    30.0.0.5
18 @{NET_2_VM_IPS}    40.0.0.3    40.0.0.4    40.0.0.5
19 @{VM_IPS_NOT_DELETED}    30.0.0.4    30.0.0.5
20 @{GATEWAY_IPS}    30.0.0.1    40.0.0.1
21 @{DHCP_IPS}       30.0.0.2    40.0.0.2
22 @{SUBNETS_RANGE}    30.0.0.0/24    40.0.0.0/24
23
24 *** Test Cases ***
25 Create Networks
26     [Documentation]    Create Network with neutron request.
27     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
28     \    Create Network    ${NetworkElement}
29
30 Create Subnets For l2_network_1
31     [Documentation]    Create Sub Nets for the Networks with neutron request.
32     Create SubNet    l2_network_1    l2_subnet_1    @{SUBNETS_RANGE}[0]
33
34 Create Subnets For l2_network_2
35     [Documentation]    Create Sub Nets for the Networks with neutron request.
36     Create SubNet    l2_network_2    l2_subnet_2    @{SUBNETS_RANGE}[1]
37
38 Create Vm Instances For l2_network_1
39     [Documentation]    Create Four Vm instances using flavor and image names for a network.
40     Create Vm Instances    l2_network_1    ${NET_1_VM_INSTANCES}
41     [Teardown]    Show Debugs    ${NET_1_VM_INSTANCES}
42
43 Create Vm Instances For l2_network_2
44     [Documentation]    Create Four Vm instances using flavor and image names for a network.
45     Create Vm Instances    l2_network_2    ${NET_2_VM_INSTANCES}
46     [Teardown]    Show Debugs    ${NET_2_VM_INSTANCES}
47
48 Ping Vm Instance1 In l2_network_1
49     [Documentation]    Check reachability of vm instances by pinging to them.
50     Ping Vm From DHCP Namespace    l2_network_1    @{NET_1_VM_IPS}[0]
51
52 Ping Vm Instance2 In l2_network_1
53     [Documentation]    Check reachability of vm instances by pinging to them.
54     Ping Vm From DHCP Namespace    l2_network_1    @{NET_1_VM_IPS}[1]
55
56 Ping Vm Instance3 In l2_network_1
57     [Documentation]    Check reachability of vm instances by pinging to them.
58     Ping Vm From DHCP Namespace    l2_network_1    @{NET_1_VM_IPS}[2]
59
60 Ping Vm Instance1 In l2_network_2
61     [Documentation]    Check reachability of vm instances by pinging to them.
62     Ping Vm From DHCP Namespace    l2_network_2    @{NET_2_VM_IPS}[0]
63
64 Ping Vm Instance2 In l2_network_2
65     [Documentation]    Check reachability of vm instances by pinging to them.
66     Ping Vm From DHCP Namespace    l2_network_2    @{NET_2_VM_IPS}[1]
67
68 Ping Vm Instance3 In l2_network_2
69     [Documentation]    Check reachability of vm instances by pinging to them.
70     Ping Vm From DHCP Namespace    l2_network_2    @{NET_2_VM_IPS}[2]
71
72 Connectivity Tests From Vm Instance1 In l2_network_1
73     [Documentation]    Logging to the vm instance1
74     ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[1]    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[2]
75     Log    ${dst_ip_list}
76     Test Operations From Vm Instance    l2_network_1    @{NET_1_VM_IPS}[0]    ${dst_ip_list}
77
78 Connectivity Tests From Vm Instance2 In l2_network_1
79     [Documentation]    Logging to the vm instance2
80     ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[2]
81     Log    ${dst_ip_list}
82     Test Operations From Vm Instance    l2_network_1    @{NET_1_VM_IPS}[1]    ${dst_ip_list}
83
84 Connectivity Tests From Vm Instance3 In l2_network_1
85     [Documentation]    Logging to the vm instance2
86     ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[1]
87     Log    ${dst_ip_list}
88     Test Operations From Vm Instance    l2_network_1    @{NET_1_VM_IPS}[2]    ${dst_ip_list}
89
90 Connectivity Tests From Vm Instance1 In l2_network_2
91     [Documentation]    Logging to the vm instance using generated key pair.
92     ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[1]    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[2]
93     Log    ${dst_ip_list}
94     Test Operations From Vm Instance    l2_network_2    @{NET_2_VM_IPS}[0]    ${dst_ip_list}
95
96 Connectivity Tests From Vm Instance2 In l2_network_2
97     [Documentation]    Logging to the vm instance using generated key pair.
98     ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[2]
99     Log    ${dst_ip_list}
100     Test Operations From Vm Instance    l2_network_2    @{NET_2_VM_IPS}[1]    ${dst_ip_list}
101
102 Connectivity Tests From Vm Instance3 In l2_network_2
103     [Documentation]    Logging to the vm instance using generated key pair.
104     ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[1]
105     Log    ${dst_ip_list}
106     Test Operations From Vm Instance    l2_network_2    @{NET_2_VM_IPS}[2]    ${dst_ip_list}
107
108 Delete A Vm Instance
109     [Documentation]    Delete Vm instances using instance names.
110     Delete Vm Instance    MyFirstInstance_1
111
112 No Ping For Deleted Vm
113     [Documentation]    Check non reachability of deleted vm instances by pinging to them.
114     ${output}=    Ping From DHCP Should Not Succeed    l2_network_1    @{NET_1_VM_IPS}[0]
115
116 Delete Vm Instances In l2_network_1
117     [Documentation]    Delete Vm instances using instance names in l2_network_1.
118     : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
119     \    Delete Vm Instance    ${VmElement}
120
121 Delete Vm Instances In l2_network_2
122     [Documentation]    Delete Vm instances using instance names in l2_network_2.
123     : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
124     \    Delete Vm Instance    ${VmElement}
125
126 Delete Sub Networks In l2_network_1
127     [Documentation]    Delete Sub Nets for the Networks with neutron request.
128     Delete SubNet    l2_subnet_1
129
130 Delete Sub Networks In l2_network_2
131     [Documentation]    Delete Sub Nets for the Networks with neutron request.
132     Delete SubNet    l2_subnet_2
133
134 Delete Networks
135     [Documentation]    Delete Networks with neutron request.
136     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
137     \    Delete Network    ${NetworkElement}