From e65bcc9fccf4436146b2c6a42ed6f0939b9a3c8a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 31 Aug 2017 13:56:52 +0100 Subject: [PATCH] Bring back skip_without_user_xattrs helper function We'll need this to be able to skip system-mode tests without xattrs. This partially reverts commit a53a752a354a569b8cd4a1bb19e2cbfd837aac12. Signed-off-by: Simon McVittie --- tests/libtest.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/libtest.sh b/tests/libtest.sh index 04622df9..c12ffb95 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -309,6 +309,14 @@ run_sh () { ${CMD_PREFIX} flatpak run --command=bash ${ARGS-} org.test.Hello -c "$*" } +skip_without_user_xattrs () { + touch ${TEST_DATA_DIR}/test-xattrs + if ! setfattr -n user.testvalue -v somevalue ${TEST_DATA_DIR}/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