[ARVADOS] updated: 768f114b1746dddec0f0224dee92a58c8ddc5499

git at public.curoverse.com git at public.curoverse.com
Tue Nov 10 19:15:44 EST 2015


Summary of changes:
 services/fuse/arvados_fuse/fusedir.py |  2 +-
 services/fuse/tests/test_mount.py     | 26 +++++++++++++++++++++-----
 2 files changed, 22 insertions(+), 6 deletions(-)

       via  768f114b1746dddec0f0224dee92a58c8ddc5499 (commit)
      from  b1781295959566608326b69440d8d3ae8e4da4ee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 768f114b1746dddec0f0224dee92a58c8ddc5499
Author: radhika <radhika at curoverse.com>
Date:   Tue Nov 10 18:41:55 2015 -0500

    7661: Pass pdh_only when adding by_id subdir; test now passes.

diff --git a/services/fuse/arvados_fuse/fusedir.py b/services/fuse/arvados_fuse/fusedir.py
index c078242..fdc93fb 100644
--- a/services/fuse/arvados_fuse/fusedir.py
+++ b/services/fuse/arvados_fuse/fusedir.py
@@ -512,7 +512,7 @@ will appear if it exists.
             # If we're the root directory, add an identical by_id subdirectory.
             if self.inode == llfuse.ROOT_INODE:
                 self._entries['by_id'] = self.inodes.add_entry(MagicDirectory(
-                        self.inode, self.inodes, self.api, self.num_retries))
+                        self.inode, self.inodes, self.api, self.num_retries, self.pdh_only))
 
     def __contains__(self, k):
         if k in self._entries:
diff --git a/services/fuse/tests/test_mount.py b/services/fuse/tests/test_mount.py
index b91b141..cc8693b 100644
--- a/services/fuse/tests/test_mount.py
+++ b/services/fuse/tests/test_mount.py
@@ -1076,8 +1076,11 @@ class FuseMagicTestPDHOnly(MountTestBase):
         created = self.api.collections().create(body={"manifest_text":self.test_manifest}).execute()
         self.testcollectionuuid = str(created['uuid'])
 
-    def runTest(self):
-        self.make_mount(fuse.MagicDirectory, pdh_only=True)
+    def verify_pdh_only(self, pdh_only=False, skip_pdh_only=False):
+        if skip_pdh_only is True:
+            self.make_mount(fuse.MagicDirectory)    # in this case, the default by_id applies
+        else:
+            self.make_mount(fuse.MagicDirectory, pdh_only=pdh_only)
 
         mount_ls = llfuse.listdir(self.mounttmp)
         self.assertIn('README', mount_ls)
@@ -1086,7 +1089,7 @@ class FuseMagicTestPDHOnly(MountTestBase):
                              for fn in mount_ls),
                          "new FUSE MagicDirectory lists Collection")
 
-        # look up using pdh should succeed
+        # look up using pdh should succeed in all cases
         self.assertDirContents(self.testcollection, ['thing1.txt'])
         self.assertDirContents(os.path.join('by_id', self.testcollection),
                                ['thing1.txt'])
@@ -1103,7 +1106,20 @@ class FuseMagicTestPDHOnly(MountTestBase):
             with open(os.path.join(self.mounttmp, k)) as f:
                 self.assertEqual(v, f.read())
 
-        # look up using uuid should fail
-        with self.assertRaises(OSError):
+        # look up using uuid should fail when pdh_only is set
+        if pdh_only is True:
+            with self.assertRaises(OSError):
+                self.assertDirContents(os.path.join('by_id', self.testcollectionuuid),
+                               ['thing1.txt'])
+        else:
             self.assertDirContents(os.path.join('by_id', self.testcollectionuuid),
                                ['thing1.txt'])
+
+    def test_with_pdh_only_true(self):
+        self.verify_pdh_only(pdh_only=True)
+
+    def test_with_pdh_only_false(self):
+        self.verify_pdh_only(pdh_only=False)
+
+    def test_with_default_by_id(self):
+        self.verify_pdh_only(skip_pdh_only=True)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list