From 7ced150f8c70e1acaa4b83c25d3c9271cdb512c3 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 23 Mar 2015 15:51:54 -0400 Subject: [PATCH] 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 --- lib/tempest | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/tempest b/lib/tempest index 4ece349159..2ec353bce8 100644 --- a/lib/tempest +++ b/lib/tempest @@ -175,6 +175,10 @@ function configure_tempest { password=${ADMIN_PASSWORD:-secrete} + # Do we want to make a configuration where Tempest has admin on + # the cloud. We don't always want to so that we can ensure Tempest + # would work on a public cloud. + TEMPEST_HAS_ADMIN=$(trueorfalse True TEMPEST_HAS_ADMIN) # See files/keystone_data.sh and stack.sh where admin, demo and alt_demo # user and tenant are set up... ADMIN_USERNAME=${ADMIN_USERNAME:-admin} @@ -292,11 +296,13 @@ function configure_tempest { iniset $TEMPEST_CONFIG identity alt_username $ALT_USERNAME iniset $TEMPEST_CONFIG identity alt_password "$password" iniset $TEMPEST_CONFIG identity alt_tenant_name $ALT_TENANT_NAME - iniset $TEMPEST_CONFIG identity admin_username $ADMIN_USERNAME - iniset $TEMPEST_CONFIG identity admin_password "$password" - iniset $TEMPEST_CONFIG identity admin_tenant_name $ADMIN_TENANT_NAME - iniset $TEMPEST_CONFIG identity admin_tenant_id $ADMIN_TENANT_ID - iniset $TEMPEST_CONFIG identity admin_domain_name $ADMIN_DOMAIN_NAME + if [[ "$TEMPEST_HAS_ADMIN" == "True" ]]; then + iniset $TEMPEST_CONFIG identity admin_username $ADMIN_USERNAME + iniset $TEMPEST_CONFIG identity admin_password "$password" + iniset $TEMPEST_CONFIG identity admin_tenant_name $ADMIN_TENANT_NAME + iniset $TEMPEST_CONFIG identity admin_tenant_id $ADMIN_TENANT_ID + iniset $TEMPEST_CONFIG identity admin_domain_name $ADMIN_DOMAIN_NAME + fi iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2} if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then iniset $TEMPEST_CONFIG identity ca_certificates_file $SSL_BUNDLE_FILE @@ -310,6 +316,9 @@ function configure_tempest { fi # Auth + # + # + TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-$TEMPEST_HAS_ADMIN} iniset $TEMPEST_CONFIG auth allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True} iniset $TEMPEST_CONFIG auth tempest_roles "Member"