diff options
author | Reinhard Tartler <siretart@tauware.de> | 2010-11-09 17:28:58 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2010-11-09 17:28:58 +0100 |
commit | 8a937bd354001a190dbe66538aacb353e7c99341 (patch) | |
tree | 9db021722d1743482e76f93d00fb97bed32a3ea7 /test/bbackupd | |
parent | b591c86a418e8d5a0d1c1afd319d9acdad6fd4e3 (diff) |
Import upstream version 0.11~rc8~r2714
Diffstat (limited to 'test/bbackupd')
-rw-r--r-- | test/bbackupd/testbbackupd.cpp | 19 | ||||
-rwxr-xr-x | test/bbackupd/testfiles/extcheck1.pl.in | 8 |
2 files changed, 18 insertions, 9 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp index 91c883cc..32f3c176 100644 --- a/test/bbackupd/testbbackupd.cpp +++ b/test/bbackupd/testbbackupd.cpp @@ -87,7 +87,7 @@ // two cycles and a bit #define TIME_TO_WAIT_FOR_BACKUP_OPERATION 12 -void wait_for_backup_operation(char* message) +void wait_for_backup_operation(const char* message) { wait_for_operation(TIME_TO_WAIT_FOR_BACKUP_OPERATION, message); } @@ -2443,10 +2443,10 @@ int test_bbackupd() // next poll should happen within the next // 5 seconds (normally about 3 seconds) - safe_sleep(1); // 2 seconds before + wait_for_operation(1, "2 seconds before next run"); TEST_THAT(stat("testfiles" DIRECTORY_SEPARATOR "syncallowscript.notifyran.1", &st) != 0); - safe_sleep(4); // 2 seconds after + wait_for_operation(4, "2 seconds after run"); TEST_THAT(stat("testfiles" DIRECTORY_SEPARATOR "syncallowscript.notifyran.1", &st) == 0); TEST_THAT(stat("testfiles" DIRECTORY_SEPARATOR @@ -2455,10 +2455,10 @@ int test_bbackupd() // next poll should happen within the next // 10 seconds (normally about 8 seconds) - safe_sleep(6); // 2 seconds before + wait_for_operation(6, "2 seconds before next run"); TEST_THAT(stat("testfiles" DIRECTORY_SEPARATOR "syncallowscript.notifyran.2", &st) != 0); - safe_sleep(4); // 2 seconds after + wait_for_operation(4, "2 seconds after run"); TEST_THAT(stat("testfiles" DIRECTORY_SEPARATOR "syncallowscript.notifyran.2", &st) == 0); @@ -2481,9 +2481,14 @@ int test_bbackupd() long end_time = time(NULL); long wait_time = end_time - start_time + 2; + // should be about 10 seconds - printf("Waited for %ld seconds, should have been %s", - wait_time, control_string); + if (wait_time < 8 || wait_time > 12) + { + printf("Waited for %ld seconds, should have " + "been %s", wait_time, control_string); + } + TEST_THAT(wait_time >= 8); TEST_THAT(wait_time <= 12); diff --git a/test/bbackupd/testfiles/extcheck1.pl.in b/test/bbackupd/testfiles/extcheck1.pl.in index 74884dd8..5b70c677 100755 --- a/test/bbackupd/testfiles/extcheck1.pl.in +++ b/test/bbackupd/testfiles/extcheck1.pl.in @@ -8,7 +8,7 @@ unless(open IN,"../../bin/bbackupquery/bbackupquery -Wwarning " . "-l testfiles/query4.log " . "\"compare -ac$flags\" quit 2>&1 |") { - print "Couldn't open compare utility\n"; + print "FAIL: opening compare utility\n"; exit 2; } @@ -48,7 +48,11 @@ while(<IN>) close IN; -$ret = 2 unless $seen; +unless ($seen) +{ + print "FAIL: missing line matching continousupdate\n"; + $ret = 2; +} exit $ret; |