aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2017-08-11 10:53:56 +0200
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2017-08-11 10:53:56 +0200
commit50d9158141bede9a0f209ea11ec807880dacfec9 (patch)
tree147f4ef7d7defddc68ca2ae7af0dc0b687d33045 /test
parent1cba205140413bceb42d0a74132bdf38c7abfef8 (diff)
Don't attempt to run fusermount3 under BSD.
Diffstat (limited to 'test')
-rw-r--r--test/util.py31
1 files changed, 21 insertions, 10 deletions
diff --git a/test/util.py b/test/util.py
index 31c29a8..1cd09a1 100644
--- a/test/util.py
+++ b/test/util.py
@@ -5,6 +5,7 @@ import os
import stat
import time
from os.path import join as pjoin
+import sys
basename = pjoin(os.path.dirname(__file__), '..')
@@ -23,21 +24,28 @@ def wait_for_mount(mount_process, mnt_dir,
def cleanup(mnt_dir):
# Don't bother trying Valgrind if things already went wrong
- subprocess.call([pjoin(basename, 'util', 'fusermount3'),
- '-z', '-u', mnt_dir],
- stdout=subprocess.DEVNULL,
+ if 'bsd' in sys.platform:
+ cmd = [ 'umount', '-f', mnt_dir ]
+ else:
+ cmd = [pjoin(basename, 'util', 'fusermount3'),
+ '-z', '-u', mnt_dir]
+ subprocess.call(cmd, stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT)
def umount(mount_process, mnt_dir):
- # fusermount3 will be setuid root, so we can only trace it with
- # valgrind if we're root
- if os.getuid() == 0:
- cmdline = base_cmdline
+
+ if 'bsd' in sys.platform:
+ cmdline = [ 'umount', mnt_dir ]
else:
- cmdline = []
+ # fusermount3 will be setuid root, so we can only trace it with
+ # valgrind if we're root
+ if os.getuid() == 0:
+ cmdline = base_cmdline
+ else:
+ cmdline = []
+ cmdline = cmdline + [ pjoin(basename, 'util', 'fusermount3'),
+ '-z', '-u', mnt_dir ]
- cmdline = cmdline + [ pjoin(basename, 'util', 'fusermount3'),
- '-z', '-u', mnt_dir ]
subprocess.check_call(cmdline)
assert not os.path.ismount(mnt_dir)
@@ -79,6 +87,9 @@ def fuse_test_marker():
skip = lambda x: pytest.mark.skip(reason=x)
+ if 'bsd' in sys.platform:
+ return pytest.mark.uses_fuse()
+
with subprocess.Popen(['which', 'fusermount3'], stdout=subprocess.PIPE,
universal_newlines=True) as which:
fusermount_path = which.communicate()[0].strip()