summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2016-03-31 11:06:05 +0100
committerColin Walters (automation) <walters+githubbot@verbum.org>2016-03-31 14:22:06 +0000
commit3e3755c497bd85e22b01829c5715119d46394687 (patch)
tree8f4c944ba2114b3219740c3f49388a3816eca991
parentc276025466af4319d603fe8b534dd3463818a168 (diff)
downloadostree-3e3755c497bd85e22b01829c5715119d46394687.tar.gz
various tests: skip if temp directory lacks xattr support
Some autobuilder environments place the entire build chroot on tmpfs, so even /var/tmp might not have this. Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #232 Approved by: cgwalters
-rwxr-xr-xtests/libtest.sh8
-rwxr-xr-xtests/test-basic-user.sh6
-rwxr-xr-xtests/test-delta.sh2
-rwxr-xr-xtests/test-demo-buildsystem.sh2
-rwxr-xr-xtests/test-local-pull.sh6
-rwxr-xr-xtests/test-prune.sh2
-rwxr-xr-xtests/test-rofiles-fuse.sh3
7 files changed, 25 insertions, 4 deletions
diff --git a/tests/libtest.sh b/tests/libtest.sh
index 06982d21..21de2e87 100755
--- a/tests/libtest.sh
+++ b/tests/libtest.sh
@@ -324,3 +324,11 @@ os_repository_new_commit ()
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string "version=${version}" -b testos/buildmaster/x86_64-runtime -s "Build"
cd ${test_tmpdir}
}
+
+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
+}
diff --git a/tests/test-basic-user.sh b/tests/test-basic-user.sh
index f53de89a..42e6a864 100755
--- a/tests/test-basic-user.sh
+++ b/tests/test-basic-user.sh
@@ -19,10 +19,12 @@
set -euo pipefail
-echo "1..1"
-
. $(dirname $0)/libtest.sh
+skip_without_user_xattrs
+
+echo "1..1"
+
setup_test_repository "bare-user"
echo "ok setup"
diff --git a/tests/test-delta.sh b/tests/test-delta.sh
index 12f54c7d..a6fd6f88 100755
--- a/tests/test-delta.sh
+++ b/tests/test-delta.sh
@@ -21,6 +21,8 @@ set -euo pipefail
. $(dirname $0)/libtest.sh
+skip_without_user_xattrs
+
bindatafiles="bash true ostree"
morebindatafiles="false ls"
diff --git a/tests/test-demo-buildsystem.sh b/tests/test-demo-buildsystem.sh
index 500eac68..bffa59c4 100755
--- a/tests/test-demo-buildsystem.sh
+++ b/tests/test-demo-buildsystem.sh
@@ -26,6 +26,8 @@ fi
. $(dirname $0)/libtest.sh
+skip_without_user_xattrs
+
echo "1..1"
# Run "triggers" like ldconfig, gtk-update-icon-cache, etc.
diff --git a/tests/test-local-pull.sh b/tests/test-local-pull.sh
index a9beb083..50ecbcb7 100755
--- a/tests/test-local-pull.sh
+++ b/tests/test-local-pull.sh
@@ -19,10 +19,12 @@
set -euo pipefail
-echo "1..1"
-
. $(dirname $0)/libtest.sh
+skip_without_user_xattrs
+
+echo "1..1"
+
setup_test_repository "archive-z2"
echo "ok setup"
diff --git a/tests/test-prune.sh b/tests/test-prune.sh
index 7184ea9c..e1796a33 100755
--- a/tests/test-prune.sh
+++ b/tests/test-prune.sh
@@ -21,6 +21,8 @@ set -euo pipefail
. $(dirname $0)/libtest.sh
+skip_without_user_xattrs
+
setup_fake_remote_repo1 "archive-z2"
echo '1..2'
diff --git a/tests/test-rofiles-fuse.sh b/tests/test-rofiles-fuse.sh
index 444fbce2..ba45959e 100755
--- a/tests/test-rofiles-fuse.sh
+++ b/tests/test-rofiles-fuse.sh
@@ -25,6 +25,9 @@ if ! fusermount --version >/dev/null 2>&1; then
fi
. $(dirname $0)/libtest.sh
+
+skip_without_user_xattrs
+
setup_test_repository "bare-user"
echo "1..5"