From 8ebb89180f65afb05dd4921fc3ab255b9c89fb02 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Wed, 13 Mar 2019 19:09:09 -0500 Subject: [PATCH] HTK: Remove helm test rally user by default following run This PS updates the helm test script to remove the rally user by default following a test run. Change-Id: I5a28244f8f8bd8ef485cb45cc922601d631adff1 Depends-On: https://review.openstack.org/#/c/643206/ Signed-off-by: Pete Birley --- helm-toolkit/templates/scripts/_rally_test.sh.tpl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/helm-toolkit/templates/scripts/_rally_test.sh.tpl b/helm-toolkit/templates/scripts/_rally_test.sh.tpl index 9d0912e09..5c0d01c0f 100644 --- a/helm-toolkit/templates/scripts/_rally_test.sh.tpl +++ b/helm-toolkit/templates/scripts/_rally_test.sh.tpl @@ -21,6 +21,16 @@ set -ex : "${RALLY_ENV_NAME:="openstack-helm"}" : "${OS_INTERFACE:="public"}" +: "${AUTO_REMOVE_USER:="true"}" + +if [ "x$AUTO_REMOVE_USER" == "xtrue" ]; then + function remove_rally_user { + openstack user delete \ + --domain="${SERVICE_OS_USER_DOMAIN_NAME}" \ + "${SERVICE_OS_USERNAME}" + } + trap remove_rally_user EXIT +fi function create_or_update_db () { revisionResults=$(rally db revision)