diff options
Diffstat (limited to 'test/bbackupd/testbbackupd.cpp')
-rw-r--r-- | test/bbackupd/testbbackupd.cpp | 981 |
1 files changed, 0 insertions, 981 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp index 71778ca6..6cd8f27d 100644 --- a/test/bbackupd/testbbackupd.cpp +++ b/test/bbackupd/testbbackupd.cpp @@ -42,30 +42,20 @@ #include <sys/syscall.h> #endif -<<<<<<< HEAD -#include "autogen_BackupProtocolServer.h" -======= #include "autogen_BackupProtocol.h" ->>>>>>> 0.12 #include "BackupClientCryptoKeys.h" #include "BackupClientFileAttributes.h" #include "BackupClientRestore.h" #include "BackupDaemon.h" #include "BackupDaemonConfigVerify.h" #include "BackupQueries.h" -<<<<<<< HEAD -======= #include "BackupStoreAccounts.h" ->>>>>>> 0.12 #include "BackupStoreConstants.h" #include "BackupStoreContext.h" #include "BackupStoreDaemon.h" #include "BackupStoreDirectory.h" #include "BackupStoreException.h" -<<<<<<< HEAD -======= #include "BackupStoreConfigVerify.h" ->>>>>>> 0.12 #include "BoxPortsAndFiles.h" #include "BoxTime.h" #include "BoxTimeToUnix.h" @@ -74,15 +64,10 @@ #include "Configuration.h" #include "FileModificationTime.h" #include "FileStream.h" -<<<<<<< HEAD -#include "IOStreamGetLine.h" -#include "LocalProcessStream.h" -======= #include "intercept.h" #include "IOStreamGetLine.h" #include "LocalProcessStream.h" #include "RaidFileController.h" ->>>>>>> 0.12 #include "SSLLib.h" #include "ServerControl.h" #include "Socket.h" @@ -92,13 +77,6 @@ #include "Timer.h" #include "Utils.h" -<<<<<<< HEAD -#include "autogen_BackupProtocolClient.h" -#include "intercept.h" -#include "ServerControl.h" - -======= ->>>>>>> 0.12 #include "MemLeakFindOn.h" // ENOATTR may be defined in a separate header file which we may not have @@ -497,13 +475,8 @@ int64_t GetDirID(BackupProtocolClient &protocol, const char *name, int64_t InDir { protocol.QueryListDirectory( InDirectory, -<<<<<<< HEAD - BackupProtocolClientListDirectory::Flags_Dir, - BackupProtocolClientListDirectory::Flags_EXCLUDE_NOTHING, -======= BackupProtocolListDirectory::Flags_Dir, BackupProtocolListDirectory::Flags_EXCLUDE_NOTHING, ->>>>>>> 0.12 true /* want attributes */); // Retrieve the directory from the stream following @@ -545,15 +518,6 @@ void do_interrupted_restore(const TLSContext &context, int64_t restoredirid) 22011); BackupProtocolClient protocol(conn); protocol.QueryVersion(BACKUP_STORE_SERVER_VERSION); -<<<<<<< HEAD - std::auto_ptr<BackupProtocolClientLoginConfirmed> loginConf(protocol.QueryLogin(0x01234567, BackupProtocolClientLogin::Flags_ReadOnly)); - - // Test the restoration - TEST_THAT(BackupClientRestore(protocol, restoredirid, - "Test1", "testfiles/restore-interrupt", - true /* print progress dots */) - == Restore_Complete); -======= std::auto_ptr<BackupProtocolLoginConfirmed> loginConf(protocol.QueryLogin(0x01234567, BackupProtocolLogin::Flags_ReadOnly)); @@ -567,7 +531,6 @@ void do_interrupted_restore(const TLSContext &context, int64_t restoredirid) false /* undelete after */, false /* resume */, false /* keep going */) == Restore_Complete); ->>>>>>> 0.12 // Log out protocol.QueryFinished(); @@ -645,11 +608,7 @@ int64_t SearchDir(BackupStoreDirectory& rDir, if (en == 0) return 0; int64_t id = en->GetObjectID(); TEST_THAT(id > 0); -<<<<<<< HEAD - TEST_THAT(id != BackupProtocolClientListDirectory::RootDirectory); -======= TEST_THAT(id != BackupProtocolListDirectory::RootDirectory); ->>>>>>> 0.12 return id; } @@ -662,11 +621,7 @@ std::auto_ptr<BackupProtocolClient> Connect(TLSContext& rContext) std::auto_ptr<BackupProtocolClient> connection; connection.reset(new BackupProtocolClient(sSocket)); connection->Handshake(); -<<<<<<< HEAD - std::auto_ptr<BackupProtocolClientVersion> -======= std::auto_ptr<BackupProtocolVersion> ->>>>>>> 0.12 serverVersion(connection->QueryVersion( BACKUP_STORE_SERVER_VERSION)); if(serverVersion->GetVersion() != @@ -689,17 +644,10 @@ std::auto_ptr<BackupProtocolClient> ConnectAndLogin(TLSContext& rContext, std::auto_ptr<BackupStoreDirectory> ReadDirectory ( BackupProtocolClient& rClient, -<<<<<<< HEAD - int64_t id -) -{ - std::auto_ptr<BackupProtocolClientSuccess> dirreply( -======= int64_t id = BackupProtocolListDirectory::RootDirectory ) { std::auto_ptr<BackupProtocolSuccess> dirreply( ->>>>>>> 0.12 rClient.QueryListDirectory(id, false, 0, false)); std::auto_ptr<IOStream> dirstream(rClient.ReceiveStream()); std::auto_ptr<BackupStoreDirectory> apDir(new BackupStoreDirectory()); @@ -707,11 +655,8 @@ std::auto_ptr<BackupStoreDirectory> ReadDirectory return apDir; } -<<<<<<< HEAD -======= Daemon* spDaemon = NULL; ->>>>>>> 0.12 int start_internal_daemon() { // ensure that no child processes end up running tests! @@ -725,10 +670,7 @@ int start_internal_daemon() }; BackupDaemon daemon; -<<<<<<< HEAD -======= spDaemon = &daemon; // to propagate into child ->>>>>>> 0.12 int result; if (bbackupd_args.size() > 0) @@ -739,11 +681,8 @@ int start_internal_daemon() { result = daemon.Main("testfiles/bbackupd.conf", 1, argv); } -<<<<<<< HEAD -======= spDaemon = NULL; // to ensure not used by parent ->>>>>>> 0.12 TEST_EQUAL_LINE(0, result, "Daemon exit code"); @@ -781,10 +720,7 @@ int start_internal_daemon() fflush(stdout); TEST_THAT(pid > 0); -<<<<<<< HEAD -======= spDaemon = &daemon; ->>>>>>> 0.12 return pid; } @@ -825,16 +761,6 @@ extern "C" struct dirent *readdir_test_hook_1(DIR *dir) extern "C" struct dirent *readdir_test_hook_2(DIR *dir) { -<<<<<<< HEAD - if (time(NULL) >= readdir_stop_time) - { -#ifndef PLATFORM_CLIB_FNS_INTERCEPTION_IMPOSSIBLE - intercept_setup_readdir_hook(NULL, NULL); - intercept_setup_lstat_hook (NULL, NULL); - // we will not be called again. -#endif - } -======= if (spDaemon->IsTerminateWanted()) { // force daemon to crash, right now @@ -859,7 +785,6 @@ extern "C" struct dirent *readdir_test_hook_2(DIR *dir) BOX_TRACE("readdir hook still active at " << time_now << ", " "waiting for " << readdir_stop_time); } ->>>>>>> 0.12 // fill in the struct dirent appropriately memset(&readdir_test_dirent, 0, sizeof(readdir_test_dirent)); @@ -871,10 +796,7 @@ extern "C" struct dirent *readdir_test_hook_2(DIR *dir) snprintf(readdir_test_dirent.d_name, sizeof(readdir_test_dirent.d_name), "test.%d", readdir_test_counter); -<<<<<<< HEAD -======= BOX_TRACE("readdir hook returning " << readdir_test_dirent.d_name); ->>>>>>> 0.12 // ensure that when bbackupd stats the file, it gets the // right answer @@ -886,12 +808,9 @@ extern "C" struct dirent *readdir_test_hook_2(DIR *dir) intercept_setup_lstat_hook(stat_hook_filename, lstat_test_hook); #endif -<<<<<<< HEAD -======= // sleep a bit to reduce the number of dirents returned ::safe_sleep(1); ->>>>>>> 0.12 return &readdir_test_dirent; } @@ -935,8 +854,6 @@ bool test_entry_deleted(BackupStoreDirectory& rDir, return flags && BackupStoreDirectory::Entry::Flags_Deleted; } -<<<<<<< HEAD -======= bool compare_all(BackupQueries::ReturnCode::Type expected_status, std::string config_file = "testfiles/bbackupd.conf") { @@ -964,7 +881,6 @@ bool compare_all(BackupQueries::ReturnCode::Type expected_status, #define TEST_COMPARE(...) \ TEST_THAT(compare_all(BackupQueries::ReturnCode::__VA_ARGS__)); ->>>>>>> 0.12 int test_bbackupd() { // First, wait for a normal period to make sure the last changes @@ -1107,21 +1023,11 @@ int test_bbackupd() comp2.size() + 1, comp2.size()); TEST_LINE(comp2 != sub, line); } -<<<<<<< HEAD - - if (failures > 0) - { - // stop early to make debugging easier - Timers::Init(); - return 1; - } -======= Timers::Init(); // stop early to make debugging easier if (failures) return 1; ->>>>>>> 0.12 // four-second delay on first read() of f1 // should mean that no keepalives were sent, @@ -1129,25 +1035,6 @@ int test_bbackupd() // before any matching blocks could be found. intercept_setup_delay("testfiles/TestDir1/spacetest/f1", 0, 4000, SYS_read, 1); -<<<<<<< HEAD - pid = start_internal_daemon(); - intercept_clear_setup(); - - fd = open("testfiles/TestDir1/spacetest/f1", O_WRONLY); - TEST_THAT(fd > 0); - // write again, to update the file's timestamp - TEST_EQUAL_LINE(sizeof(buffer), - write(fd, buffer, sizeof(buffer)), - "Buffer write"); - TEST_THAT(close(fd) == 0); - - wait_for_backup_operation("internal daemon to sync " - "spacetest/f1 again"); - // can't test whether intercept was triggered, because - // it's in a different process. - // TEST_THAT(intercept_triggered()); - TEST_THAT(stop_internal_daemon(pid)); -======= { BackupDaemon bbackupd; @@ -1169,7 +1056,6 @@ int test_bbackupd() intercept_clear_setup(); Timers::Cleanup(); } ->>>>>>> 0.12 // check that the diff was aborted, i.e. upload was not a diff found1 = false; @@ -1293,12 +1179,9 @@ int test_bbackupd() TEST_LINE(comp2 != sub, line); } -<<<<<<< HEAD -======= // Check that no read error has been reported yet TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); ->>>>>>> 0.12 if (failures > 0) { // stop early to make debugging easier @@ -1318,11 +1201,7 @@ int test_bbackupd() std::string touchfile = "testfiles/TestDir1/spacetest/d1/touch-me"; -<<<<<<< HEAD - fd = open(touchfile.c_str(), O_CREAT | O_WRONLY); -======= fd = open(touchfile.c_str(), O_CREAT | O_WRONLY, 0700); ->>>>>>> 0.12 TEST_THAT(fd > 0); // write again, to update the file's timestamp TEST_EQUAL_LINE(sizeof(buffer), @@ -1414,10 +1293,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 if(bbackupd_pid > 0) { @@ -1486,17 +1362,7 @@ int test_bbackupd() BOX_TRACE("Sync finished."); BOX_TRACE("Compare to check that there are differences"); -<<<<<<< HEAD - int compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query0a.log " - "-Werror \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Different); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Different); ->>>>>>> 0.12 BOX_TRACE("Compare finished."); // Check that the notify script was run @@ -1518,11 +1384,7 @@ int test_bbackupd() std::auto_ptr<BackupProtocolClient> client = ConnectAndLogin(context, 0 /* read-write */); -<<<<<<< HEAD - std::auto_ptr<BackupProtocolClientAccountUsage> usage( -======= std::auto_ptr<BackupProtocolAccountUsage> usage( ->>>>>>> 0.12 client->QueryGetAccountUsage()); TEST_EQUAL_LINE(24, usage->GetBlocksUsed(), "blocks used"); @@ -1535,15 +1397,7 @@ int test_bbackupd() sSocket.Close(); } -<<<<<<< HEAD - if (failures > 0) - { - // stop early to make debugging easier - return 1; - } -======= if (failures) return 1; ->>>>>>> 0.12 // ensure time is different to refresh the cache ::safe_sleep(1); @@ -1566,8 +1420,6 @@ int test_bbackupd() */ BackupDaemon bbackupd; -<<<<<<< HEAD -======= { const char* argv[] = { "bbackupd", @@ -1576,7 +1428,6 @@ int test_bbackupd() "processing command-line options"); } ->>>>>>> 0.12 bbackupd.Configure("testfiles/bbackupd-exclude.conf"); bbackupd.InitCrypto(); BOX_TRACE("done."); @@ -1620,12 +1471,7 @@ int test_bbackupd() ConnectAndLogin(context, 0 /* read-write */); std::auto_ptr<BackupStoreDirectory> rootDir = -<<<<<<< HEAD - ReadDirectory(*client, - BackupProtocolClientListDirectory::RootDirectory); -======= ReadDirectory(*client); ->>>>>>> 0.12 int64_t testDirId = SearchDir(*rootDir, "Test1"); TEST_THAT(testDirId != 0); @@ -1667,11 +1513,7 @@ int test_bbackupd() ReadDirectory(*client, d4_id); TEST_THAT(test_entry_deleted(*d4_dir, "f5")); -<<<<<<< HEAD - std::auto_ptr<BackupProtocolClientAccountUsage> usage( -======= std::auto_ptr<BackupProtocolAccountUsage> usage( ->>>>>>> 0.12 client->QueryGetAccountUsage()); TEST_EQUAL_LINE(24, usage->GetBlocksUsed(), "blocks used"); @@ -1690,15 +1532,7 @@ int test_bbackupd() } BOX_TRACE("done."); -<<<<<<< HEAD - if (failures > 0) - { - // stop early to make debugging easier - return 1; - } -======= if (failures) return 1; ->>>>>>> 0.12 wait_for_operation(5, "housekeeping to remove the " "deleted files"); @@ -1709,12 +1543,7 @@ int test_bbackupd() ConnectAndLogin(context, 0 /* read-write */); std::auto_ptr<BackupStoreDirectory> rootDir = -<<<<<<< HEAD - ReadDirectory(*client, - BackupProtocolClientListDirectory::RootDirectory); -======= ReadDirectory(*client); ->>>>>>> 0.12 int64_t testDirId = SearchDir(*rootDir, "Test1"); TEST_THAT(testDirId != 0); @@ -1734,11 +1563,7 @@ int test_bbackupd() TEST_THAT(SearchDir(*spacetest_dir, "d3") == 0); TEST_THAT(SearchDir(*spacetest_dir, "d7") == 0); -<<<<<<< HEAD - std::auto_ptr<BackupProtocolClientAccountUsage> usage( -======= std::auto_ptr<BackupProtocolAccountUsage> usage( ->>>>>>> 0.12 client->QueryGetAccountUsage()); TEST_EQUAL_LINE(16, usage->GetBlocksUsed(), "blocks used"); @@ -1755,15 +1580,7 @@ int test_bbackupd() sSocket.Close(); } -<<<<<<< HEAD - if (failures > 0) - { - // stop early to make debugging easier - return 1; - } -======= if (failures) return 1; ->>>>>>> 0.12 // Need 22 blocks free to upload everything TEST_THAT_ABORTONFAIL(::system(BBSTOREACCOUNTS " -c " @@ -1773,31 +1590,12 @@ int test_bbackupd() // Run another backup, now there should be enough space // for everything we want to upload. -<<<<<<< HEAD - { - Logging::Guard guard(Log::ERROR); - bbackupd.RunSyncNow(); - } -======= bbackupd.RunSyncNow(); ->>>>>>> 0.12 TEST_THAT(!bbackupd.StorageLimitExceeded()); // Check that the contents of the store are the same // as the contents of the disc -<<<<<<< HEAD - // (-a = all, -c = give result in return code) - BOX_TRACE("Check that all files were uploaded successfully"); - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd-exclude.conf " - "-l testfiles/query1.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same, "testfiles/bbackupd-exclude.conf"); ->>>>>>> 0.12 BOX_TRACE("done."); // BLOCK @@ -1805,11 +1603,7 @@ int test_bbackupd() std::auto_ptr<BackupProtocolClient> client = ConnectAndLogin(context, 0 /* read-write */); -<<<<<<< HEAD - std::auto_ptr<BackupProtocolClientAccountUsage> usage( -======= std::auto_ptr<BackupProtocolAccountUsage> usage( ->>>>>>> 0.12 client->QueryGetAccountUsage()); TEST_EQUAL_LINE(22, usage->GetBlocksUsed(), "blocks used"); @@ -1824,15 +1618,7 @@ int test_bbackupd() sSocket.Close(); } -<<<<<<< HEAD - if (failures > 0) - { - // stop early to make debugging easier - return 1; - } -======= if (failures) return 1; ->>>>>>> 0.12 // Put the limit back TEST_THAT_ABORTONFAIL(::system(BBSTOREACCOUNTS " -c " @@ -1852,10 +1638,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 BOX_TRACE("done."); // unpack the initial files again @@ -1873,33 +1656,14 @@ int test_bbackupd() // as the contents of the disc // (-a = all, -c = give result in return code) BOX_TRACE("Check that all files were uploaded successfully"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query1.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 BOX_TRACE("done."); TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD - - if (failures > 0) - { - // stop early to make debugging easier - return 1; - } -======= if (failures) return 1; ->>>>>>> 0.12 } // Check that no read error has been reported yet @@ -1936,29 +1700,17 @@ int test_bbackupd() class MyHook : public BackupStoreContext::TestHook { -<<<<<<< HEAD - virtual std::auto_ptr<ProtocolObject> StartCommand( - BackupProtocolObject& rCommand) - { - if (rCommand.GetType() == - BackupProtocolServerStoreFile::TypeID) -======= virtual std::auto_ptr<BackupProtocolMessage> StartCommand( const BackupProtocolMessage& rCommand) { if (rCommand.GetType() == BackupProtocolStoreFile::TypeID) ->>>>>>> 0.12 { // terminate badly THROW_EXCEPTION(CommonException, Internal); } -<<<<<<< HEAD - return std::auto_ptr<ProtocolObject>(); -======= return std::auto_ptr<BackupProtocolMessage>(); ->>>>>>> 0.12 } }; MyHook hook; @@ -2045,10 +1797,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 } #endif // !WIN32 @@ -2090,17 +1839,7 @@ int test_bbackupd() sync_and_wait(); // Check that the backup was successful, i.e. no differences -<<<<<<< HEAD - int compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query1.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 // now stop bbackupd and update the test file, // make the original directory unreadable @@ -2116,14 +1855,6 @@ int test_bbackupd() TEST_THAT(chmod(SYM_DIR, 0) == 0); // check that we can restore it -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-Wwarning \"restore Test1 testfiles/restore-symlink\" " - "quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Command_OK); -======= { int returnValue = ::system(BBACKUPQUERY " " "-c testfiles/bbackupd.conf " @@ -2132,7 +1863,6 @@ int test_bbackupd() TEST_RETURN(returnValue, BackupQueries::ReturnCode::Command_OK); } ->>>>>>> 0.12 // make it accessible again TEST_THAT(chmod(SYM_DIR, 0755) == 0); @@ -2197,27 +1927,6 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD - } - #endif // !WIN32 - - // Check that no read error has been reported yet - TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); - - printf("\n==== Testing that redundant locations are deleted on time\n"); - - // unpack the files for the redundant location test - TEST_THAT(::system("rm -rf testfiles/TestDir2") == 0); - TEST_THAT(::mkdir("testfiles/TestDir2", 0777) == 0); - - #ifdef WIN32 - TEST_THAT(::system("tar xzvf testfiles/spacetest1.tgz " - "-C testfiles/TestDir2") == 0); - #else - TEST_THAT(::system("gzip -d < testfiles/spacetest1.tgz " - "| ( cd testfiles/TestDir2 && tar xf - )") == 0); - #endif -======= if (failures) return 1; } #endif // !WIN32 @@ -2227,57 +1936,27 @@ int test_bbackupd() // ensure that the directory does not exist at the start TEST_THAT(::system("rm -rf testfiles/TestDir2") == 0); ->>>>>>> 0.12 // BLOCK { // Kill the daemon terminate_bbackupd(bbackupd_pid); -<<<<<<< HEAD - // Start it with a config that has a temporary location - // that will be created on the server -======= // Delete any old result marker files TEST_RETURN(0, system("rm -f testfiles/notifyran.*")); // Start it with a config that has a temporary location // whose path does not exist yet ->>>>>>> 0.12 std::string cmd = BBACKUPD " " + bbackupd_args + " testfiles/bbackupd-temploc.conf"; bbackupd_pid = LaunchServer(cmd, "testfiles/bbackupd.pid"); TEST_THAT(bbackupd_pid != -1 && bbackupd_pid != 0); -<<<<<<< HEAD - ::safe_sleep(1); -======= ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD - - sync_and_wait(); - - { - std::auto_ptr<BackupProtocolClient> client = - ConnectAndLogin(context, - BackupProtocolClientLogin::Flags_ReadOnly); - - std::auto_ptr<BackupStoreDirectory> dir = - ReadDirectory(*client, - BackupProtocolClientListDirectory::RootDirectory); - int64_t testDirId = SearchDir(*dir, "Test2"); - TEST_THAT(testDirId != 0); - - client->QueryFinished(); - sSocket.Close(); - } - -======= if (failures) return 1; TEST_THAT(!TestFileExists("testfiles/notifyran.backup-start.1")); @@ -2356,17 +2035,11 @@ int test_bbackupd() // BLOCK { ->>>>>>> 0.12 // Kill the daemon terminate_bbackupd(bbackupd_pid); // Start it again with the normal config (no Test2) -<<<<<<< HEAD - cmd = BBACKUPD " " + bbackupd_args + - " testfiles/bbackupd.conf"; -======= cmd = BBACKUPD " " + bbackupd_args + " testfiles/bbackupd.conf"; ->>>>>>> 0.12 bbackupd_pid = LaunchServer(cmd, "testfiles/bbackupd.pid"); TEST_THAT(bbackupd_pid != -1 && bbackupd_pid != 0); @@ -2377,10 +2050,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // Test2 should be deleted after 10 seconds (4 runs) wait_for_sync_end(); @@ -2392,18 +2062,10 @@ int test_bbackupd() { std::auto_ptr<BackupProtocolClient> client = ConnectAndLogin(context, -<<<<<<< HEAD - BackupProtocolClientLogin::Flags_ReadOnly); - - std::auto_ptr<BackupStoreDirectory> dir = - ReadDirectory(*client, - BackupProtocolClientListDirectory::RootDirectory); -======= BackupProtocolLogin::Flags_ReadOnly); std::auto_ptr<BackupStoreDirectory> dir = ReadDirectory(*client); ->>>>>>> 0.12 int64_t testDirId = SearchDir(*dir, "Test2"); TEST_THAT(testDirId != 0); @@ -2418,18 +2080,10 @@ int test_bbackupd() { std::auto_ptr<BackupProtocolClient> client = ConnectAndLogin(context, -<<<<<<< HEAD - BackupProtocolClientLogin::Flags_ReadOnly); - - std::auto_ptr<BackupStoreDirectory> root_dir = - ReadDirectory(*client, - BackupProtocolClientListDirectory::RootDirectory); -======= BackupProtocolLogin::Flags_ReadOnly); std::auto_ptr<BackupStoreDirectory> root_dir = ReadDirectory(*client); ->>>>>>> 0.12 TEST_THAT(test_entry_deleted(*root_dir, "Test2")); @@ -2442,20 +2096,12 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD - - if(bbackupd_pid > 0) - { - // Check that no read error has been reported yet - TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); -======= if (failures) return 1; if(bbackupd_pid > 0) { // Delete any old result marker files TEST_RETURN(0, system("rm -f testfiles/notifyran.*")); ->>>>>>> 0.12 printf("\n==== Check that read-only directories and " "their contents can be restored.\n"); @@ -2503,8 +2149,6 @@ int test_bbackupd() BackupQueries::ReturnCode::Compare_Same); TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -<<<<<<< HEAD -======= // Try a restore with just the remote directory name, // check that it uses the same name in the local // directory. @@ -2531,7 +2175,6 @@ int test_bbackupd() BackupQueries::ReturnCode::Compare_Same); TestRemoteProcessMemLeaks("bbackupquery.memleaks"); ->>>>>>> 0.12 // put the permissions back to sensible values #ifdef WIN32 TEST_THAT(::system("chmod 0755 testfiles/" @@ -2544,10 +2187,6 @@ int test_bbackupd() TEST_THAT(chmod("testfiles/restore1/x1", 0755) == 0); #endif -<<<<<<< HEAD - -======= ->>>>>>> 0.12 } #ifdef WIN32 @@ -2675,15 +2314,7 @@ int test_bbackupd() wait_for_backup_operation("upload of file with unicode name"); // Compare to check that the file was uploaded -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " -Wwarning " - "-c testfiles/bbackupd.conf \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 // Check that we can find it in directory listing { @@ -2691,12 +2322,7 @@ int test_bbackupd() ConnectAndLogin(context, 0); std::auto_ptr<BackupStoreDirectory> dir = ReadDirectory( -<<<<<<< HEAD - *client, - BackupProtocolClientListDirectory::RootDirectory); -======= *client); ->>>>>>> 0.12 int64_t baseDirId = SearchDir(*dir, "Test1"); TEST_THAT(baseDirId != 0); @@ -2870,10 +2496,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 printf("\n==== Check that SyncAllowScript is executed and can " "pause backup\n"); @@ -2944,18 +2567,7 @@ int test_bbackupd() long start_time = time(NULL); // check that no backup has run (compare fails) -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-Werror " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3.log " - "\"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Different); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Different); ->>>>>>> 0.12 TEST_THAT(unlink(sync_control_file) == 0); wait_for_sync_start(); @@ -2974,29 +2586,11 @@ int test_bbackupd() TEST_THAT(wait_time <= 12); wait_for_sync_end(); -<<<<<<< HEAD - // check that backup has run (compare succeeds) - compareReturnValue = ::system(BBACKUPQUERY " " - "-Wwarning " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3a.log " - "\"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); - - if (failures > 0) - { - // stop early to make debugging easier - return 1; - } -======= // check that backup has run (compare succeeds) TEST_COMPARE(Compare_Same); if (failures) return 1; ->>>>>>> 0.12 } // Check that no read error has been reported yet @@ -3006,10 +2600,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 printf("\n==== Delete file and update another, " "create symlink.\n"); @@ -3046,17 +2637,7 @@ int test_bbackupd() sync_and_wait(); // compare to make sure that it worked -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " -Wwarning " - "-c testfiles/bbackupd.conf " - "-l testfiles/query2.log " - "\"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 // Try a quick compare, just for fun compareReturnValue = ::system(BBACKUPQUERY " " @@ -3071,25 +2652,13 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // Check that store errors are reported neatly printf("\n==== Create store error\n"); TEST_THAT(system("rm -f testfiles/notifyran.backup-error.*") == 0); -<<<<<<< HEAD - // break the store - TEST_THAT(::rename("testfiles/0_0/backup/01234567/info.rf", - "testfiles/0_0/backup/01234567/info.rf.bak") == 0); - TEST_THAT(::rename("testfiles/0_1/backup/01234567/info.rf", - "testfiles/0_1/backup/01234567/info.rf.bak") == 0); - TEST_THAT(::rename("testfiles/0_2/backup/01234567/info.rf", - "testfiles/0_2/backup/01234567/info.rf.bak") == 0); -======= // Break the store. We need a write lock on the account // while we do this, otherwise housekeeping might be running // and might rewrite the info files when it finishes, @@ -3122,7 +2691,6 @@ int test_bbackupd() TEST_THAT(::rename("testfiles/0_2/backup/01234567/info.rf", "testfiles/0_2/backup/01234567/info.rf.bak") == 0); } ->>>>>>> 0.12 // Create a file to trigger an upload { @@ -3151,10 +2719,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 sync_and_wait(); @@ -3174,17 +2739,7 @@ int test_bbackupd() // Check that we DO get errors on compare (cannot do this // until after we fix the store, which creates a race) -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3b.log " - "-Werror \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Different); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Different); ->>>>>>> 0.12 // Test initial state TEST_THAT(!TestFileExists("testfiles/" @@ -3209,17 +2764,7 @@ int test_bbackupd() "notifyran.backup-start.wait-snapshot.1")); // Should not have backed up, should still get errors -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3b.log " - "-Werror \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Different); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Different); ->>>>>>> 0.12 // wait another 10 seconds, bbackup should have run wait_for_operation(10, "bbackupd to recover"); @@ -3227,17 +2772,7 @@ int test_bbackupd() "notifyran.backup-start.wait-snapshot.1")); // Check that it did get uploaded, and we have no more errors -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3b.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(::unlink("testfiles/notifyscript.tag") == 0); @@ -3271,10 +2806,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 sync_and_wait(); @@ -3290,27 +2822,13 @@ int test_bbackupd() // Check that we DO get errors on compare (cannot do this // until after we fix the store, which creates a race) -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3b.log " - "-Werror \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Different); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Different); ->>>>>>> 0.12 // Test initial state TEST_THAT(!TestFileExists("testfiles/" "notifyran.backup-start.wait-automatic.1")); -<<<<<<< HEAD - // Set a tag for the notify script to distinguist from -======= // Set a tag for the notify script to distinguish from ->>>>>>> 0.12 // previous runs. { int fd1 = open("testfiles/notifyscript.tag", @@ -3329,17 +2847,7 @@ int test_bbackupd() "notifyran.backup-start.wait-automatic.1")); // Should not have backed up, should still get errors -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3b.log " - "-Werror \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Different); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Different); ->>>>>>> 0.12 // wait another 10 seconds, bbackup should have run wait_for_operation(10, "bbackupd to recover"); @@ -3347,17 +2855,7 @@ int test_bbackupd() "notifyran.backup-start.wait-automatic.1")); // Check that it did get uploaded, and we have no more errors -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3b.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(::unlink("testfiles/notifyscript.tag") == 0); @@ -3365,10 +2863,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // Bad case: delete a file/symlink, replace it with a directory printf("\n==== Replace symlink with directory, " @@ -3394,26 +2889,13 @@ int test_bbackupd() #endif wait_for_backup_operation("bbackupd to sync the changes"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3c.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // And the inverse, replace a directory with a file/symlink printf("\n==== Replace directory with symlink\n"); @@ -3432,26 +2914,13 @@ int test_bbackupd() wait_for_backup_operation("bbackupd to sync the changes"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3d.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // And then, put it back to how it was before. printf("\n==== Replace symlink with directory " @@ -3473,26 +2942,13 @@ int test_bbackupd() wait_for_backup_operation("bbackupd to sync the changes"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3e.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // And finally, put it back to how it was before // it was put back to how it was before @@ -3514,26 +2970,13 @@ int test_bbackupd() wait_for_backup_operation("bbackupd to sync the changes"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3f.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // rename an untracked file over an // existing untracked file @@ -3557,17 +3000,7 @@ int test_bbackupd() wait_for_backup_operation("bbackupd to sync the " "untracked files"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3g.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 #ifdef WIN32 TEST_THAT(::unlink("testfiles/TestDir1/untracked-2") @@ -3582,26 +3015,13 @@ int test_bbackupd() wait_for_backup_operation("bbackupd to sync the untracked " "files again"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3g.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // case which went wrong: rename a tracked file over an // existing tracked file @@ -3630,17 +3050,7 @@ int test_bbackupd() sync_and_wait(); // compare to make sure that it worked -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3h.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 #ifdef WIN32 TEST_THAT(::unlink("testfiles/TestDir1/tracked-2") @@ -3655,26 +3065,13 @@ int test_bbackupd() wait_for_backup_operation("bbackupd to sync the tracked " "files again"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3i.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // case which went wrong: rename a tracked file // over a deleted file @@ -3685,17 +3082,7 @@ int test_bbackupd() wait_for_backup_operation("bbackupd to sync"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3j.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 // Check that no read error has been reported yet TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); @@ -3704,10 +3091,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 printf("\n==== Add files with old times, update " "attributes of one to latest time\n"); @@ -3732,26 +3116,13 @@ int test_bbackupd() // Wait and test wait_for_backup_operation("bbackupd to sync old files"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3k.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // Check that no read error has been reported yet TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); @@ -3802,26 +3173,13 @@ int test_bbackupd() wait_for_sync_end(); // files too new wait_for_sync_end(); // should (not) be backed up this time -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3l.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // Check that no read error has been reported yet TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); @@ -3842,17 +3200,7 @@ int test_bbackupd() wait_for_sync_end(); // compare with exclusions, should not find differences -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3m.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 // compare without exclusions, should find differences compareReturnValue = ::system(BBACKUPQUERY " " @@ -3867,10 +3215,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // check that the excluded files did not make it // into the store, and the included files did @@ -3880,18 +3225,10 @@ int test_bbackupd() { std::auto_ptr<BackupProtocolClient> client = ConnectAndLogin(context, -<<<<<<< HEAD - BackupProtocolClientLogin::Flags_ReadOnly); - - std::auto_ptr<BackupStoreDirectory> dir = ReadDirectory( - *client, - BackupProtocolClientListDirectory::RootDirectory); -======= BackupProtocolLogin::Flags_ReadOnly); std::auto_ptr<BackupStoreDirectory> dir = ReadDirectory(*client); ->>>>>>> 0.12 int64_t testDirId = SearchDir(*dir, "Test1"); TEST_THAT(testDirId != 0); @@ -3922,10 +3259,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 #ifndef WIN32 // These tests only work as non-root users. @@ -3951,21 +3285,9 @@ int test_bbackupd() // Wait and test... wait_for_backup_operation("bbackupd to try to sync " "unreadable file"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3o.log " - "-Werror \"compare -acQ\" quit"); - - // should find differences - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Error); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= // should fail with an error due to unreadable file TEST_COMPARE(Compare_Error); ->>>>>>> 0.12 // Check that it was reported correctly TEST_THAT(TestFileExists("testfiles/notifyran.read-error.1")); @@ -3986,10 +3308,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 printf("\n==== Continuously update file, " "check isn't uploaded\n"); @@ -4055,10 +3374,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 printf("\n==== Delete directory, change attributes\n"); @@ -4071,17 +3387,7 @@ int test_bbackupd() wait_for_backup_operation("bbackupd to sync deletion " "of directory"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query4.log " - "-Werror \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 printf("\n==== Restore files and directories\n"); int64_t deldirid = 0; @@ -4090,27 +3396,15 @@ int test_bbackupd() // connect and log in std::auto_ptr<BackupProtocolClient> client = ConnectAndLogin(context, -<<<<<<< HEAD - BackupProtocolClientLogin::Flags_ReadOnly); - - // Find the ID of the Test1 directory - restoredirid = GetDirID(*client, "Test1", - BackupProtocolClientListDirectory::RootDirectory); -======= BackupProtocolLogin::Flags_ReadOnly); // Find the ID of the Test1 directory restoredirid = GetDirID(*client, "Test1", BackupProtocolListDirectory::RootDirectory); ->>>>>>> 0.12 TEST_THAT(restoredirid != 0); // Test the restoration TEST_THAT(BackupClientRestore(*client, restoredirid, -<<<<<<< HEAD - "Test1", "testfiles/restore-Test1", - true /* print progress dots */) -======= "Test1" /* remote */, "testfiles/restore-Test1" /* local */, true /* print progress dots */, @@ -4118,7 +3412,6 @@ int test_bbackupd() false /* undelete after */, false /* resume */, false /* keep going */) ->>>>>>> 0.12 == Restore_Complete); // On Win32 we can't open another connection @@ -4127,15 +3420,11 @@ int test_bbackupd() // Make sure you can't restore a restored directory TEST_THAT(BackupClientRestore(*client, restoredirid, "Test1", "testfiles/restore-Test1", -<<<<<<< HEAD - true /* print progress dots */) -======= true /* print progress dots */, false /* restore deleted */, false /* undelete after */, false /* resume */, false /* keep going */) ->>>>>>> 0.12 == Restore_TargetExists); // Find ID of the deleted directory @@ -4145,18 +3434,12 @@ int test_bbackupd() // Just check it doesn't bomb out -- will check this // properly later (when bbackupd is stopped) TEST_THAT(BackupClientRestore(*client, deldirid, -<<<<<<< HEAD - "Test1", "testfiles/restore-Test1-x1", - true /* print progress dots */, - true /* deleted files */) -======= "Test1", "testfiles/restore-Test1-x1", true /* print progress dots */, true /* restore deleted */, false /* undelete after */, false /* resume */, false /* keep going */) ->>>>>>> 0.12 == Restore_Complete); // Make sure you can't restore to a nonexistant path @@ -4169,15 +3452,11 @@ int test_bbackupd() TEST_THAT(BackupClientRestore(*client, restoredirid, "Test1", "testfiles/no-such-path/subdir", -<<<<<<< HEAD - true /* print progress dots */) -======= true /* print progress dots */, true /* restore deleted */, false /* undelete after */, false /* resume */, false /* keep going */) ->>>>>>> 0.12 == Restore_TargetPathNotFound); } @@ -4187,28 +3466,13 @@ int test_bbackupd() } // Compare the restored files -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query10.log " - "-Wwarning " - "\"compare -cEQ Test1 testfiles/restore-Test1\" " - "quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 #ifdef WIN32 // make one of the files read-only, expect a compare failure @@ -4216,37 +3480,14 @@ int test_bbackupd() "testfiles\\restore-Test1\\f1.dat"); TEST_RETURN(compareReturnValue, 0); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query10a.log " - "-Werror " - "\"compare -cEQ Test1 testfiles/restore-Test1\" " - "quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Different); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Different); ->>>>>>> 0.12 // set it back, expect no failures compareReturnValue = ::system("attrib -r " "testfiles\\restore-Test1\\f1.dat"); TEST_RETURN(compareReturnValue, 0); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf -l testfiles/query10a.log " - "-Wwarning " - "\"compare -cEQ Test1 testfiles/restore-Test1\" " - "quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 // change the timestamp on a file, expect a compare failure char* testfile = "testfiles\\restore-Test1\\f1.dat"; @@ -4265,82 +3506,31 @@ int test_bbackupd() // a compare failure TEST_THAT(set_file_time(testfile, dummyTime, lastModTime, lastAccessTime)); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query10a.log " - "-Werror " - "\"compare -cEQ Test1 testfiles/restore-Test1\" " - "quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Different); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Different); ->>>>>>> 0.12 // last access time is not backed up, so it cannot be compared TEST_THAT(set_file_time(testfile, creationTime, lastModTime, dummyTime)); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query10a.log " - "-Wwarning " - "\"compare -cEQ Test1 testfiles/restore-Test1\" " - "quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 // last write time is backed up, so changing it should cause // a compare failure TEST_THAT(set_file_time(testfile, creationTime, dummyTime, lastAccessTime)); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query10a.log " - "-Werror " - "\"compare -cEQ Test1 testfiles/restore-Test1\" " - "quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Different); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Different); ->>>>>>> 0.12 // set back to original values, check that compare succeeds TEST_THAT(set_file_time(testfile, creationTime, lastModTime, lastAccessTime)); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query10a.log " - "-Wwarning " - "\"compare -cEQ Test1 testfiles/restore-Test1\" " - "quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 #endif // WIN32 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 printf("\n==== Add files with current time\n"); @@ -4357,26 +3547,13 @@ int test_bbackupd() // Wait and test wait_for_backup_operation("bbackupd to sync new files"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query5.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // Rename directory printf("\n==== Rename directory\n"); @@ -4385,17 +3562,7 @@ int test_bbackupd() wait_for_backup_operation("bbackupd to sync renamed directory"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query6.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 // and again, but with quick flag compareReturnValue = ::system(BBACKUPQUERY " " @@ -4417,26 +3584,13 @@ int test_bbackupd() wait_for_backup_operation("bbackupd to sync renamed files"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query6.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 // Check that modifying files with madly in the future // timestamps still get added @@ -4468,26 +3622,13 @@ int test_bbackupd() // Wait and test wait_for_backup_operation("bbackup to sync future file"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query3e.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 printf("\n==== Change client store marker\n"); @@ -4505,11 +3646,7 @@ int test_bbackupd() // Make sure the marker isn't zero, // because that's the default, and // it should have changed -<<<<<<< HEAD - std::auto_ptr<BackupProtocolClientLoginConfirmed> loginConf(protocol->QueryLogin(0x01234567, 0)); -======= std::auto_ptr<BackupProtocolLoginConfirmed> loginConf(protocol->QueryLogin(0x01234567, 0)); ->>>>>>> 0.12 TEST_THAT(loginConf->GetClientStoreMarker() != 0); // Change it to something else @@ -4534,10 +3671,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 printf("\n==== Check change of store marker pauses daemon\n"); @@ -4555,43 +3689,24 @@ int test_bbackupd() 3) / 2, "bbackupd to detect changed store marker"); // Test that there *are* differences -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query6.log " - "-Werror \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Different); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Different); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD - - // 100 seconds - (12*3/2) - wait_for_operation(82, "bbackupd to recover"); -======= if (failures) return 1; wait_for_operation(100, "bbackupd to recover"); // Then check it has backed up successfully. TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 #ifndef WIN32 printf("\n==== Interrupted restore\n"); @@ -4608,59 +3723,34 @@ int test_bbackupd() std::auto_ptr<BackupProtocolClient> client = ConnectAndLogin(context, -<<<<<<< HEAD - BackupProtocolClientLogin::Flags_ReadOnly); -======= BackupProtocolLogin::Flags_ReadOnly); ->>>>>>> 0.12 // Check that the restore fn returns resume possible, // rather than doing anything TEST_THAT(BackupClientRestore(*client, restoredirid, "Test1", "testfiles/restore-interrupt", -<<<<<<< HEAD - true /* print progress dots */) -======= true /* print progress dots */, false /* restore deleted */, false /* undelete after */, false /* resume */, false /* keep going */) ->>>>>>> 0.12 == Restore_ResumePossible); // Then resume it TEST_THAT(BackupClientRestore(*client, restoredirid, "Test1", "testfiles/restore-interrupt", true /* print progress dots */, -<<<<<<< HEAD - false /* deleted files */, - false /* undelete server */, - true /* resume */) -======= false /* restore deleted */, false /* undelete after */, true /* resume */, false /* keep going */) ->>>>>>> 0.12 == Restore_Complete); client->QueryFinished(); sSocket.Close(); // Then check it has restored the correct stuff -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query14.log " - "-Wwarning \"compare -cEQ Test1 " - "testfiles/restore-interrupt\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 } #endif // !WIN32 @@ -4668,10 +3758,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 printf("\n==== Check restore deleted files\n"); @@ -4684,13 +3771,9 @@ int test_bbackupd() "Test1", "testfiles/restore-Test1-x1-2", true /* print progress dots */, true /* deleted files */, -<<<<<<< HEAD - true /* undelete on server */) -======= true /* undelete after */, false /* resume */, false /* keep going */) ->>>>>>> 0.12 == Restore_Complete); client->QueryFinished(); @@ -4716,10 +3799,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 #ifdef WIN32 printf("\n==== Testing locked file behaviour:\n"); @@ -4746,10 +3826,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 if (handle != 0) { @@ -4766,10 +3843,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 if (handle != 0) { @@ -4787,36 +3861,20 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 if (handle != 0) { // compare, and check that it works // reports the correct error message (and finishes) -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query15a.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_THAT(compare_all(false)); ->>>>>>> 0.12 } TEST_THAT(ServerIsAlive(bbackupd_pid)); TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 if (handle != 0) { @@ -4826,17 +3884,7 @@ int test_bbackupd() O_LOCK, 0); TEST_THAT(handle != INVALID_HANDLE_VALUE); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query15.log " - "-Werror \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Error); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Error); ->>>>>>> 0.12 // close the file again, check that compare // works again @@ -4847,24 +3895,11 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD - - if (handle != 0) - { - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query15a.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= if (failures) return 1; if (handle != 0) { TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 } #endif @@ -4882,10 +3917,7 @@ int test_bbackupd() TEST_THAT(ServerIsAlive(bbstored_pid)); if (!ServerIsAlive(bbackupd_pid)) return 1; if (!ServerIsAlive(bbstored_pid)) return 1; -<<<<<<< HEAD -======= if (failures) return 1; ->>>>>>> 0.12 if(bbackupd_pid != -1 && bbackupd_pid != 0) { @@ -4893,17 +3925,7 @@ int test_bbackupd() wait_for_operation( (TIME_TO_WAIT_FOR_BACKUP_OPERATION*3) / 2, "bbackupd to sync everything"); -<<<<<<< HEAD - compareReturnValue = ::system(BBACKUPQUERY " " - "-c testfiles/bbackupd.conf " - "-l testfiles/query4a.log " - "-Wwarning \"compare -acQ\" quit"); - TEST_RETURN(compareReturnValue, - BackupQueries::ReturnCode::Compare_Same); - TestRemoteProcessMemLeaks("bbackupquery.memleaks"); -======= TEST_COMPARE(Compare_Same); ->>>>>>> 0.12 // Kill it again terminate_bbackupd(bbackupd_pid); @@ -4930,8 +3952,6 @@ int test_bbackupd() int test(int argc, const char *argv[]) { -<<<<<<< HEAD -======= { BackupDaemon daemon; @@ -4945,7 +3965,6 @@ int test(int argc, const char *argv[]) TEST_EQUAL(0, daemon.GetMaxBandwidthFromSyncAllowScript()); } ->>>>>>> 0.12 // SSL library SSLLib::Initialise(); |