From 42759ae4288f20646ae64bf7d09db26b713d531b Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Wed, 9 Mar 2016 13:50:41 -0500 Subject: [PATCH] 8345: Fix dirent timestamps. --- services/fuse/arvados_fuse/__init__.py | 6 +++--- services/fuse/tests/test_mount.py | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/services/fuse/arvados_fuse/__init__.py b/services/fuse/arvados_fuse/__init__.py index e125459bf9..77dbb0b3a1 100644 --- a/services/fuse/arvados_fuse/__init__.py +++ b/services/fuse/arvados_fuse/__init__.py @@ -435,9 +435,9 @@ class Operations(llfuse.Operations): entry.st_blksize = 512 entry.st_blocks = (entry.st_size/512)+1 - entry.st_atime_ns = int(e.atime()) - entry.st_mtime_ns = int(e.mtime()) - entry.st_ctime_ns = int(e.mtime()) + entry.st_atime_ns = int(e.atime() * 1000000000) + entry.st_mtime_ns = int(e.mtime() * 1000000000) + entry.st_ctime_ns = int(e.mtime() * 1000000000) return entry diff --git a/services/fuse/tests/test_mount.py b/services/fuse/tests/test_mount.py index c68a28d2ca..f623ae5386 100644 --- a/services/fuse/tests/test_mount.py +++ b/services/fuse/tests/test_mount.py @@ -267,14 +267,22 @@ class FuseSharedTest(MountTestBase): # check mtime on template st = os.stat(pipeline_template_path) - self.assertEqual(st.st_mtime_ns, 1397493304) + try: + mtime = st.st_mtime_ns / 1000000000 + except AttributeError: + mtime = st.st_mtime + self.assertEqual(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_ns, 1391448174) + try: + mtime = st.st_mtime_ns / 1000000000 + except AttributeError: + mtime = st.st_mtime + self.assertEqual(mtime, 1391448174) class FuseHomeTest(MountTestBase): -- 2.39.5