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 <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2024-02-19 16:07:13 +00:00
parent a84e56d603
commit 37466ec35b
3 changed files with 4 additions and 15 deletions

View File

@ -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"

View File

@ -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'

View File

@ -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"