diff --git a/tests/libtest.sh b/tests/libtest.sh index 17831bf1..f074827c 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -196,6 +196,14 @@ run_sh () { ${CMD_PREFIX} flatpak run --command=bash ${ARGS-} org.test.Hello -c "$*" } +skip_without_user_xattrs () { + touch test-xattrs + if ! setfattr -n user.testvalue -v somevalue test-xattrs; then + echo "1..0 # SKIP this test requires xattr support" + exit 0 + fi +} + skip_without_bwrap () { if [ -z "${FLATPAK_BWRAP:-}" ]; then # running installed-tests: assume we know what we're doing diff --git a/tests/test-builder.sh b/tests/test-builder.sh index f4b19bee..0809f43d 100755 --- a/tests/test-builder.sh +++ b/tests/test-builder.sh @@ -22,6 +22,7 @@ set -euo pipefail . $(dirname $0)/libtest.sh skip_without_bwrap +skip_without_user_xattrs echo "1..3" diff --git a/tests/test-run.sh b/tests/test-run.sh index 4f3dc441..f9b67a67 100755 --- a/tests/test-run.sh +++ b/tests/test-run.sh @@ -22,6 +22,7 @@ set -euo pipefail . $(dirname $0)/libtest.sh skip_without_bwrap +skip_without_user_xattrs echo "1..7"