remove stale devstack suite setup
[integration/test.git] / csit / suites / openstack / connectivity / 02_l3_tests.robot
1 *** Settings ***
2 Documentation     Test suite to check connectivity in L3 using routers.
3 Suite Setup       BuiltIn.Run Keywords    SetupUtils.Setup_Utils_For_Setup_And_Teardown
4 ...               AND    DevstackUtils.Devstack Suite Setup
5 Suite Teardown    Close All Connections
6 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
7 Test Teardown     Get OvsDebugInfo
8 Library           SSHLibrary
9 Library           OperatingSystem
10 Library           RequestsLibrary
11 Resource          ../../../libraries/Utils.robot
12 Resource          ../../../libraries/OpenStackOperations.robot
13 Resource          ../../../libraries/SetupUtils.robot
14 Resource          ../../../libraries/DevstackUtils.robot
15
16 *** Variables ***
17 @{NETWORKS_NAME}    network_1    network_2
18 @{SUBNETS_NAME}    subnet_1    subnet_2
19 @{NET_1_VM_INSTANCES}    l3_instance_net_1_1    l3_instance_net_1_2    l3_instance_net_1_3
20 @{NET_2_VM_INSTANCES}    l3_instance_net_2_1    l3_instance_net_2_2    l3_instance_net_2_3
21 @{SUBNETS_RANGE}    50.0.0.0/24    60.0.0.0/24
22
23 *** Test Cases ***
24 Create Networks
25     [Documentation]    Create Network with neutron request.
26     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
27     \    Create Network    ${NetworkElement}
28
29 Create Subnets For network_1
30     [Documentation]    Create Sub Nets for the Networks with neutron request.
31     Create SubNet    network_1    subnet_1    @{SUBNETS_RANGE}[0]
32
33 Create Subnets For network_2
34     [Documentation]    Create Sub Nets for the Networks with neutron request.
35     Create SubNet    network_2    subnet_2    @{SUBNETS_RANGE}[1]
36
37 Create Vm Instances For network_1
38     [Documentation]    Create Four Vm instances using flavor and image names for a network.
39     Create Vm Instances    network_1    ${NET_1_VM_INSTANCES}    sg=csit
40
41 Create Vm Instances For network_2
42     [Documentation]    Create Four Vm instances using flavor and image names for a network.
43     Create Vm Instances    network_2    ${NET_2_VM_INSTANCES}    sg=csit
44
45 Check Vm Instances Have Ip Address
46     [Documentation]    Test case to verify that all created VMs are ready and have received their ip addresses.
47     ...    We are polling first and longest on the last VM created assuming that if it's received it's address
48     ...    already the other instances should have theirs already or at least shortly thereafter.
49     # first, ensure all VMs are in ACTIVE state.    if not, we can just fail the test case and not waste time polling
50     # for dhcp addresses
51     : FOR    ${vm}    IN    @{NET_1_VM_INSTANCES}    @{NET_2_VM_INSTANCES}
52     \    Wait Until Keyword Succeeds    15s    5s    Verify VM Is ACTIVE    ${vm}
53     ${NET1_L3_VM_IPS}    ${NET1_DHCP_IP}    Wait Until Keyword Succeeds    180s    10s    Verify VMs Received DHCP Lease    @{NET_1_VM_INSTANCES}
54     ${NET2_L3_VM_IPS}    ${NET2_DHCP_IP}    Wait Until Keyword Succeeds    180s    10s    Verify VMs Received DHCP Lease    @{NET_2_VM_INSTANCES}
55     Set Suite Variable    ${NET1_L3_VM_IPS}
56     Set Suite Variable    ${NET1_DHCP_IP}
57     Set Suite Variable    ${NET2_L3_VM_IPS}
58     Set Suite Variable    ${NET2_DHCP_IP}
59     [Teardown]    Run Keywords    Show Debugs    ${NET_1_VM_INSTANCES}
60     ...    AND    Show Debugs    ${NET_2_VM_INSTANCES}
61     ...    AND    Get OvsDebugInfo
62
63 Create Routers
64     [Documentation]    Create Router
65     Create Router    router_1
66
67 Add Interfaces To Router
68     [Documentation]    Add Interfaces
69     : FOR    ${interface}    IN    @{SUBNETS_NAME}
70     \    Add Router Interface    router_1    ${interface}
71
72 Ping Vm Instance1 In network_2 From network_1
73     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
74     Ping Vm From DHCP Namespace    network_1    @{NET2_L3_VM_IPS}[0]
75
76 Ping Vm Instance2 In network_2 From network_1
77     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
78     Ping Vm From DHCP Namespace    network_1    @{NET2_L3_VM_IPS}[1]
79
80 Ping Vm Instance3 In network_2 From network_1
81     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
82     Ping Vm From DHCP Namespace    network_1    @{NET2_L3_VM_IPS}[2]
83
84 Ping Vm Instance1 In network_1 From network_2
85     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
86     Ping Vm From DHCP Namespace    network_2    @{NET1_L3_VM_IPS}[0]
87
88 Ping Vm Instance2 In network_1 From network_2
89     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
90     Ping Vm From DHCP Namespace    network_2    @{NET1_L3_VM_IPS}[1]
91
92 Ping Vm Instance3 In network_1 From network_2
93     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
94     Ping Vm From DHCP Namespace    network_2    @{NET1_L3_VM_IPS}[2]
95
96 Connectivity Tests From Vm Instance1 In network_1
97     [Documentation]    Login to the VM instance and test operations
98     ${dst_list}=    Create List    @{NET1_L3_VM_IPS}    @{NET2_L3_VM_IPS}
99     Log    ${dst_list}
100     Test Operations From Vm Instance    network_1    @{NET1_L3_VM_IPS}[0]    ${dst_list}
101
102 Connectivity Tests From Vm Instance2 In network_1
103     [Documentation]    Login to the vm instance and test operations
104     ${dst_list}=    Create List    @{NET1_L3_VM_IPS}    @{NET2_L3_VM_IPS}
105     Log    ${dst_list}
106     Test Operations From Vm Instance    network_1    @{NET1_L3_VM_IPS}[1]    ${dst_list}
107
108 Connectivity Tests From Vm Instance3 In network_1
109     [Documentation]    Login to the vm instance and test operations
110     ${dst_list}=    Create List    @{NET1_L3_VM_IPS}    @{NET2_L3_VM_IPS}
111     Log    ${dst_list}
112     Test Operations From Vm Instance    network_1    @{NET1_L3_VM_IPS}[2]    ${dst_list}
113
114 Connectivity Tests From Vm Instance1 In network_2
115     [Documentation]    Login to the vm instance and test operations
116     ${dst_list}=    Create List    @{NET1_L3_VM_IPS}    @{NET2_L3_VM_IPS}
117     Log    ${dst_list}
118     Test Operations From Vm Instance    network_2    @{NET2_L3_VM_IPS}[0]    ${dst_list}
119
120 Connectivity Tests From Vm Instance2 In network_2
121     [Documentation]    Logging to the vm instance using generated key pair.
122     ${dst_list}=    Create List    @{NET1_L3_VM_IPS}    @{NET2_L3_VM_IPS}
123     Log    ${dst_list}
124     Test Operations From Vm Instance    network_2    @{NET2_L3_VM_IPS}[1]    ${dst_list}
125
126 Connectivity Tests From Vm Instance3 In network_2
127     [Documentation]    Logging to the vm instance using generated key pair.
128     ${dst_list}=    Create List    @{NET1_L3_VM_IPS}    @{NET2_L3_VM_IPS}
129     Log    ${dst_list}
130     Test Operations From Vm Instance    network_2    @{NET2_L3_VM_IPS}[2]    ${dst_list}
131
132 Delete Vm Instances In network_1
133     [Documentation]    Delete Vm instances using instance names in network_1.
134     : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
135     \    Delete Vm Instance    ${VmElement}
136
137 Delete Vm Instances In network_2
138     [Documentation]    Delete Vm instances using instance names in network_2.
139     : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
140     \    Delete Vm Instance    ${VmElement}
141     [Teardown]    Run Keywords    Show Debugs    ${NET_1_VM_INSTANCES}
142     ...    AND    Show Debugs    ${NET_2_VM_INSTANCES}
143     ...    AND    Get OvsDebugInfo
144
145 Delete Router Interfaces
146     [Documentation]    Remove Interface to the subnets.
147     : FOR    ${interface}    IN    @{SUBNETS_NAME}
148     \    Remove Interface    router_1    ${interface}
149
150 Delete Routers
151     [Documentation]    Delete Router and Interface to the subnets.
152     Delete Router    router_1
153
154 Delete Sub Networks In network_1
155     [Documentation]    Delete Sub Nets for the Networks with neutron request.
156     Delete SubNet    subnet_1
157
158 Delete Sub Networks In network_2
159     [Documentation]    Delete Sub Nets for the Networks with neutron request.
160     Delete SubNet    subnet_2
161
162 Delete Networks
163     [Documentation]    Delete Networks with neutron request.
164     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
165     \    Delete Network    ${NetworkElement}