From: nejucomo Date: Mon, 21 Jan 2008 00:55:51 +0000 (-0700) Subject: tahoe_fuse: system test: Launch the fuse interface. X-Git-Tag: allmydata-tahoe-0.8.0~242 X-Git-Url: https://git.rkrishnan.org/pf/content/en/service/rgr-080307.php?a=commitdiff_plain;h=1295c1e4ecb0f9f6a8f59efa0ed51108c0dda5bf;p=tahoe-lafs%2Ftahoe-lafs.git tahoe_fuse: system test: Launch the fuse interface. --- diff --git a/contrib/fuse/runtests.py b/contrib/fuse/runtests.py index 41ec4a34..4a32f095 100644 --- a/contrib/fuse/runtests.py +++ b/contrib/fuse/runtests.py @@ -6,7 +6,7 @@ Note: The API design of the python-fuse library makes unit testing much of tahoe-fuse.py tricky business. ''' -import sys, os, shutil, unittest, subprocess, tempfile, re, time +import sys, os, shutil, unittest, subprocess, tempfile, re, time, signal import tahoe_fuse @@ -48,6 +48,7 @@ class SystemTest (object): self.cliexec = None self.introbase = None self.clientbase = None + self.mountpoint = None ## Top-level flow control: # These "*_layer" methods call eachother in a linear fashion, using @@ -181,8 +182,25 @@ class SystemTest (object): print 'Ignoring cleanup exception: %r' % (e,) def mount_fuse_layer(self): - # XXX not implemented. - pass + print 'Mounting fuse interface.' + self.mountpoint = tempfile.mkdtemp(prefix='tahoe_fuse_mp_') + try: + thispath = os.path.abspath(sys.argv[0]) + thisdir = os.path.dirname(thispath) + fusescript = os.path.join(thisdir, 'tahoe_fuse.py') + try: + proc = subprocess.Popen([fusescript, self.mountpoint, '-f']) + # FIXME: Verify the mount somehow? + # FIXME: Now do tests! + finally: + if proc.poll() is None: + print 'Killing fuse interface.' + os.kill(proc.pid, signal.SIGTERM) + print 'Waiting for the fuse interface to exit.' + proc.wait() + finally: + self.cleanup_dir(self.mountpoint) + # Utilities: