]> arthur.barton.de Git - bup.git/commit - t/test-meta.sh
Don't fail tests when the timestamp read resolution is higher than write.
authorRob Browning <rlb@defaultvalue.org>
Wed, 18 Dec 2013 02:19:44 +0000 (20:19 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sat, 21 Dec 2013 17:13:54 +0000 (11:13 -0600)
commit5dfc5f8eb00873664d0a76e8680d77097e1a7cf3
tree65cf5d204f53475e64d3a0079a07c168c58e204c
parentb9ee2e2664cf981d91e3490e57e5cd988aa9f343
Don't fail tests when the timestamp read resolution is higher than write.

Previously, if bup was able to read path timestamps at a higher
resolution than it could write them, tests would fail.  This situation
can occur (for example) when the stat() resolution is 1ns, but either
the underlying filesystem's isn't, or bup wasn't able to find
utimensat at build time.

To fix this, compute the maximum resolution of the test filesystem
(via "t/ns-timestamp-resolutions HERE"), and then limit the "bup
xstat" timestamp resolution in the tests to match via a new
--mtime-resolution argument.

For completeness, also add --atime-resolution and --ctime-resolution
arguments.

Thanks to Tim Riemenschneider <t.riemenschneider@detco.de> for
reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
cmd/xstat-cmd.py
lib/bup/helpers.py
t/ns-timestamp-resolutions [new file with mode: 0755]
t/test-meta.sh