summaryrefslogtreecommitdiff
path: root/test/bbackupd
diff options
context:
space:
mode:
authorMartin Ebourne <martin@ebourne.me.uk>2006-02-14 14:31:26 +0000
committerMartin Ebourne <martin@ebourne.me.uk>2006-02-14 14:31:26 +0000
commitf1f5bde35ded46f59a5b8ed1ee43f37e313e4576 (patch)
tree2d32c36286b420ffe961a288e7b353d82611d08f /test/bbackupd
parentf6635734cba997b7f4284b3e72f15a961f0b20ea (diff)
tar -C is not portable, so avoid using it in tests.
Diffstat (limited to 'test/bbackupd')
-rw-r--r--test/bbackupd/testbbackupd.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp
index 14c547c0..51047177 100644
--- a/test/bbackupd/testbbackupd.cpp
+++ b/test/bbackupd/testbbackupd.cpp
@@ -516,7 +516,7 @@ int test_bbackupd()
// 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 @@ int test_bbackupd()
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 @@ int test_bbackupd()
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 @@ int test_bbackupd()
// 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 @@ int test_bbackupd()
// 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 @@ int test_bbackupd()
// 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 @@ int test(int argc, const char *argv[])
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