Signed-off-by: Justin Husted <sigstop@gmail.com>
bfuse.unmount()
bfuse.verify()
bfuse.unmount()
bfuse.verify()
+def test_remount(bfuse):
+ bfuse.mount()
+ bfuse.unmount()
+ bfuse.mount()
+ bfuse.unmount()
+ bfuse.verify()
+
def test_lostfound(bfuse):
bfuse.mount()
def test_lostfound(bfuse):
bfuse.mount()
def __init__(self, msg):
self.msg = msg
def __init__(self, msg):
self.msg = msg
-class BFuse(threading.Thread):
'''bcachefs fuse runner.
This class runs bcachefs in fusemount mode, and waits until the mount has
'''bcachefs fuse runner.
This class runs bcachefs in fusemount mode, and waits until the mount has
'''
def __init__(self, dev, mnt):
'''
def __init__(self, dev, mnt):
- threading.Thread.__init__(self)
self.dev = dev
self.mnt = mnt
self.ready = threading.Event()
self.dev = dev
self.mnt = mnt
self.ready = threading.Event()
def mount(self):
print("Starting fuse thread.")
def mount(self):
print("Starting fuse thread.")
+
+ assert not self.thread
+ self.thread = threading.Thread(target=self.run)
+ self.thread.start()
+
self.ready.wait()
print("Fuse is mounted.")
self.ready.wait()
print("Fuse is mounted.")
run("fusermount3", "-zu", self.mnt)
print("Waiting for thread to exit.")
run("fusermount3", "-zu", self.mnt)
print("Waiting for thread to exit.")
- self.join(timeout)
- if self.isAlive():
+ self.thread.join(timeout)
+ if self.thread.is_alive():
+ self.thread.join()
+
+ self.thread = None
+ self.ready.clear()
if self.vout:
check_valgrind(self.vout)
if self.vout:
check_valgrind(self.vout)