Use vm instance names for Show Debugs
[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       Devstack Suite Setup Tests
4 Suite Teardown    Close All Connections
5 Test Setup        Log Testcase Start To Controller Karaf
6 Test Teardown     Run Keywords    Show Debugs    ${NET_1_VM_INSTANCES}
7 ...               AND    Show Debugs    ${NET_2_VM_INSTANCES}
8 ...               AND    Get OvsDebugInfo
9 Library           SSHLibrary
10 Library           OperatingSystem
11 Library           RequestsLibrary
12 Resource          ../../../libraries/Utils.robot
13 Resource          ../../../libraries/OpenStackOperations.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 @{NET_1_VM_IPS}    50.0.0.3    50.0.0.4    50.0.0.5
22 @{NET_2_VM_IPS}    60.0.0.3    60.0.0.4    60.0.0.5
23 @{GATEWAY_IPS}    50.0.0.1    60.0.0.1
24 @{DHCP_IPS}       50.0.0.2    60.0.0.2
25 @{SUBNETS_RANGE}    50.0.0.0/24    60.0.0.0/24
26
27 *** Test Cases ***
28 Create Networks
29     [Documentation]    Create Network with neutron request.
30     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
31     \    Create Network    ${NetworkElement}
32
33 Create Subnets For network_1
34     [Documentation]    Create Sub Nets for the Networks with neutron request.
35     Create SubNet    network_1    subnet_1    @{SUBNETS_RANGE}[0]
36
37 Create Subnets For network_2
38     [Documentation]    Create Sub Nets for the Networks with neutron request.
39     Create SubNet    network_2    subnet_2    @{SUBNETS_RANGE}[1]
40
41 Create Vm Instances For network_1
42     [Documentation]    Create Four Vm instances using flavor and image names for a network.
43     Create Vm Instances    network_1    ${NET_1_VM_INSTANCES}    sg=csit
44
45 Create Vm Instances For network_2
46     [Documentation]    Create Four Vm instances using flavor and image names for a network.
47     Create Vm Instances    network_2    ${NET_2_VM_INSTANCES}    sg=csit
48
49 Create Routers
50     [Documentation]    Create Router
51     Create Router    router_1
52
53 Add Interfaces To Router
54     [Documentation]    Add Interfaces
55     : FOR    ${interface}    IN    @{SUBNETS_NAME}
56     \    Add Router Interface    router_1    ${interface}
57
58 Ping Vm Instance1 In network_2 From network_1
59     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
60     Get OvsDebugInfo
61     Ping Vm From DHCP Namespace    network_1    @{NET_2_VM_IPS}[0]
62
63 Ping Vm Instance2 In network_2 From network_1
64     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
65     Get OvsDebugInfo
66     Ping Vm From DHCP Namespace    network_1    @{NET_2_VM_IPS}[1]
67
68 Ping Vm Instance3 In network_2 From network_1
69     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
70     Get OvsDebugInfo
71     Ping Vm From DHCP Namespace    network_1    @{NET_2_VM_IPS}[2]
72
73 Ping Vm Instance1 In network_1 From network_2
74     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
75     Get OvsDebugInfo
76     Ping Vm From DHCP Namespace    network_2    @{NET_1_VM_IPS}[0]
77
78 Ping Vm Instance2 In network_1 From network_2
79     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
80     Get OvsDebugInfo
81     Ping Vm From DHCP Namespace    network_2    @{NET_1_VM_IPS}[1]
82
83 Ping Vm Instance3 In network_1 From network_2
84     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
85     Get OvsDebugInfo
86     Ping Vm From DHCP Namespace    network_2    @{NET_1_VM_IPS}[2]
87
88 Connectivity Tests From Vm Instance1 In network_1
89     [Documentation]    Logging to the vm instance using generated key pair.
90     ${dst_ip_list}=    Create List    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[1]    @{NET_1_VM_IPS}[2]
91     Log    ${dst_ip_list}
92     ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[0]    @{NET_2_VM_IPS}[1]    @{NET_2_VM_IPS}[2]
93     Log    ${other_dst_ip_list}
94     Get OvsDebugInfo
95     Test Operations From Vm Instance    network_1    @{NET_1_VM_IPS}[0]    ${dst_ip_list}    l2_or_l3=l3    list_of_external_dst_ips=${other_dst_ip_list}
96
97 Connectivity Tests From Vm Instance2 In network_1
98     [Documentation]    Logging to the vm instance using generated key pair.
99     ${dst_ip_list}=    Create List    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[1]    @{NET_1_VM_IPS}[2]
100     Log    ${dst_ip_list}
101     ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[0]    @{NET_2_VM_IPS}[1]    @{NET_2_VM_IPS}[2]
102     Log    ${other_dst_ip_list}
103     Get OvsDebugInfo
104     Test Operations From Vm Instance    network_1    @{NET_1_VM_IPS}[1]    ${dst_ip_list}    l2_or_l3=l3    list_of_external_dst_ips=${other_dst_ip_list}
105
106 Connectivity Tests From Vm Instance3 In network_1
107     [Documentation]    Logging to the vm instance using generated key pair.
108     ${dst_ip_list}=    Create List    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[1]    @{NET_1_VM_IPS}[2]
109     Log    ${dst_ip_list}
110     ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[0]    @{NET_2_VM_IPS}[1]    @{NET_2_VM_IPS}[2]
111     Log    ${other_dst_ip_list}
112     Get OvsDebugInfo
113     Test Operations From Vm Instance    network_1    @{NET_1_VM_IPS}[2]    ${dst_ip_list}    l2_or_l3=l3    list_of_external_dst_ips=${other_dst_ip_list}
114
115 Connectivity Tests From Vm Instance1 In network_2
116     [Documentation]    Logging to the vm instance using generated key pair.
117     ${dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[1]    @{NET_2_VM_IPS}[2]
118     Log    ${dst_ip_list}
119     ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[0]    @{NET_1_VM_IPS}[1]    @{NET_1_VM_IPS}[2]
120     Log    ${other_dst_ip_list}
121     Get OvsDebugInfo
122     Test Operations From Vm Instance    network_2    @{NET_2_VM_IPS}[0]    ${dst_ip_list}    l2_or_l3=l3    list_of_external_dst_ips=${other_dst_ip_list}
123
124 Connectivity Tests From Vm Instance2 In network_2
125     [Documentation]    Logging to the vm instance using generated key pair.
126     ${dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[0]    @{NET_2_VM_IPS}[2]
127     Log    ${dst_ip_list}
128     ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[0]    @{NET_1_VM_IPS}[1]    @{NET_1_VM_IPS}[2]
129     Log    ${other_dst_ip_list}
130     Get OvsDebugInfo
131     Test Operations From Vm Instance    network_2    @{NET_2_VM_IPS}[1]    ${dst_ip_list}    l2_or_l3=l3    list_of_external_dst_ips=${other_dst_ip_list}
132
133 Connectivity Tests From Vm Instance3 In network_2
134     [Documentation]    Logging to the vm instance using generated key pair.
135     ${dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[0]    @{NET_2_VM_IPS}[1]
136     Log    ${dst_ip_list}
137     ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[0]    @{NET_1_VM_IPS}[1]    @{NET_1_VM_IPS}[2]
138     Log    ${other_dst_ip_list}
139     Get OvsDebugInfo
140     Test Operations From Vm Instance    network_2    @{NET_2_VM_IPS}[2]    ${dst_ip_list}    l2_or_l3=l3    list_of_external_dst_ips=${other_dst_ip_list}
141
142 Delete Vm Instances In network_1
143     [Documentation]    Delete Vm instances using instance names in network_1.
144     : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
145     \    Delete Vm Instance    ${VmElement}
146
147 Delete Vm Instances In network_2
148     [Documentation]    Delete Vm instances using instance names in network_2.
149     : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
150     \    Delete Vm Instance    ${VmElement}
151
152 Delete Router Interfaces
153     [Documentation]    Remove Interface to the subnets.
154     : FOR    ${interface}    IN    @{SUBNETS_NAME}
155     \    Remove Interface    router_1    ${interface}
156
157 Delete Routers
158     [Documentation]    Delete Router and Interface to the subnets.
159     Delete Router    router_1
160
161 Delete Sub Networks In network_1
162     [Documentation]    Delete Sub Nets for the Networks with neutron request.
163     Delete SubNet    subnet_1
164
165 Delete Sub Networks In network_2
166     [Documentation]    Delete Sub Nets for the Networks with neutron request.
167     Delete SubNet    subnet_2
168
169 Delete Networks
170     [Documentation]    Delete Networks with neutron request.
171     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
172     \    Delete Network    ${NetworkElement}