Browse code

Add variable to indicated if Tempest should have admin

This commit adds a new flag, TEMPEST_HAS_ADMIN, to enable or disable
setting admin credentials in the tempest config file. This allows for
devstack / tempest configurations where tempest doesn't have admin to
ensure it would work in public cloud scenarios.

Change-Id: Id983417801e4b276334fb9e700f2c8e6ab78f9ba

Matthew Treinish authored on 2015/03/24 04:51:54
Showing 1 changed files
... ...
@@ -175,6 +175,10 @@ function configure_tempest {
175 175
 
176 176
     password=${ADMIN_PASSWORD:-secrete}
177 177
 
178
+    # Do we want to make a configuration where Tempest has admin on
179
+    # the cloud. We don't always want to so that we can ensure Tempest
180
+    # would work on a public cloud.
181
+    TEMPEST_HAS_ADMIN=$(trueorfalse True TEMPEST_HAS_ADMIN)
178 182
     # See files/keystone_data.sh and stack.sh where admin, demo and alt_demo
179 183
     # user and tenant are set up...
180 184
     ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
... ...
@@ -292,11 +296,13 @@ function configure_tempest {
292 292
     iniset $TEMPEST_CONFIG identity alt_username $ALT_USERNAME
293 293
     iniset $TEMPEST_CONFIG identity alt_password "$password"
294 294
     iniset $TEMPEST_CONFIG identity alt_tenant_name $ALT_TENANT_NAME
295
-    iniset $TEMPEST_CONFIG identity admin_username $ADMIN_USERNAME
296
-    iniset $TEMPEST_CONFIG identity admin_password "$password"
297
-    iniset $TEMPEST_CONFIG identity admin_tenant_name $ADMIN_TENANT_NAME
298
-    iniset $TEMPEST_CONFIG identity admin_tenant_id $ADMIN_TENANT_ID
299
-    iniset $TEMPEST_CONFIG identity admin_domain_name $ADMIN_DOMAIN_NAME
295
+    if [[ "$TEMPEST_HAS_ADMIN" == "True" ]]; then
296
+        iniset $TEMPEST_CONFIG identity admin_username $ADMIN_USERNAME
297
+        iniset $TEMPEST_CONFIG identity admin_password "$password"
298
+        iniset $TEMPEST_CONFIG identity admin_tenant_name $ADMIN_TENANT_NAME
299
+        iniset $TEMPEST_CONFIG identity admin_tenant_id $ADMIN_TENANT_ID
300
+        iniset $TEMPEST_CONFIG identity admin_domain_name $ADMIN_DOMAIN_NAME
301
+    fi
300 302
     iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
301 303
     if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
302 304
         iniset $TEMPEST_CONFIG identity ca_certificates_file $SSL_BUNDLE_FILE
... ...
@@ -310,6 +316,9 @@ function configure_tempest {
310 310
     fi
311 311
 
312 312
     # Auth
313
+    #
314
+    #
315
+    TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-$TEMPEST_HAS_ADMIN}
313 316
     iniset $TEMPEST_CONFIG auth allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
314 317
     iniset $TEMPEST_CONFIG auth tempest_roles "Member"
315 318