From f1f5bde35ded46f59a5b8ed1ee43f37e313e4576 Mon Sep 17 00:00:00 2001 From: Martin Ebourne Date: Tue, 14 Feb 2006 14:31:26 +0000 Subject: tar -C is not portable, so avoid using it in tests. --- test/bbackupd/testbbackupd.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test') 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 -- cgit v1.2.3