KarafKeywords-logging in karaf console extended to cluster
[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       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/DevstackUtils.robot
16 Resource          ../../../libraries/SetupUtils.robot
17
18 *** Variables ***
19 @{NETWORKS_NAME}    l2_network_1    l2_network_2
20 @{SUBNETS_NAME}    l2_subnet_1    l2_subnet_2
21 @{NET_1_VM_INSTANCES}    MyFirstInstance_1    MySecondInstance_1    MyThirdInstance_1
22 @{NET_2_VM_INSTANCES}    MyFirstInstance_2    MySecondInstance_2    MyThirdInstance_2
23 @{NET_1_VM_IPS}    30.0.0.3    30.0.0.4    30.0.0.5
24 @{NET_2_VM_IPS}    40.0.0.3    40.0.0.4    40.0.0.5
25 @{VM_IPS_NOT_DELETED}    30.0.0.4    30.0.0.5
26 @{GATEWAY_IPS}    30.0.0.1    40.0.0.1
27 @{DHCP_IPS}       30.0.0.2    40.0.0.2
28 @{SUBNETS_RANGE}    30.0.0.0/24    40.0.0.0/24
29
30 *** Test Cases ***
31 Create Networks
32     [Documentation]    Create Network with neutron request.
33     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
34     \    Create Network    ${NetworkElement}
35
36 Create Subnets For l2_network_1
37     [Documentation]    Create Sub Nets for the Networks with neutron request.
38     Create SubNet    l2_network_1    l2_subnet_1    @{SUBNETS_RANGE}[0]
39
40 Create Subnets For l2_network_2
41     [Documentation]    Create Sub Nets for the Networks with neutron request.
42     Create SubNet    l2_network_2    l2_subnet_2    @{SUBNETS_RANGE}[1]
43
44 Add Ssh Allow Rule
45     [Documentation]    Allow all TCP packets for testing
46     Create Security Group    csit    "CSIT SSH Allow"
47     Create Security Rule    ingress    tcp    1    65535    0.0.0.0/0    csit
48     Create Security Rule    egress    tcp    1    65535    0.0.0.0/0    csit
49
50 Create Vm Instances For l2_network_1
51     [Documentation]    Create Four Vm instances using flavor and image names for a network.
52     Create Vm Instances    l2_network_1    ${NET_1_VM_INSTANCES}    sg=csit
53
54 Create Vm Instances For l2_network_2
55     [Documentation]    Create Four Vm instances using flavor and image names for a network.
56     Create Vm Instances    l2_network_2    ${NET_2_VM_INSTANCES}    sg=csit
57
58 Ping Vm Instance1 In l2_network_1
59     [Documentation]    Check reachability of vm instances by pinging to them.
60     Get OvsDebugInfo
61     Ping Vm From DHCP Namespace    l2_network_1    @{NET_1_VM_IPS}[0]
62
63 Ping Vm Instance2 In l2_network_1
64     [Documentation]    Check reachability of vm instances by pinging to them.
65     Get OvsDebugInfo
66     Ping Vm From DHCP Namespace    l2_network_1    @{NET_1_VM_IPS}[1]
67
68 Ping Vm Instance3 In l2_network_1
69     [Documentation]    Check reachability of vm instances by pinging to them.
70     Get OvsDebugInfo
71     Ping Vm From DHCP Namespace    l2_network_1    @{NET_1_VM_IPS}[2]
72
73 Ping Vm Instance1 In l2_network_2
74     [Documentation]    Check reachability of vm instances by pinging to them.
75     Get OvsDebugInfo
76     Ping Vm From DHCP Namespace    l2_network_2    @{NET_2_VM_IPS}[0]
77
78 Ping Vm Instance2 In l2_network_2
79     [Documentation]    Check reachability of vm instances by pinging to them.
80     Get OvsDebugInfo
81     Ping Vm From DHCP Namespace    l2_network_2    @{NET_2_VM_IPS}[1]
82
83 Ping Vm Instance3 In l2_network_2
84     [Documentation]    Check reachability of vm instances by pinging to them.
85     Get OvsDebugInfo
86     Ping Vm From DHCP Namespace    l2_network_2    @{NET_2_VM_IPS}[2]
87
88 Connectivity Tests From Vm Instance1 In l2_network_1
89     [Documentation]    Logging to the vm instance1
90     ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[1]    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[2]
91     Log    ${dst_ip_list}
92     Get OvsDebugInfo
93     Test Operations From Vm Instance    l2_network_1    @{NET_1_VM_IPS}[0]    ${dst_ip_list}
94
95 Connectivity Tests From Vm Instance2 In l2_network_1
96     [Documentation]    Logging to the vm instance2
97     ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[2]
98     Log    ${dst_ip_list}
99     Get OvsDebugInfo
100     Test Operations From Vm Instance    l2_network_1    @{NET_1_VM_IPS}[1]    ${dst_ip_list}
101
102 Connectivity Tests From Vm Instance3 In l2_network_1
103     [Documentation]    Logging to the vm instance2
104     ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[1]
105     Log    ${dst_ip_list}
106     Get OvsDebugInfo
107     Test Operations From Vm Instance    l2_network_1    @{NET_1_VM_IPS}[2]    ${dst_ip_list}
108
109 Connectivity Tests From Vm Instance1 In l2_network_2
110     [Documentation]    Logging to the vm instance using generated key pair.
111     ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[1]    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[2]
112     Log    ${dst_ip_list}
113     Get OvsDebugInfo
114     Test Operations From Vm Instance    l2_network_2    @{NET_2_VM_IPS}[0]    ${dst_ip_list}
115
116 Connectivity Tests From Vm Instance2 In l2_network_2
117     [Documentation]    Logging to the vm instance using generated key pair.
118     ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[2]
119     Log    ${dst_ip_list}
120     Get OvsDebugInfo
121     Test Operations From Vm Instance    l2_network_2    @{NET_2_VM_IPS}[1]    ${dst_ip_list}
122
123 Connectivity Tests From Vm Instance3 In l2_network_2
124     [Documentation]    Logging to the vm instance using generated key pair.
125     ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[1]
126     Log    ${dst_ip_list}
127     Get OvsDebugInfo
128     Test Operations From Vm Instance    l2_network_2    @{NET_2_VM_IPS}[2]    ${dst_ip_list}
129
130 Delete A Vm Instance
131     [Documentation]    Delete Vm instances using instance names.
132     Delete Vm Instance    MyFirstInstance_1
133
134 No Ping For Deleted Vm
135     [Documentation]    Check non reachability of deleted vm instances by pinging to them.
136     Get OvsDebugInfo
137     ${output}=    Ping From DHCP Should Not Succeed    l2_network_1    @{NET_1_VM_IPS}[0]
138
139 Delete Vm Instances In l2_network_1
140     [Documentation]    Delete Vm instances using instance names in l2_network_1.
141     : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
142     \    Delete Vm Instance    ${VmElement}
143
144 Delete Vm Instances In l2_network_2
145     [Documentation]    Delete Vm instances using instance names in l2_network_2.
146     : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
147     \    Delete Vm Instance    ${VmElement}
148
149 Delete Sub Networks In l2_network_1
150     [Documentation]    Delete Sub Nets for the Networks with neutron request.
151     Delete SubNet    l2_subnet_1
152
153 Delete Sub Networks In l2_network_2
154     [Documentation]    Delete Sub Nets for the Networks with neutron request.
155     Delete SubNet    l2_subnet_2
156
157 Delete Networks
158     [Documentation]    Delete Networks with neutron request.
159     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
160     \    Delete Network    ${NetworkElement}