From: Simon McVittie Date: Mon, 19 Feb 2024 16:07:13 +0000 (+0000) Subject: tests: Use skip_without_ostree_feature to detect libarchive, composefs X-Git-Tag: archive/raspbian/2024.8-1+rpi1^2~7^2~4^2~7^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=37466ec35be98c9c79abd34c7a5bb52a21dec010;p=ostree.git tests: Use skip_without_ostree_feature to detect libarchive, composefs This avoids false negatives from `ostree --version | grep -q ...` exiting with failure under `set -o pipefail` because `grep -q` can exit as soon as it sees the desired string, leaving `ostree --version` to be terminated by `SIGPIPE` next time it writes to stdout. Signed-off-by: Simon McVittie --- diff --git a/tests/test-composefs.sh b/tests/test-composefs.sh index d05579f5..f0f5cac1 100755 --- a/tests/test-composefs.sh +++ b/tests/test-composefs.sh @@ -19,11 +19,7 @@ set -euo pipefail . $(dirname $0)/libtest.sh -if ! ${CMD_PREFIX} ostree --version | grep -q -e '- composefs'; then - echo "1..0 #SKIP no composefs support compiled in" - exit 0 -fi - +skip_without_ostree_feature composefs skip_without_user_xattrs setup_test_repository "bare-user" diff --git a/tests/test-export.sh b/tests/test-export.sh index 6b8de94c..23e51666 100755 --- a/tests/test-export.sh +++ b/tests/test-export.sh @@ -19,13 +19,9 @@ set -euo pipefail -if ! ostree --version | grep -q -e '- libarchive'; then - echo "1..0 #SKIP no libarchive support compiled in" - exit 0 -fi - . $(dirname $0)/libtest.sh +skip_without_ostree_feature libarchive setup_test_repository "archive" echo '1..6' diff --git a/tests/test-libarchive.sh b/tests/test-libarchive.sh index 63175023..d9ce37b2 100755 --- a/tests/test-libarchive.sh +++ b/tests/test-libarchive.sh @@ -19,13 +19,10 @@ set -euo pipefail -if ! ostree --version | grep -q -e '- libarchive'; then - echo "1..0 #SKIP no libarchive support compiled in" - exit 0 -fi - . $(dirname $0)/libtest.sh +skip_without_ostree_feature libarchive + echo "1..18" setup_test_repository "bare"