8712: Propagate return value of clear() from super method. Test cache clearing
authorPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 5 Apr 2016 17:22:06 +0000 (13:22 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 5 Apr 2016 17:22:06 +0000 (13:22 -0400)
collections with subdirs.

services/fuse/arvados_fuse/fusedir.py
services/fuse/tests/test_cache.py

index bfcf0ef5ba62f111308d8a895d57cb2dc6ad8e5b..3f2bcd5ec2464fb5351a42be205b17f1fe93e49c 100644 (file)
@@ -321,8 +321,9 @@ class CollectionDirectoryBase(Directory):
         src.flush()
 
     def clear(self, force=False):
-        super(CollectionDirectoryBase, self).clear(force)
+        r = super(CollectionDirectoryBase, self).clear(force)
         self.collection = None
+        return r
 
 
 class CollectionDirectory(CollectionDirectoryBase):
index 7dab2c582150a8bd0d5db02eb2fb4def389f8b17..7aa00092bc774bb3bc08d963838ed001682d9696 100644 (file)
@@ -21,6 +21,11 @@ class TmpCollectionTest(IntegrationTest):
             cw = arvados.collection.Collection()
             f = cw.open("blurg%i" % i, "w")
             f.write("bloop%i" % i)
+
+            cw.mkdirs("dir%i" % i)
+            f = cw.open("dir%i/blurg" % i, "w")
+            f.write("dirbloop%i" % i)
+
             cw.save_new()
             pdh.append(cw.portable_data_hash())
         self.pool_test(self.mnt, pdh)
@@ -30,6 +35,11 @@ class TmpCollectionTest(IntegrationTest):
         for i,v in enumerate(pdh):
             j = os.path.join(mnt, "by_id", v, "blurg%i" % i)
             self.assertTrue(os.path.exists(j))
+            j = os.path.join(mnt, "by_id", v, "dir%i/blurg" % i)
+            self.assertTrue(os.path.exists(j))
+
         for i,v in enumerate(pdh):
             j = os.path.join(mnt, "by_id", v, "blurg%i" % i)
             self.assertTrue(os.path.exists(j))
+            j = os.path.join(mnt, "by_id", v, "dir%i/blurg" % i)
+            self.assertTrue(os.path.exists(j))