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 Run Keywords Get OvsDebugInfo
8 ... AND Get Model Dump ${ODL_SYSTEM_IP}
10 Library OperatingSystem
11 Library RequestsLibrary
12 Resource ../../../libraries/DevstackUtils.robot
13 Resource ../../../libraries/Netvirt.robot
14 Resource ../../../libraries/OpenStackOperations.robot
15 Resource ../../../libraries/SetupUtils.robot
16 Resource ../../../libraries/Utils.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 @{SUBNETS_RANGE} 50.0.0.0/24 60.0.0.0/24
27 [Documentation] Create Network with neutron request.
28 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
29 \ Create Network ${NetworkElement}
31 Create Subnets For network_1
32 [Documentation] Create Sub Nets for the Networks with neutron request.
33 Create SubNet network_1 subnet_1 @{SUBNETS_RANGE}[0]
35 Create Subnets For network_2
36 [Documentation] Create Sub Nets for the Networks with neutron request.
37 Create SubNet network_2 subnet_2 @{SUBNETS_RANGE}[1]
39 Create Vm Instances For network_1
40 [Documentation] Create Four Vm instances using flavor and image names for a network.
41 Create Vm Instances network_1 ${NET_1_VM_INSTANCES} sg=csit
43 Create Vm Instances For network_2
44 [Documentation] Create Four Vm instances using flavor and image names for a network.
45 Create Vm Instances network_2 ${NET_2_VM_INSTANCES} sg=csit
47 Check Vm Instances Have Ip Address
48 [Documentation] Test case to verify that all created VMs are ready and have received their ip addresses.
49 ... We are polling first and longest on the last VM created assuming that if it's received it's address
50 ... already the other instances should have theirs already or at least shortly thereafter.
51 # first, ensure all VMs are in ACTIVE state. if not, we can just fail the test case and not waste time polling
53 : FOR ${vm} IN @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
54 \ Wait Until Keyword Succeeds 15s 5s Verify VM Is ACTIVE ${vm}
55 ${NET1_L3_VM_IPS} ${NET1_DHCP_IP} Wait Until Keyword Succeeds 180s 10s Verify VMs Received DHCP Lease @{NET_1_VM_INSTANCES}
56 ${NET2_L3_VM_IPS} ${NET2_DHCP_IP} Wait Until Keyword Succeeds 180s 10s Verify VMs Received DHCP Lease @{NET_2_VM_INSTANCES}
57 Set Suite Variable ${NET1_L3_VM_IPS}
58 Set Suite Variable ${NET1_DHCP_IP}
59 Set Suite Variable ${NET2_L3_VM_IPS}
60 Set Suite Variable ${NET2_DHCP_IP}
61 [Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
62 ... AND Get OvsDebugInfo
63 ... AND Get Model Dump ${ODL_SYSTEM_IP}
66 [Documentation] Create Router
67 Create Router router_1
69 Add Interfaces To Router
70 [Documentation] Add Interfaces
71 : FOR ${interface} IN @{SUBNETS_NAME}
72 \ Add Router Interface router_1 ${interface}
74 Ping Vm Instance1 In network_2 From network_1
75 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
76 Ping Vm From DHCP Namespace network_1 @{NET2_L3_VM_IPS}[0]
78 Ping Vm Instance2 In network_2 From network_1
79 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
80 Ping Vm From DHCP Namespace network_1 @{NET2_L3_VM_IPS}[1]
82 Ping Vm Instance3 In network_2 From network_1
83 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
84 Ping Vm From DHCP Namespace network_1 @{NET2_L3_VM_IPS}[2]
86 Ping Vm Instance1 In network_1 From network_2
87 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
88 Ping Vm From DHCP Namespace network_2 @{NET1_L3_VM_IPS}[0]
90 Ping Vm Instance2 In network_1 From network_2
91 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
92 Ping Vm From DHCP Namespace network_2 @{NET1_L3_VM_IPS}[1]
94 Ping Vm Instance3 In network_1 From network_2
95 [Documentation] Check reachability of vm instances by pinging to them after creating routers.
96 Ping Vm From DHCP Namespace network_2 @{NET1_L3_VM_IPS}[2]
98 Connectivity Tests From Vm Instance1 In network_1
99 [Documentation] Login to the VM instance and test operations
100 ${dst_list}= Create List @{NET1_L3_VM_IPS} @{NET2_L3_VM_IPS}
102 Test Operations From Vm Instance network_1 @{NET1_L3_VM_IPS}[0] ${dst_list}
104 Connectivity Tests From Vm Instance2 In network_1
105 [Documentation] Login to the vm instance and test operations
106 ${dst_list}= Create List @{NET1_L3_VM_IPS} @{NET2_L3_VM_IPS}
108 Test Operations From Vm Instance network_1 @{NET1_L3_VM_IPS}[1] ${dst_list}
110 Connectivity Tests From Vm Instance3 In network_1
111 [Documentation] Login to the vm instance and test operations
112 ${dst_list}= Create List @{NET1_L3_VM_IPS} @{NET2_L3_VM_IPS}
114 Test Operations From Vm Instance network_1 @{NET1_L3_VM_IPS}[2] ${dst_list}
116 Connectivity Tests From Vm Instance1 In network_2
117 [Documentation] Login to the vm instance and test operations
118 ${dst_list}= Create List @{NET1_L3_VM_IPS} @{NET2_L3_VM_IPS}
120 Test Operations From Vm Instance network_2 @{NET2_L3_VM_IPS}[0] ${dst_list}
122 Connectivity Tests From Vm Instance2 In network_2
123 [Documentation] Logging to the vm instance using generated key pair.
124 ${dst_list}= Create List @{NET1_L3_VM_IPS} @{NET2_L3_VM_IPS}
126 Test Operations From Vm Instance network_2 @{NET2_L3_VM_IPS}[1] ${dst_list}
128 Connectivity Tests From Vm Instance3 In network_2
129 [Documentation] Logging to the vm instance using generated key pair.
130 ${dst_list}= Create List @{NET1_L3_VM_IPS} @{NET2_L3_VM_IPS}
132 Test Operations From Vm Instance network_2 @{NET2_L3_VM_IPS}[2] ${dst_list}
134 Delete Vm Instances In network_1
135 [Documentation] Delete Vm instances using instance names in network_1.
136 : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
137 \ Delete Vm Instance ${VmElement}
139 Delete Vm Instances In network_2
140 [Documentation] Delete Vm instances using instance names in network_2.
141 : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
142 \ Delete Vm Instance ${VmElement}
143 [Teardown] Run Keywords Show Debugs @{NET_1_VM_INSTANCES} @{NET_2_VM_INSTANCES}
144 ... AND Get OvsDebugInfo
145 ... AND Get Model Dump ${ODL_SYSTEM_IP}
147 Delete Router Interfaces
148 [Documentation] Remove Interface to the subnets.
149 : FOR ${interface} IN @{SUBNETS_NAME}
150 \ Remove Interface router_1 ${interface}
153 [Documentation] Delete Router and Interface to the subnets.
154 Delete Router router_1
156 Delete Sub Networks In network_1
157 [Documentation] Delete Sub Nets for the Networks with neutron request.
158 Delete SubNet subnet_1
160 Delete Sub Networks In network_2
161 [Documentation] Delete Sub Nets for the Networks with neutron request.
162 Delete SubNet subnet_2
165 [Documentation] Delete Networks with neutron request.
166 : FOR ${NetworkElement} IN @{NETWORKS_NAME}
167 \ Delete Network ${NetworkElement}