Fixes LP #996571 - Alternate Tempest user
Adds an alternate user to Keystone for Tempest
Tempest has a number of tests that are skipped if
the compute.alt_username is the same as compute.username
or None. Here, we modify files/keystone_data.sh to add
an additional regular user called alt_demo if Tempest
is enabled in stackrc. We also make corresponding changes
to the tools/configure_tempest.sh script to make use
of this alternate user credential
Change-Id: I551f3b378f843c62fffcf6effa916056708d54d3
diff --git a/files/keystone_data.sh b/files/keystone_data.sh
index a49eb42..9e994fd 100755
--- a/files/keystone_data.sh
+++ b/files/keystone_data.sh
@@ -12,6 +12,8 @@
# demo admin admin
# demo demo Member, anotherrole
# invisible_to_admin demo Member
+# Tempest Only:
+# alt_demo alt_demo Member
#
# Variables set before calling this script:
# SERVICE_TOKEN - aka admin_token in keystone.conf
@@ -116,3 +118,13 @@
--user $QUANTUM_USER \
--role $ADMIN_ROLE
fi
+
+if [[ "$ENABLED_SERVICES" =~ "tempest" ]]; then
+ # Tempest has some tests that validate various authorization checks
+ # between two regular users in separate tenants
+ ALT_DEMO_TENANT=$(get_id keystone tenant-create --name=alt_demo)
+ ALT_DEMO_USER=$(get_id keystone user-create --name=alt_demo \
+ --pass="$ADMIN_PASSWORD" \
+ --email=alt_demo@example.com)
+ keystone user-role-add --user $ALT_DEMO_USER --role $MEMBER_ROLE --tenant_id $ALT_DEMO_TENANT
+fi