2 Documentation Test suite to verify packet flows between vm instances.
5 Library OperatingSystem
6 Library RequestsLibrary
7 Resource ../libraries/OpenStackInstallUtils.robot
8 Resource ../libraries/OpenStackOperations.robot
9 Resource ../libraries/SystemUtils.robot
10 Resource ../libraries/Utils.robot
12 Suite Setup OpenStackInstallUtils.Get All Ssh Connections
13 Suite Teardown Close All Connections
18 Create And Configure Keystone Db ${OS_CONTROL_1_IP} root mysql ${OS_CONTROL_1_HOSTNAME}
19 IF 2 < ${NUM_CONTROL_NODES}
20 Create And Configure Keystone Db Other Nodes ${OS_CONTROL_2_IP} root mysql ${OS_CONTROL_2_HOSTNAME}
22 IF 2 < ${NUM_CONTROL_NODES}
23 Create And Configure Keystone Db Other Nodes ${OS_CONTROL_3_IP} root mysql ${OS_CONTROL_3_HOSTNAME}
25 IF 3 < ${NUM_CONTROL_NODES}
26 Create And Configure Keystone Db Other Nodes ${OS_CONTROL_4_IP} root mysql ${OS_CONTROL_4_HOSTNAME}
28 IF 4 < ${NUM_CONTROL_NODES}
29 Create And Configure Keystone Db Other Nodes ${OS_CONTROL_5_IP} root mysql ${OS_CONTROL_5_HOSTNAME}
31 IF 2 > ${NUM_CONTROL_NODES}
32 Install Configure Keystone ${OS_CONTROL_1_IP} ${OS_CONTROL_1_HOSTNAME}
34 IF 2 < ${NUM_CONTROL_NODES}
35 Install Configure Keystone ${OS_CONTROL_1_IP} ${HAPROXY_HOSTNAME}
37 IF 2 < ${NUM_CONTROL_NODES}
38 Install Configure Keystone ${OS_CONTROL_2_IP} ${HAPROXY_HOSTNAME}
40 IF 2 < ${NUM_CONTROL_NODES}
41 Install Configure Keystone ${OS_CONTROL_3_IP} ${HAPROXY_HOSTNAME}
43 IF 3 < ${NUM_CONTROL_NODES}
44 Install Configure Keystone ${OS_CONTROL_4_IP} ${HAPROXY_HOSTNAME}
46 IF 4 < ${NUM_CONTROL_NODES}
47 Install Configure Keystone ${OS_CONTROL_5_IP} ${HAPROXY_HOSTNAME}
49 ${token}= Run Command ${OS_CONTROL_1_IP} openssl rand -hex 10
50 IF 2 < ${NUM_CONTROL_NODES}
51 Set Admin Token ${OS_CONTROL_1_IP} ${token}
53 IF 2 < ${NUM_CONTROL_NODES}
54 Set Admin Token ${OS_CONTROL_2_IP} ${token}
56 IF 2 < ${NUM_CONTROL_NODES}
57 Set Admin Token ${OS_CONTROL_3_IP} ${token}
59 IF 3 < ${NUM_CONTROL_NODES}
60 Set Admin Token ${OS_CONTROL_4_IP} ${token}
62 IF 4 < ${NUM_CONTROL_NODES}
63 Set Admin Token ${OS_CONTROL_5_IP} ${token}
65 Keystone Manage Setup ${OS_CONTROL_1_IP} keystone keystone
66 IF 2 < ${NUM_CONTROL_NODES}
67 Copy Fernet Keys ${OS_CONTROL_1_IP} ${OS_CONTROL_2_IP}
69 IF 2 < ${NUM_CONTROL_NODES}
70 Copy Fernet Keys ${OS_CONTROL_1_IP} ${OS_CONTROL_3_IP}
72 IF 3 < ${NUM_CONTROL_NODES}
73 Copy Fernet Keys ${OS_CONTROL_1_IP} ${OS_CONTROL_4_IP}
75 IF 4 < ${NUM_CONTROL_NODES}
76 Copy Fernet Keys ${OS_CONTROL_1_IP} ${OS_CONTROL_5_IP}
78 IF 2 < ${NUM_CONTROL_NODES}
79 Chown File ${OS_CONTROL_2_IP} /etc/keystone/fernet-keys keystone keystone
81 IF 2 < ${NUM_CONTROL_NODES}
82 Chown File ${OS_CONTROL_3_IP} /etc/keystone/fernet-keys keystone keystone
84 IF 3 < ${NUM_CONTROL_NODES}
85 Chown File ${OS_CONTROL_4_IP} /etc/keystone/fernet-keys keystone keystone
87 IF 4 < ${NUM_CONTROL_NODES}
88 Chown File ${OS_CONTROL_5_IP} /etc/keystone/fernet-keys keystone keystone
90 Start Keystone ${OS_CONTROL_1_IP}
91 IF 2 < ${NUM_CONTROL_NODES} Start Keystone ${OS_CONTROL_2_IP}
92 IF 2 < ${NUM_CONTROL_NODES} Start Keystone ${OS_CONTROL_3_IP}
93 IF 2 < ${NUM_CONTROL_NODES}
94 Generic HAProxy Entry ${HAPROXY_IP} ${HAPROXY_IP} 35357 keystone-admin
96 IF 2 < ${NUM_CONTROL_NODES}
97 Generic HAProxy Entry ${HAPROXY_IP} ${HAPROXY_IP} 5000 keystone-public
99 IF 2 > ${NUM_CONTROL_NODES} Create stackrc ${OS_CONTROL_1_HOSTNAME}
100 IF 2 < ${NUM_CONTROL_NODES} Create stackrc ${HAPROXY_HOSTNAME}
101 IF 2 > ${NUM_CONTROL_NODES}
102 Setup And Bootstrap ${OS_CONTROL_1_IP} ${OS_CONTROL_1_HOSTNAME}
104 IF 2 < ${NUM_CONTROL_NODES}
105 Setup And Bootstrap ${OS_CONTROL_1_IP} ${HAPROXY_HOSTNAME}
107 Create Project Service
111 Create And Configure Keystone Db
112 [Arguments] ${os_node_cxn} ${mysql_user} ${mysql_pass} ${host_name}
113 Create Database for Mysql ${os_node_cxn} ${mysql_user} ${mysql_pass} keystone
114 Grant Privileges To Mysql Database
122 Grant Privileges To Mysql Database
130 IF 2 < ${NUM_CONTROL_NODES}
131 Grant Privileges To Mysql Database
137 ... ${HAPROXY_HOSTNAME}
141 Create And Configure Keystone Db Other Nodes
142 [Arguments] ${os_node_cxn} ${mysql_user} ${mysql_pass} ${host_name}
143 Grant Privileges To Mysql Database
151 Grant Privileges To Mysql Database
159 Grant Privileges To Mysql Database
165 ... ${HAPROXY_HOSTNAME}
168 Install Configure Keystone
169 [Arguments] ${os_node_cxn} ${host_name}
170 IF '${OS_APPS_PRE_INSTALLED}' == 'no'
171 Install Rpm Package ${os_node_cxn} openstack-keystone httpd mod_wsgi rsync
175 ... /etc/keystone/keystone.conf
178 ... "mysql+pymysql://keystone:keystone@${host_name}/keystone"
179 Crudini Edit ${os_node_cxn} /etc/keystone/keystone.conf token provider fernet
180 Crudini Edit ${os_node_cxn} /etc/keystone/keystone.conf catalog driver sql
181 Crudini Edit ${os_node_cxn} /etc/keystone/keystone.conf identity driver sql
182 IF 2 < ${NUM_CONTROL_NODES}
185 ... /etc/keystone/keystone.conf
188 ... "rabbit://openstack:rabbit@${OS_CONTROL_1_HOSTNAME},openstack:rabbit@${OS_CONTROL_2_HOSTNAME},openstack:rabbit@${OS_CONTROL_3_HOSTNAME}"
190 IF 2 > ${NUM_CONTROL_NODES}
193 ... /etc/keystone/keystone.conf
196 ... "rabbit://openstack:rabbit@${host_name}"
198 Crudini Edit ${os_node_cxn} /etc/keystone/keystone.conf oslo_messaging_rabbit rabbit_max_retries 0
199 Crudini Edit ${os_node_cxn} /etc/keystone/keystone.conf oslo_messaging_rabbit rabbit_ha_queues true
200 Create Softlink ${os_node_cxn} /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
203 [Arguments] ${os_node_cxn}
204 Enable Service ${os_node_cxn} httpd
205 Start Service ${os_node_cxn} httpd
208 [Arguments] ${os_node_cxn} ${token}
209 Crudini Edit ${os_node_cxn} /etc/keystone/keystone.conf DEFAULT admin_token ${token}
212 [Arguments] ${os_node_cxn} ${target_ip}
213 Rsync Directory ${os_node_cxn} ${target_ip} /etc/keystone/fernet-keys /etc/keystone
216 [Arguments] ${os_node_cxn} ${host_name}
217 Run Command As User ${os_node_cxn} "keystone-manage db_sync" keystone
218 Keystone Manage Bootstrap ${os_node_cxn} ${host_name} RegionOne
221 [Arguments] ${haproxy_ip}
222 Create Local File /tmp/stackrc
223 Write To Local File /tmp/stackrc "export OS_USERNAME=admin"
224 Append To Local File /tmp/stackrc "export OS_PASSWORD=admin"
225 Append To Local File /tmp/stackrc "export OS_PROJECT_NAME=admin"
226 Append To Local File /tmp/stackrc "export OS_USER_DOMAIN_NAME=Default"
227 Append To Local File /tmp/stackrc "export OS_PROJECT_DOMAIN_NAME=Default"
228 Append To Local File /tmp/stackrc "export OS_AUTH_URL=http://${haproxy_ip}:35357/v3"
229 Append To Local File /tmp/stackrc "export OS_IDENTITY_API_VERSION=3"
230 Append To Local File /tmp/stackrc "export OS_IMAGE_API_VERSION=2"
232 Create Project Service
233 Create Project default "ServiceProject" service rc_file=/tmp/stackrc
235 Keystone Manage Setup
236 [Arguments] ${os_node_cxn} ${keystone_user} ${keystone_password}
237 Switch Connection ${os_node_cxn}
238 ${output} ${rc}= Execute Command
239 ... sudo keystone-manage fernet_setup --keystone-user ${keystone_user} --keystone-group ${keystone_password}
241 ... return_stdout=True
243 Should Not Be True ${rc}
245 Keystone Manage Bootstrap
246 [Arguments] ${os_node_cxn} ${host_name} ${region_name}
247 Switch Connection ${os_node_cxn}
248 ${output} ${rc}= Execute Command
249 ... sudo keystone-manage bootstrap --bootstrap-password admin --bootstrap-admin-url http://${host_name}:35357/v3/ --bootstrap-internal-url http://${host_name}:5000/v3/ --bootstrap-public-url http://${host_name}:5000/v3/ --bootstrap-region-id ${region_name}
251 ... return_stdout=True
253 Should Not Be True ${rc}