From a6b1bd293dbc836be878b76e76b889920ffcf335 Mon Sep 17 00:00:00 2001 From: Tin Lam Date: Sat, 21 Sep 2019 00:55:37 -0500 Subject: [PATCH] Add ability to add rally cleanup script This patch set provides a way to specify clean up scripts for rally tests to clean up orphaned resources in the event of rally test failures. Change-Id: Ifc988002711d34186975988abb33ecd8a9a2fba4 Signed-off-by: Tin Lam --- helm-toolkit/templates/scripts/_rally_test.sh.tpl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/helm-toolkit/templates/scripts/_rally_test.sh.tpl b/helm-toolkit/templates/scripts/_rally_test.sh.tpl index 6d44496d6..a7b614a61 100644 --- a/helm-toolkit/templates/scripts/_rally_test.sh.tpl +++ b/helm-toolkit/templates/scripts/_rally_test.sh.tpl @@ -21,15 +21,16 @@ set -ex : "${RALLY_ENV_NAME:="openstack-helm"}" : "${OS_INTERFACE:="public"}" -: "${AUTO_REMOVE_USER:="true"}" +: "${RALLY_CLEANUP:="true"}" -if [ "x$AUTO_REMOVE_USER" == "xtrue" ]; then - function remove_rally_user { +if [ "x$RALLY_CLEANUP" == "xtrue" ]; then + function rally_cleanup { openstack user delete \ --domain="${SERVICE_OS_USER_DOMAIN_NAME}" \ "${SERVICE_OS_USERNAME}" +{{ $rallyTests.clean_up | default "" | indent 4 }} } - trap remove_rally_user EXIT + trap rally_cleanup EXIT fi function create_or_update_db () {