From 697ad33cd76b97a05898c8b57a38de6d060227b0 Mon Sep 17 00:00:00 2001 From: Vitaly Antonenko Date: Thu, 11 Aug 2022 10:16:18 +0300 Subject: [PATCH 1/3] Fixed whitespace issue in case MODEL_ARCH is undefined. --- tests/suites/deploy/deploy_bundles.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/suites/deploy/deploy_bundles.sh b/tests/suites/deploy/deploy_bundles.sh index ad197e2ff22..534794660cf 100644 --- a/tests/suites/deploy/deploy_bundles.sh +++ b/tests/suites/deploy/deploy_bundles.sh @@ -68,11 +68,14 @@ run_deploy_exported_charmstore_bundle_with_fixed_revisions() { echo "Make a copy of reference yaml" cp ${bundle} "${TEST_DIR}/telegraf_bundle.yaml" - if [[ -n ${MODEL_ARCH:-} ]]; then + if [[ -n ${MODEL_ARCH:-} ]]; + then yq -i " .machines.\"0\".constraints = \"arch=${MODEL_ARCH}\" | .machines.\"1\".constraints = \"arch=${MODEL_ARCH}\" " "${TEST_DIR}/telegraf_bundle.yaml" + else + yq -i . "${TEST_DIR}/telegraf_bundle-bundle.yaml" fi # no need to wait for the bundle to finish deploying to # check the export. From 804a974cfd58028aa98776a00cd6a66a8af864aa Mon Sep 17 00:00:00 2001 From: Vitaly Antonenko Date: Thu, 11 Aug 2022 10:29:58 +0300 Subject: [PATCH 2/3] Fixed statis-analysis.. --- tests/suites/deploy/deploy_bundles.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/suites/deploy/deploy_bundles.sh b/tests/suites/deploy/deploy_bundles.sh index 534794660cf..ef3702f23a4 100644 --- a/tests/suites/deploy/deploy_bundles.sh +++ b/tests/suites/deploy/deploy_bundles.sh @@ -68,8 +68,7 @@ run_deploy_exported_charmstore_bundle_with_fixed_revisions() { echo "Make a copy of reference yaml" cp ${bundle} "${TEST_DIR}/telegraf_bundle.yaml" - if [[ -n ${MODEL_ARCH:-} ]]; - then + if [[ -n ${MODEL_ARCH:-} ]]; then yq -i " .machines.\"0\".constraints = \"arch=${MODEL_ARCH}\" | .machines.\"1\".constraints = \"arch=${MODEL_ARCH}\" From f442c921fde84d1a65443f00eb193352f9466fe0 Mon Sep 17 00:00:00 2001 From: Vitaly Antonenko Date: Thu, 11 Aug 2022 11:03:32 +0300 Subject: [PATCH 3/3] Remnamed exported-bundle.yaml to exported_bundle.yaml. --- tests/suites/deploy/deploy_bundles.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/suites/deploy/deploy_bundles.sh b/tests/suites/deploy/deploy_bundles.sh index ef3702f23a4..98f6de5ef17 100644 --- a/tests/suites/deploy/deploy_bundles.sh +++ b/tests/suites/deploy/deploy_bundles.sh @@ -74,13 +74,14 @@ run_deploy_exported_charmstore_bundle_with_fixed_revisions() { .machines.\"1\".constraints = \"arch=${MODEL_ARCH}\" " "${TEST_DIR}/telegraf_bundle.yaml" else - yq -i . "${TEST_DIR}/telegraf_bundle-bundle.yaml" + yq -i . "${TEST_DIR}/telegraf_bundle.yaml" fi # no need to wait for the bundle to finish deploying to # check the export. - juju export-bundle --filename "${TEST_DIR}/exported-bundle.yaml" - yq -i . "${TEST_DIR}/exported-bundle.yaml" - diff -u "${TEST_DIR}/telegraf_bundle.yaml" "${TEST_DIR}/exported-bundle.yaml" + echo "Compare export-bundle with telegraf_bundle" + juju export-bundle --filename "${TEST_DIR}/exported_bundle.yaml" + yq -i . "${TEST_DIR}/exported_bundle.yaml" + diff -u "${TEST_DIR}/telegraf_bundle.yaml" "${TEST_DIR}/exported_bundle.yaml" destroy_model "test-export-bundles-deploy-with-fixed-revisions" } @@ -120,10 +121,10 @@ run_deploy_exported_charmhub_bundle_with_float_revisions() { # The model should be updated immediately, so we can export the bundle before # everything is done deploying echo "Compare export-bundle with telegraf_bundle_with_revisions" - juju export-bundle --filename "${TEST_DIR}/exported-bundle.yaml" + juju export-bundle --filename "${TEST_DIR}/exported_bundle.yaml" # reformat the yaml to have the same format as telegraf_bundle_with_revisions.yaml - yq -i . "${TEST_DIR}/exported-bundle.yaml" - diff -u "${TEST_DIR}/telegraf_bundle_with_revisions.yaml" "${TEST_DIR}/exported-bundle.yaml" + yq -i . "${TEST_DIR}/exported_bundle.yaml" + diff -u "${TEST_DIR}/telegraf_bundle_with_revisions.yaml" "${TEST_DIR}/exported_bundle.yaml" destroy_model "test-export-bundles-deploy-with-float-revisions" }