From 42089c0e5ff57a2eec73168e904fe38fb1e04907 Mon Sep 17 00:00:00 2001 From: Jaesang Lee Date: Thu, 20 Dec 2018 05:29:34 +0000 Subject: [PATCH] Fix rally deployment config to rally 1.3.0 This PS fixed rally deployment config to latest format. After rally refactoring, the deployment config format has been simplified, and the old format is no longer available. The rally deployment config used by the helm-toolkit also needs to be changed to support the latest rally. Change-Id: I490fe0cde8f0f53bb93e3b69633e8e48af39bdb3 Related-Id: I380a976c0f48c4af0796c9d866fc8787025ce548 --- .../templates/scripts/_rally_test.sh.tpl | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/helm-toolkit/templates/scripts/_rally_test.sh.tpl b/helm-toolkit/templates/scripts/_rally_test.sh.tpl index 368f77e9f..e504ce5d5 100644 --- a/helm-toolkit/templates/scripts/_rally_test.sh.tpl +++ b/helm-toolkit/templates/scripts/_rally_test.sh.tpl @@ -22,21 +22,32 @@ set -ex : "${RALLY_ENV_NAME:="openstack-helm"}" : "${OS_INTERFACE:="public"}" -rally-manage db create +function create_or_update_db () { + revisionResults=$(rally db revision) + if [ $revisionResults = "None" ] + then + rally db create + else + rally db upgrade + fi +} + +create_or_update_db + cat > /tmp/rally-config.json << EOF { - "type": "ExistingCloud", - "auth_url": "${OS_AUTH_URL}", - "region_name": "${OS_REGION_NAME}", - "endpoint_type": "${OS_INTERFACE}", - "admin": { - "username": "${OS_USERNAME}", - "password": "${OS_PASSWORD}", - "project_name": "${OS_PROJECT_NAME}", - "user_domain_name": "${OS_USER_DOMAIN_NAME}", - "project_domain_name": "${OS_PROJECT_DOMAIN_NAME}" - }, - "users": [ + "openstack": { + "auth_url": "${OS_AUTH_URL}", + "region_name": "${OS_REGION_NAME}", + "endpoint_type": "${OS_INTERFACE}", + "admin": { + "username": "${OS_USERNAME}", + "password": "${OS_PASSWORD}", + "user_domain_name": "${OS_USER_DOMAIN_NAME}", + "project_name": "${OS_PROJECT_NAME}", + "project_domain_name": "${OS_PROJECT_DOMAIN_NAME}" + }, + "users": [ { "username": "${SERVICE_OS_USERNAME}", "password": "${SERVICE_OS_PASSWORD}", @@ -44,7 +55,9 @@ cat > /tmp/rally-config.json << EOF "user_domain_name": "${SERVICE_OS_USER_DOMAIN_NAME}", "project_domain_name": "${SERVICE_OS_PROJECT_DOMAIN_NAME}" } - ] + "https_insecure": false, + "https_cacert": "" + } } EOF rally deployment create --file /tmp/rally-config.json --name "${RALLY_ENV_NAME}" @@ -59,6 +72,6 @@ rally verify delete-verifier --id "${RALLY_ENV_NAME}-tempest" --force {{- end }} rally task validate /etc/rally/rally_tests.yaml rally task start /etc/rally/rally_tests.yaml -rally deployment destroy --deployment "${RALLY_ENV_NAME}" rally task sla-check +rally deployment destroy --deployment "${RALLY_ENV_NAME}" {{- end }}