aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-13 09:07:55 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-13 11:02:04 -0700
commita47dedd47f79685c1b025331d30de7d998e1c4b7 (patch)
treecfcbb9db5b5a6b5eb2027604fa3a4d8c1450ac15 /Makefile.am
parentfaf109f1d25df6e374582f3ad96e39b4f9354646 (diff)
tests: use freshly-build fusermount (instead of system version)
When running tests as non-root, make fusermount setuid root.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am15
1 files changed, 14 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 54aee13..25d88d0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,6 +15,19 @@ pkgconfig_DATA = fuse3.pc
$(pkgconfig_DATA): config.status
+.PHONY: setuid_fusermount
+setuid_fusermount:
+ @echo "Attempting to use sudo to make util/fusermount setuid root"
+ @echo "If this fails, set permissions manually and re-run make test"
+ test $$(ls -n util/fusermount | awk 'NR==1 {print $$3}') -eq 0 || \
+ sudo chown root util/fusermount
+ test -u util/fusermount || \
+ sudo chmod u+s util/fusermount
+
+# If we are not root, util/fusermount needs to be setuid root
+# for tests to work.
+
+test_deps = $(shell [ "$${UID}" -eq 0 ] || echo setuid_fusermount)
.PHONY: test
-test: all
+test: all $(test_deps)
python3 -m pytest test/