Added a comment to volume Delete() about race condition.
[arvados.git] / services / fuse / tests / test_mount.py
index f9fcd73c5d29b6d5c557594663a94ee78225aaf3..764a099149a452ffe4258f2f8a0b922fd381b83a 100644 (file)
@@ -1,4 +1,5 @@
 import arvados
+import arvados.safeapi
 import arvados_fuse as fuse
 import glob
 import json
@@ -21,7 +22,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())
@@ -259,14 +260,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):