From bfa468c7712f0e231cf1cd8837ee27880a76d9bb Mon Sep 17 00:00:00 2001 From: Maxime Guyot Date: Sat, 18 Apr 2020 15:05:36 +0200 Subject: [PATCH] Ensure upgrade CI jobs are named correctly (#5909) --- tests/scripts/testcases_run.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/scripts/testcases_run.sh b/tests/scripts/testcases_run.sh index e406efc3f..29fe77b11 100755 --- a/tests/scripts/testcases_run.sh +++ b/tests/scripts/testcases_run.sh @@ -2,9 +2,19 @@ set -euxo pipefail echo "CI_JOB_NAME is $CI_JOB_NAME" -pwd -ls -echo ${PWD} + +if [[ "$CI_JOB_NAME" =~ "upgrade" ]]; then + if [ "${UPGRADE_TEST}" == "false" ]; then + echo "Job name contains 'upgrade', but UPGRADE_TEST='false'" + exit 1 + fi +else + if [ "${UPGRADE_TEST}" != "false" ]; then + echo "UPGRADE_TEST!='false', but job names does not contain 'upgrade'" + exit 1 + fi +fi + export ANSIBLE_REMOTE_USER=$SSH_USER export ANSIBLE_BECOME=true