[Box Backup-dev] COMMIT r462 - box/trunk/test/bbackupd
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Tue Feb 14 14:31:28 GMT 2006
Author: martin
Date: 2006-02-14 14:31:26 +0000 (Tue, 14 Feb 2006)
New Revision: 462
Modified:
box/trunk/test/bbackupd/testbbackupd.cpp
Log:
tar -C is not portable, so avoid using it in tests.
Modified: box/trunk/test/bbackupd/testbbackupd.cpp
===================================================================
--- box/trunk/test/bbackupd/testbbackupd.cpp 2006-02-14 11:24:05 UTC (rev 461)
+++ box/trunk/test/bbackupd/testbbackupd.cpp 2006-02-14 14:31:26 UTC (rev 462)
@@ -516,7 +516,7 @@
// unpack the files for the initial test
TEST_THAT(::system("rm -rf testfiles/TestDir1") == 0);
TEST_THAT(::system("mkdir testfiles/TestDir1") == 0);
- TEST_THAT(::system("gzip -d < testfiles/spacetest1.tgz | tar xf - -C testfiles/TestDir1/") == 0);
+ TEST_THAT(::system("gzip -d < testfiles/spacetest1.tgz | ( cd testfiles/TestDir1 && tar xf - )") == 0);
int pid = LaunchServer("../../bin/bbackupd/bbackupd testfiles/bbackupd.conf", "testfiles/bbackupd.pid");
TEST_THAT(pid != -1 && pid != 0);
@@ -535,7 +535,7 @@
TestRemoteProcessMemLeaks("bbstoreaccounts.memleaks");
// Unpack some more files
- TEST_THAT(::system("gzip -d < testfiles/spacetest2.tgz | tar xf - -C testfiles/TestDir1/") == 0);
+ TEST_THAT(::system("gzip -d < testfiles/spacetest2.tgz | ( cd testfiles/TestDir1 && tar xf - )") == 0);
// Delete a file and a directory
TEST_THAT(::unlink("testfiles/TestDir1/spacetest/d1/f3") == 0);
TEST_THAT(::system("rm -rf testfiles/TestDir1/spacetest/d3/d4") == 0);
@@ -556,7 +556,7 @@
TEST_THAT(!TestFileExists("testfiles/notifyran.store-full.2"));
// unpack the initial files again
- TEST_THAT(::system("gzip -d < testfiles/test_base.tgz | tar xf - -C testfiles/") == 0);
+ TEST_THAT(::system("gzip -d < testfiles/test_base.tgz | ( cd testfiles && tar xf - )") == 0);
// wait for it to do it's stuff
wait_for_backup_operation();
@@ -656,7 +656,7 @@
// Add some more files
// Because the 'm' option is not used, these files will look very old to the daemon.
// Lucky it'll upload them then!
- TEST_THAT(::system("gzip -d < testfiles/test2.tgz | tar xf - -C testfiles/") == 0);
+ TEST_THAT(::system("gzip -d < testfiles/test2.tgz | ( cd testfiles && tar xf - )") == 0);
::chmod("testfiles/TestDir1/sub23/dhsfdss/blf.h", 0415);
// Wait and test
@@ -693,7 +693,7 @@
// Add some files and directories which are marked as excluded
printf("Add files and dirs for exclusion test\n");
- TEST_THAT(::system("gzip -d < testfiles/testexclude.tgz | tar xf - -C testfiles/") == 0);
+ TEST_THAT(::system("gzip -d < testfiles/testexclude.tgz | ( cd testfiles && tar xf - )") == 0);
// Wait and test
wait_for_backup_operation();
compareReturnValue = ::system("../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query3c.log \"compare -ac\" quit");
@@ -830,7 +830,7 @@
// Add some more files and modify others
// Use the m flag this time so they have a recent modification time
- TEST_THAT(::system("gzip -d < testfiles/test3.tgz | tar xmf - -C testfiles/") == 0);
+ TEST_THAT(::system("gzip -d < testfiles/test3.tgz | ( cd testfiles && tar xmf - )") == 0);
// Wait and test
wait_for_backup_operation();
@@ -1035,7 +1035,7 @@
BackupClientCryptoKeys_Setup("testfiles/bbackupd.keys");
// Initial files
- TEST_THAT(::system("gzip -d < testfiles/test_base.tgz | tar xf - -C testfiles/") == 0);
+ TEST_THAT(::system("gzip -d < testfiles/test_base.tgz | ( cd testfiles && tar xf - )") == 0);
// Do the tests
More information about the Boxbackup-dev
mailing list