From 86a981390b172a41ac895039481a7e1544bf0374 Mon Sep 17 00:00:00 2001 From: nam Date: Fri, 8 Nov 2019 16:39:49 +0100 Subject: [PATCH] make test less error prone on log changes --- tests/suites/cli/use_local_charm.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/suites/cli/use_local_charm.sh b/tests/suites/cli/use_local_charm.sh index bdf694c4defd..a27b310bd3e8 100644 --- a/tests/suites/cli/use_local_charm.sh +++ b/tests/suites/cli/use_local_charm.sh @@ -21,7 +21,7 @@ run_deploy_local_charm_revision() { # If a error happens it means it could not use the git sha of the CWD check_not_contains "${OUTPUT}" "exit status 128" - if [ "${SHA_OF_NTP}" != "${CURRENT_CHARM_SHA}" ]; then + if [[ "${SHA_OF_NTP}" != "${CURRENT_CHARM_SHA}" ]]; then echo "The expected sha does not equal the ntp SHA" exit 1 fi @@ -72,9 +72,7 @@ run_deploy_local_charm_revision_no_vcs_but_version_file() { wait_for "ntp" ".applications | keys[0]" CURRENT_CHARM_SHA=$(juju status --format=json | jq '.applications.ntp."charm-version"') - check_contains "${DEPLOY_OUTPUT}" "charm is not in version control and uses a version file" - - if [ "${VERSION_OUTPUT}" != "${CURRENT_CHARM_SHA}" ]; then + if [[ "${VERSION_OUTPUT}" != "${CURRENT_CHARM_SHA}" ]]; then echo "The expected sha does not equal the ntp SHA. Current sha: ${CURRENT_CHARM_SHA} expected sha: ${VERSION_OUTPUT}" exit 1 fi @@ -107,12 +105,12 @@ run_deploy_local_charm_revision_relative_path() { # We still expect the SHA to be the one from the place we deploy and not the CWD, which in this case has no SHA CURRENT_CHARM_SHA=$(juju status --format=json | jq '.applications.ntp."charm-version"') - if [ "${SHA_OF_TMP}" = "${CURRENT_CHARM_SHA}" ]; then + if [[ "${SHA_OF_TMP}" = "${CURRENT_CHARM_SHA}" ]]; then echo "The expected sha should not equal the tmp SHA. Current sha: ${CURRENT_CHARM_SHA}" exit 1 fi - if [ "${SHA_OF_NTP}" != "${CURRENT_CHARM_SHA}" ]; then + if [[ "${SHA_OF_NTP}" != "${CURRENT_CHARM_SHA}" ]]; then echo "The expected sha does not equal the ntp SHA. Current sha: ${CURRENT_CHARM_SHA} expected sha: ${SHA_OF_NTP}" exit 1 fi @@ -146,7 +144,7 @@ run_deploy_local_charm_revision_invalid_git() { wait_for "ntp" ".applications | keys[0]" # We still expect the SHA to be the one from the place we deploy and not the CWD, which in this case has no SHA CURRENT_CHARM_SHA=$(juju status --format=json | jq '.applications.ntp."charm-version"') - if [ "${WANTED_CHARM_SHA}" != "${CURRENT_CHARM_SHA}" ]; then + if [[ "${WANTED_CHARM_SHA}" != "${CURRENT_CHARM_SHA}" ]]; then echo "The expected sha does not equal the ntp SHA. Current sha: ${CURRENT_CHARM_SHA} expected sha: ${WANTED_CHARM_SHA}" exit 1 fi