[Box Backup-commit] COMMIT r1503 - box/chris/general/test/backupstorepatch
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Sun Mar 25 02:05:45 BST 2007
Author: chris
Date: 2007-03-25 02:05:45 +0100 (Sun, 25 Mar 2007)
New Revision: 1503
Modified:
box/chris/general/test/backupstorepatch/testbackupstorepatch.cpp
Log:
Merge back changes from chris/merge:
Use #defined paths to executables to reduce unix/win32 differences.
Reformat long lines for readability.
Modified: box/chris/general/test/backupstorepatch/testbackupstorepatch.cpp
===================================================================
--- box/chris/general/test/backupstorepatch/testbackupstorepatch.cpp 2007-03-25 00:50:44 UTC (rev 1502)
+++ box/chris/general/test/backupstorepatch/testbackupstorepatch.cpp 2007-03-25 01:05:45 UTC (rev 1503)
@@ -310,12 +310,10 @@
"testfiles/clientTrustedCAs.pem");
// Create an account
-#ifdef WIN32
- TEST_THAT_ABORTONFAIL(::system("..\\..\\bin\\bbstoreaccounts\\bbstoreaccounts -c testfiles/bbstored.conf create 01234567 0 30000B 40000B") == 0);
-#else
- 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");
-#endif
// Create test files
create_test_files();
@@ -324,12 +322,8 @@
test_depends_in_dirs();
// First, try logging in without an account having been created... just make sure login fails.
-#ifdef WIN32
- int pid = LaunchServer("..\\..\\bin\\bbstored\\bbstored testfiles/bbstored.conf", "testfiles/bbstored.pid");
-#else
- int pid = LaunchServer("../../bin/bbstored/bbstored testfiles/bbstored.conf", "testfiles/bbstored.pid");
-#endif
-
+ int pid = LaunchServer(BBSTORED " testfiles/bbstored.conf",
+ "testfiles/bbstored.pid");
TEST_THAT(pid != -1 && pid != 0);
if(pid > 0)
{
@@ -582,10 +576,14 @@
}
#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
- ::sleep(1); // wait for old connections to terminate
+ // 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
More information about the Boxbackup-commit
mailing list