[ARVADOS] updated: 27fe76f518db97633148657ff1e1610095be11fa

git at public.curoverse.com git at public.curoverse.com
Thu Feb 19 09:30:06 EST 2015


Summary of changes:
 sdk/python/arvados/safeapi.py          |  5 +----
 services/fuse/arvados_fuse/__init__.py |  2 +-
 services/fuse/tests/test_mount.py      | 21 ++++++++++++++++-----
 3 files changed, 18 insertions(+), 10 deletions(-)

       via  27fe76f518db97633148657ff1e1610095be11fa (commit)
      from  50d3be922d18357f1033b02c7add035fba4acd56 (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 27fe76f518db97633148657ff1e1610095be11fa
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Feb 19 09:32:17 2015 -0500

    4823: Fix fuse tests for SafeApi -> ThreadSafeApiCache changes.  Add a couple
    of mtime assertions.

diff --git a/sdk/python/arvados/safeapi.py b/sdk/python/arvados/safeapi.py
index 9737da1..32cb2a5 100644
--- a/sdk/python/arvados/safeapi.py
+++ b/sdk/python/arvados/safeapi.py
@@ -26,7 +26,4 @@ class ThreadSafeApiCache(object):
         # Proxy nonexistent attributes to the thread-local API client.
         if name == "api_token":
             return self.apiconfig['ARVADOS_API_TOKEN']
-        try:
-            return getattr(self.localapi(), name)
-        except AttributeError:
-            return super(ThreadSafeApiCache, self).__getattr__(name)
+        return getattr(self.localapi(), name)
diff --git a/services/fuse/arvados_fuse/__init__.py b/services/fuse/arvados_fuse/__init__.py
index 6850de6..fd65ae1 100644
--- a/services/fuse/arvados_fuse/__init__.py
+++ b/services/fuse/arvados_fuse/__init__.py
@@ -315,7 +315,7 @@ class CollectionDirectory(Directory):
 
             with llfuse.lock_released:
                 coll_reader = arvados.CollectionReader(
-                    self.collection_locator, self.api, self.api.localkeep(),
+                    self.collection_locator, self.api, self.api.keep,
                     num_retries=self.num_retries)
                 new_collection_object = coll_reader.api_response() or {}
                 # If the Collection only exists in Keep, there will be no API
diff --git a/services/fuse/tests/test_mount.py b/services/fuse/tests/test_mount.py
index f9fcd73..447ffb3 100644
--- a/services/fuse/tests/test_mount.py
+++ b/services/fuse/tests/test_mount.py
@@ -21,7 +21,7 @@ class MountTestBase(unittest.TestCase):
         self.mounttmp = tempfile.mkdtemp()
         run_test_server.run()
         run_test_server.authorize_with("admin")
-        self.api = fuse.SafeApi(arvados.config)
+        self.api = arvados.safeapi.ThreadSafeApiCache(arvados.config.settings())
 
     def make_mount(self, root_class, **root_kwargs):
         operations = fuse.Operations(os.getuid(), os.getgid())
@@ -242,8 +242,7 @@ class FuseSharedTest(MountTestBase):
         # directory)
         fuse_user_objs = os.listdir(os.path.join(self.mounttmp, 'FUSE User'))
         fuse_user_objs.sort()
-        self.assertEqual(['Empty collection.link',                # permission link on collection
-                          'FUSE Test Project',                    # project owned by user
+        self.assertEqual(['FUSE Test Project',                    # project owned by user
                           'collection #1 owned by FUSE',          # collection owned by user
                           'collection #2 owned by FUSE',          # collection owned by user
                           'pipeline instance owned by FUSE.pipelineInstance',  # pipeline instance owned by user
@@ -259,14 +258,26 @@ class FuseSharedTest(MountTestBase):
 
         # Double check that we can open and read objects in this folder as a file,
         # and that its contents are what we expect.
-        with open(os.path.join(
+        pipeline_template_path = os.path.join(
                 self.mounttmp,
                 'FUSE User',
                 'FUSE Test Project',
-                'pipeline template in FUSE project.pipelineTemplate')) as f:
+                'pipeline template in FUSE project.pipelineTemplate')
+        with open(pipeline_template_path) as f:
             j = json.load(f)
             self.assertEqual("pipeline template in FUSE project", j['name'])
 
+        # check mtime on template
+        st = os.stat(pipeline_template_path)
+        self.assertEqual(st.st_mtime, 1397493304)
+
+        # check mtime on collection
+        st = os.stat(os.path.join(
+                self.mounttmp,
+                'FUSE User',
+                'collection #1 owned by FUSE'))
+        self.assertEqual(st.st_mtime, 1391448174)
+
 
 class FuseHomeTest(MountTestBase):
     def runTest(self):

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list