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