[neon/backports-focal/xdg-desktop-portal/Neon/unstable] tests: tests: Disable fuse tests if fuse is not available

Alexander Larsson null at kde.org
Wed Jan 13 06:32:42 GMT 2021


Git commit 1a4243558b9a087777dc218e176ca12552ac43bb by Alexander Larsson.
Committed on 03/04/2020 at 07:05.
Pushed by ash into branch 'Neon/unstable'.

tests: Disable fuse tests if fuse is not available

This was failing the ppa build which has not fuse

M  +18   -0    tests/test-document-fuse.sh

https://invent.kde.org/neon/backports-focal/xdg-desktop-portal/commit/1a4243558b9a087777dc218e176ca12552ac43bb

diff --git a/tests/test-document-fuse.sh b/tests/test-document-fuse.sh
index fea0245..a571a16 100755
--- a/tests/test-document-fuse.sh
+++ b/tests/test-document-fuse.sh
@@ -1,5 +1,23 @@
 #!/bin/bash
 
+
+skip() {
+    echo "1..0 # SKIP" "$@"
+    exit 0
+}
+
+skip_without_fuse () {
+    fusermount --version >/dev/null 2>&1 || skip "no fusermount"
+
+    capsh --print | grep -q 'Bounding set.*[^a-z]cap_sys_admin' || \
+        skip "No cap_sys_admin in bounding set, can't use FUSE"
+
+    [ -w /dev/fuse ] || skip "no write access to /dev/fuse"
+    [ -e /etc/mtab ] || skip "no /etc/mtab"
+}
+
+skip_without_fuse
+
 echo "1..2"
 
 set -e



More information about the Neon-commits mailing list