From: Simon McVittie Date: Tue, 29 Aug 2017 16:02:18 +0000 (+0100) Subject: libtest: Allow skipping single checks without user xattrs X-Git-Tag: archive/raspbian/2017.12-1+rpi1~1^2^2^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=beff8aed7fbbcd9ff4776dfff036bfe6204a08f0;p=ostree.git libtest: Allow skipping single checks without user xattrs Signed-off-by: Simon McVittie Gbp-Pq: Name libtest-Allow-skipping-single-checks-without-user-xattrs.patch --- diff --git a/tests/libtest.sh b/tests/libtest.sh index ff096505..7f334c02 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -489,6 +489,17 @@ os_repository_new_commit () cd ${test_tmpdir} } +# Usage: if ! skip_one_without_user_xattrs; then ... more tests ...; fi +skip_one_without_user_xattrs () { + touch test-xattrs + if ! setfattr -n user.testvalue -v somevalue test-xattrs; then + echo "ok # SKIP - this test requires xattr support" + return 0 + else + return 1 + fi +} + skip_without_user_xattrs () { touch test-xattrs setfattr -n user.testvalue -v somevalue test-xattrs || \