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
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
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
31 [Documentation] Create Network with neutron request.
32 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
33 \ Create Network ${NetworkElement}
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]
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]
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
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
52 [Documentation] Create Router
53 Create Router router_1
55 Add Interfaces To Router
56 [Documentation] Add Interfaces
57 : FOR ${interface} IN @{SUBNETS_NAME}
58 \ Add Router Interface router_1 ${interface}
60 Ping Vm Instance1 In network_2 From network_1
61 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
63 Ping Vm From DHCP Namespace network_1 @{NET_2_VM_IPS}[0]
65 Ping Vm Instance2 In network_2 From network_1
66 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
68 Ping Vm From DHCP Namespace network_1 @{NET_2_VM_IPS}[1]
70 Ping Vm Instance3 In network_2 From network_1
71 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
73 Ping Vm From DHCP Namespace network_1 @{NET_2_VM_IPS}[2]
75 Ping Vm Instance1 In network_1 From network_2
76 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
78 Ping Vm From DHCP Namespace network_2 @{NET_1_VM_IPS}[0]
80 Ping Vm Instance2 In network_1 From network_2
81 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
83 Ping Vm From DHCP Namespace network_2 @{NET_1_VM_IPS}[1]
85 Ping Vm Instance3 In network_1 From network_2
86 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
88 Ping Vm From DHCP Namespace network_2 @{NET_1_VM_IPS}[2]
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]
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}
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}
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]
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}
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}
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]
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}
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}
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]
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}
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}
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]
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}
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}
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]
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}
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}
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}
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}
154 Delete Router Interfaces
155 [Documentation] Remove Interface to the subnets.
156 : FOR ${interface} IN @{SUBNETS_NAME}
157 \ Remove Interface router_1 ${interface}
160 [Documentation] Delete Router and Interface to the subnets.
161 Delete Router router_1
163 Delete Sub Networks In network_1
164 [Documentation] Delete Sub Nets for the Networks with neutron request.
165 Delete SubNet subnet_1
167 Delete Sub Networks In network_2
168 [Documentation] Delete Sub Nets for the Networks with neutron request.
169 Delete SubNet subnet_2
172 [Documentation] Delete Networks with neutron request.
173 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
174 \ Delete Network ${NetworkElement}