summaryrefslogtreecommitdiff
path: root/tests/t4_fuse.py
diff options
context:
space:
mode:
authorNikolaus Rath <Nikolaus@rath.org>2016-03-09 10:09:35 -0800
committerNikolaus Rath <Nikolaus@rath.org>2016-03-09 10:09:35 -0800
commit181ca7febce49f2c2ee17e4615cc528ad03431b6 (patch)
tree5c076ba85f3e8b8c17c6531d2e4af9cec1072007 /tests/t4_fuse.py
parentac9526150a54ca66ed041376e3081d719f77ce49 (diff)
Import s3ql_2.10.1+dfsg.orig.tar.gz
Diffstat (limited to 'tests/t4_fuse.py')
-rwxr-xr-xtests/t4_fuse.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/t4_fuse.py b/tests/t4_fuse.py
index 5ec355f..aafb09c 100755
--- a/tests/t4_fuse.py
+++ b/tests/t4_fuse.py
@@ -2,7 +2,7 @@
'''
t4_fuse.py - this file is part of S3QL (http://s3ql.googlecode.com)
-Copyright (C) 2008-2009 Nikolaus Rath <Nikolaus@rath.org>
+Copyright © 2008 Nikolaus Rath <Nikolaus@rath.org>
This program can be distributed under the terms of the GNU GPLv3.
'''
@@ -13,7 +13,8 @@ if __name__ == '__main__':
sys.exit(pytest.main([__file__] + sys.argv[1:]))
from os.path import basename
-from s3ql.common import CTRL_NAME, PICKLE_PROTOCOL, path2bytes
+from s3ql import CTRL_NAME, PICKLE_PROTOCOL
+from s3ql.common import path2bytes
from common import retry, skip_if_no_fusermount
import pickle
import filecmp
@@ -71,7 +72,7 @@ class fuse_tests(unittest.TestCase):
self.assertEqual(proc.wait(), 0)
- def mount(self, fatal_warnings=True):
+ def mount(self, fatal_warnings=True, expect_fail=None):
cmd = (self.s3ql_cmd_argv('mount.s3ql') +
["--fg", '--cachedir', self.cache_dir, '--log', 'none',
'--compress', 'zlib', '--quiet', self.storage_url, self.mnt_dir,
@@ -85,11 +86,16 @@ class fuse_tests(unittest.TestCase):
print(self.backend_passphrase, file=self.mount_process.stdin)
print(self.passphrase, file=self.mount_process.stdin)
self.mount_process.stdin.close()
- def poll():
- if os.path.ismount(self.mnt_dir):
- return True
- self.assertIsNone(self.mount_process.poll())
- retry(30, poll)
+
+ if expect_fail:
+ retry(30, self.mount_process.poll)
+ assert self.mount_process.returncode == expect_fail
+ else:
+ def poll():
+ if os.path.ismount(self.mnt_dir):
+ return True
+ self.assertIsNone(self.mount_process.poll())
+ retry(30, poll)
def umount(self):
with open('/dev/null', 'wb') as devnull: