summaryrefslogtreecommitdiff
path: root/test/bbackupd
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2015-01-02 20:13:33 +0000
committerChris Wilson <chris+github@qwirx.com>2015-01-02 20:13:33 +0000
commit6d8cf18f7a116e6b30c7a32b0dc843f5a9e6d334 (patch)
tree79772ef56e9a409a833d08e2c5362523c42c6ea9 /test/bbackupd
parent11c11c951294b86a7df2db3eef567e4b2b46c700 (diff)
Fix test failing on OpenBSD because tar -m behaves differently.
Diffstat (limited to 'test/bbackupd')
-rw-r--r--test/bbackupd/testbbackupd.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp
index 122a5f09..25b00ef5 100644
--- a/test/bbackupd/testbbackupd.cpp
+++ b/test/bbackupd/testbbackupd.cpp
@@ -3708,11 +3708,17 @@ bool test_sync_new_files()
// TODO FIXME dedent
{
- // Add some more files and modify others
- // Use the m flag this time so they have a recent modification time
+ // Add some more files and modify others. Use the m flag this
+ // time so they have a recent modification time.
TEST_THAT(unpack_files("test3", "testfiles", "m"));
+
+ // OpenBSD's tar interprets the "-m" option quite differently:
+ // it sets the time to epoch zero (1 Jan 1970) instead of the
+ // current time, which doesn't help us. So reset the timestamp
+ // on a file with the touch command, so it won't be backed up.
+ TEST_RETURN(::system("touch testfiles/TestDir1/chsh"), 0);
- // Wait and test
+ // At least one file is too new to be backed up on the first run.
bbackupd.RunSyncNow();
TEST_COMPARE(Compare_Different);