aboutsummaryrefslogtreecommitdiff
path: root/test/util.py
diff options
context:
space:
mode:
authorNikolaus Rath <Nikolaus@rath.org>2018-11-18 17:12:40 +0000
committerNikolaus Rath <Nikolaus@rath.org>2018-12-22 14:31:52 +0000
commit9ced6ca681050ac9d5ee8961a75d86cd508cf1e3 (patch)
treef48c2155a58ea0fb472f7860db44027836978e65 /test/util.py
parentde11ec091e6f01ea15683ae4c813742bde009dc3 (diff)
downloadsshfs-9ced6ca681050ac9d5ee8961a75d86cd508cf1e3.tar
sshfs-9ced6ca681050ac9d5ee8961a75d86cd508cf1e3.tar.gz
sshfs-9ced6ca681050ac9d5ee8961a75d86cd508cf1e3.tar.bz2
sshfs-9ced6ca681050ac9d5ee8961a75d86cd508cf1e3.zip
Kill filesystem process on test cleanup.
Diffstat (limited to 'test/util.py')
-rw-r--r--test/util.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/util.py b/test/util.py
index f2a485c..34f1049 100644
--- a/test/util.py
+++ b/test/util.py
@@ -20,10 +20,16 @@ def wait_for_mount(mount_process, mnt_dir,
elapsed += 0.1
pytest.fail("mountpoint failed to come up")
-def cleanup(mnt_dir):
+def cleanup(mount_process, mnt_dir):
subprocess.call(['fusermount', '-z', '-u', mnt_dir],
stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT)
+ mount_process.terminate()
+ try:
+ mount_process.wait(1)
+ except subprocess.TimeoutExpired:
+ mount_process.kill()
+
def umount(mount_process, mnt_dir):
subprocess.check_call(['fusermount', '-z', '-u', mnt_dir ])