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/2022.1-3+rpi1~1^2~4^2~32^2~58 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a7686a0c400524afeb3fad14e04c65105eaf7cdf;p=ostree.git libtest: Allow skipping single checks without user xattrs Signed-off-by: Simon McVittie Closes: #1120 Approved by: cgwalters --- diff --git a/tests/libtest.sh b/tests/libtest.sh index 4db8b730..73e88891 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -511,6 +511,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 || \