From 375717c0954dd99ce4f8484938f56cb62c540951 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 18 Sep 2015 00:02:44 +0200 Subject: [PATCH] tests: work around strange mtime granularity issue on netbsd, fixes #204 not sure where the problem is: it seems to announce it supports st_mtime_ns, but if one uses it and has a file with ...123ns, i t gets restored as ...000ns. Then I tried setting st_mtime_ns_round to -3, but it still failed with +1000ns difference. Maybe rounding is incorrect and it should be truncating? Issue with granularity could be in python, in netbsd (netbsd platform code), in ffs filesystem, ... --- borg/testsuite/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/borg/testsuite/__init__.py b/borg/testsuite/__init__.py index 0ef950a97..cd790b571 100644 --- a/borg/testsuite/__init__.py +++ b/borg/testsuite/__init__.py @@ -28,6 +28,8 @@ elif 'HAVE_UTIMES' in sysconfig.get_config_vars(): else: st_mtime_ns_round = -9 +if sys.platform.startswith('netbsd'): + st_mtime_ns_round = -4 # only >1 microsecond resolution here? has_mtime_ns = sys.version >= '3.3' utime_supports_fd = os.utime in getattr(os, 'supports_fd', {})