]> arthur.barton.de Git - bup.git/commit - t/test.sh
Be more careful when testing that repeated saves can produce the same tree.
authorRob Browning <rlb@defaultvalue.org>
Sat, 5 Oct 2013 01:58:07 +0000 (20:58 -0500)
committerRob Browning <rlb@defaultvalue.org>
Mon, 7 Oct 2013 01:03:00 +0000 (20:03 -0500)
commite728ed013e15f76b96c10e0228c195fed184696d
treeea8cc4d7916d3addcf024ec430cd458c2acfb9bc
parent81ad1e6871827ec0fda7f5f93b646a8ea1c98c03
Be more careful when testing that repeated saves can produce the same tree.

Previously, test.sh would run multiple saves with no intervening
modifications, and check to see that the top-level "save -t" hash
didn't change, but with the addition of metadata this may fail on some
platforms where the test process itself (the save runs, etc.) affects
atime values.  That's because save is pulling the metadata for
unindexed parent directories directly from the filesystem.  And note
that atime is only special here because the test itself may
incidentally alter it -- we would see the same problem if any of the
other metdata for one of the unindexed parent directories changed
during the test run (i.e. mtime, uid, gid, ...).

To fix this, move the relevant test code from test.sh to
test-redundant-saves.sh, and use a newly added subdir-hash tool so
that we can compare the hashes of the roots of the indexed subtrees
instead of the top-level "save -t" hashes, ignoring the unindexed
parents entirely.

Thanks to Robert Edmonds <edmonds@debian.org> for running rc3 through
the Debian buildds which lead to the kFreeBSD test failure that
demonstrated the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Makefile
t/subtree-hash [new file with mode: 0755]
t/test-redundant-saves.sh [new file with mode: 0755]
t/test.sh