]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
tahoe_fuse: system test: Create a separate directory for each test and pass the cap...
authornejucomo <nejucomo@gmail.com>
Wed, 30 Jan 2008 09:57:54 +0000 (02:57 -0700)
committernejucomo <nejucomo@gmail.com>
Wed, 30 Jan 2008 09:57:54 +0000 (02:57 -0700)
contrib/fuse/runtests.py

index 22bd8120f2a6c0f95d37b055e30a5739e2720127..35b8ca00f62f3a8759c7850c1317e1a08a4d4b66 100644 (file)
@@ -199,7 +199,7 @@ class SystemTest (object):
 
         return self.mount_fuse_layer(cap)
         
-    def mount_fuse_layer(self):
+    def mount_fuse_layer(self, fusebasecap, fusepause=2.0):
         print 'Mounting fuse interface.'
 
         mp = os.path.join(self.testroot, 'mountpoint')
@@ -229,15 +229,18 @@ class SystemTest (object):
                 print 'Waiting for the fuse interface to exit.'
                 proc.wait()
             
-    def run_test_layer(self, mountpoint):
+    def run_test_layer(self, fbcap, mountpoint):
         total = failures = 0
         for name in sorted(dir(self)):
             if name.startswith('test_'):
                 total += 1
                 print '\n*** Running test #%d: %s' % (total, name)
                 try:
+                    testcap = self.create_dirnode()
+                    self.attach_node(fbcap, testcap, name)
+                    
                     method = getattr(self, name)
-                    method(mountpoint)
+                    method(testcap, testdir = os.path.join(mountpoint, name))
                     print 'Test succeeded.'
                 except self.TestFailure, f:
                     print f
@@ -250,8 +253,12 @@ class SystemTest (object):
 
 
     # Tests:
-    def test_00_empty_directory_listing(self, mountpoint):
-        listing = os.listdir(mountpoint)
+    def test_directory_existence(self, testcap, testdir):
+        if not os.path.isdir(testdir):
+            raise self.TestFailure('Attached test directory not found: %r', testdir)
+            
+    def test_empty_directory_listing(self, testcap, testdir):
+        listing = os.listdir(testdir)
         if listing:
             raise self.TestFailure('Expected empty directory, found: %r' % (listing,))