From dbd08d088a7e13ff9630d2ca3340257b6fb1d47b Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Fri, 23 Feb 2024 12:56:35 -0500 Subject: [PATCH 1/3] tests/cluster: use --quiet to just get the token Signed-off-by: Simon Deziel --- tests/cluster | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cluster b/tests/cluster index 9cf07d84b..ee0d2fc0b 100755 --- a/tests/cluster +++ b/tests/cluster @@ -68,7 +68,7 @@ for i in $(seq "${SIZE}"); do MEMBER_IP=$(lxc exec "${PREFIX}-$i" -- ip -4 addr show dev eth0 scope global | grep inet | cut -d' ' -f6 | cut -d/ -f1) # Get a join token - TOKEN="$(lxc exec "${PREFIX}-1" -- lxc cluster add "${PREFIX}-${i}" | tail -n1)" + TOKEN="$(lxc exec "${PREFIX}-1" -- lxc cluster add --quiet "${PREFIX}-${i}")" lxc exec "${PREFIX}-$i" -- lxd init --preseed << EOF cluster: From c254813563857d50ae35fda276ffb94b8e51117c Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Fri, 23 Feb 2024 12:59:39 -0500 Subject: [PATCH 2/3] bin/helpers: always run the extra_cleanup and with halt on error Signed-off-by: Simon Deziel --- bin/helpers | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/helpers b/bin/helpers index f058bd531..28cb75267 100644 --- a/bin/helpers +++ b/bin/helpers @@ -167,6 +167,12 @@ createPowerFlexPool() ( # cleanup: report if the test passed or not and return the appropriate return code. cleanup() { + # Run any extra cleanup function + if command -v extra_cleanup > /dev/null; then + trap + extra_cleanup + fi + set +e echo "" if [ "${FAIL}" = "1" ]; then @@ -188,11 +194,6 @@ cleanup() { exit 1 fi - # Run any extra cleanup function only on success - if command -v extra_cleanup > /dev/null; then - extra_cleanup || true - fi - echo "Test passed" exit 0 } From 6e6bd2cc329ba5c8d04149810d9e6309de7e09b4 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Fri, 23 Feb 2024 13:12:56 -0500 Subject: [PATCH 3/3] github: reclaim space for storage tests only Signed-off-by: Simon Deziel --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c5040f95..80f32e351 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -108,7 +108,8 @@ jobs: # disable dpkg from calling sync() echo "force-unsafe-io" | sudo tee /etc/dpkg/dpkg.cfg.d/force-unsafe-io - - name: Reclaim some space + - name: Reclaim some space (storage tests only) + if: ${{ startsWith(matrix.test, 'storage') }} run: | set -eux df -h