diff options
author | Reinhard Tartler <siretart@tauware.de> | 2008-01-19 15:08:54 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2008-01-19 15:08:54 +0100 |
commit | 2733267954e91e394fbb512ea3abb4c497c0752f (patch) | |
tree | d6cdebd8776bceba06a2fb5e4ed06a4744bc1b57 /test/backupstorepatch/testbackupstorepatch.cpp | |
parent | 1d56581c644c53f1b9a182c6574bc2fc5243d4d1 (diff) |
import version 0.11rc1
This commit has been made by 'bzr import'. I used the upstream tarball
of Version 0.11rc1 for creating it. It has the md5sum:
75608d8bb72dff9a556850ccd0ae8cb9
Diffstat (limited to 'test/backupstorepatch/testbackupstorepatch.cpp')
-rw-r--r-- | test/backupstorepatch/testbackupstorepatch.cpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/test/backupstorepatch/testbackupstorepatch.cpp b/test/backupstorepatch/testbackupstorepatch.cpp index 9edd427b..57a28ec0 100644 --- a/test/backupstorepatch/testbackupstorepatch.cpp +++ b/test/backupstorepatch/testbackupstorepatch.cpp @@ -1,4 +1,4 @@ -// distribution boxbackup-0.10 (svn version: 494) +// distribution boxbackup-0.11rc1 (svn version: 2023_2024) // // Copyright (c) 2003 - 2006 // Ben Summers and contributors. All rights reserved. @@ -73,6 +73,7 @@ #include "MemBlockStream.h" #include "BackupClientFileAttributes.h" #include "BackupClientCryptoKeys.h" +#include "ServerControl.h" #include "MemLeakFindOn.h" @@ -347,7 +348,9 @@ int test(int argc, const char *argv[]) "testfiles/clientTrustedCAs.pem"); // Create an account - TEST_THAT_ABORTONFAIL(::system("../../bin/bbstoreaccounts/bbstoreaccounts -c testfiles/bbstored.conf create 01234567 0 30000B 40000B") == 0); + TEST_THAT_ABORTONFAIL(::system(BBSTOREACCOUNTS + " -c testfiles/bbstored.conf " + "create 01234567 0 30000B 40000B") == 0); TestRemoteProcessMemLeaks("bbstoreaccounts.memleaks"); // Create test files @@ -357,7 +360,8 @@ int test(int argc, const char *argv[]) test_depends_in_dirs(); // First, try logging in without an account having been created... just make sure login fails. - int pid = LaunchServer("../../bin/bbstored/bbstored testfiles/bbstored.conf", "testfiles/bbstored.pid"); + int pid = LaunchServer(BBSTORED " testfiles/bbstored.conf", + "testfiles/bbstored.pid"); TEST_THAT(pid != -1 && pid != 0); if(pid > 0) { @@ -435,7 +439,13 @@ int test(int argc, const char *argv[]) // Store details test_files[f].IDOnServer = stored->GetObjectID(); test_files[f].IsCompletelyDifferent = isCompletelyDifferent; - printf("ID %lld, completely different: %s\n", test_files[f].IDOnServer, + +#ifdef WIN32 + printf("ID %I64d, completely different: %s\n", +#else + printf("ID %lld, completely different: %s\n", +#endif + test_files[f].IDOnServer, test_files[f].IsCompletelyDifferent?"yes":"no"); } else @@ -603,9 +613,18 @@ int test(int argc, const char *argv[]) writedir.Commit(true); } - // Send the server a restart signal, so it does housekeeping immedaitely, and wait for it to happen - ::sleep(1); // wait for old connections to terminate +#ifdef WIN32 + // Cannot signal bbstored to do housekeeping now, + // so just wait until we're sure it's done + wait_for_operation(12); +#else + // Send the server a restart signal, so it does + // housekeeping immediately, and wait for it to happen + // Wait for old connections to terminate + ::sleep(1); ::kill(pid, SIGHUP); +#endif + // Get the revision number of the info file int64_t first_revision = 0; RaidFileRead::FileExists(0, "backup/01234567/o01", &first_revision); @@ -649,7 +668,10 @@ int test(int argc, const char *argv[]) // Kill store server TEST_THAT(KillServer(pid)); TEST_THAT(!ServerIsAlive(pid)); + + #ifndef WIN32 TestRemoteProcessMemLeaks("bbstored.memleaks"); + #endif } ::free(buffer); |