From a461eb50fae6274fe24daffe4d5ba60cfa1f73e9 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 23 May 2016 20:38:51 +0100 Subject: [PATCH] Skip tests that make a repository if /var/tmp lacks user xattrs Signed-off-by: Simon McVittie --- tests/libtest.sh | 8 ++++++++ tests/test-builder.sh | 1 + tests/test-run.sh | 1 + 3 files changed, 10 insertions(+) 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"