[Box Backup-commit] COMMIT r1960 - box/chris/general/test/backupstorefix

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sat, 8 Dec 2007 22:04:25 +0000 (UTC)


Author: chris
Date: 2007-12-08 22:04:25 +0000 (Sat, 08 Dec 2007)
New Revision: 1960

Modified:
   box/chris/general/test/backupstorefix/testbackupstorefix.cpp
Log:
Wait for long enough after creating test files that they will actually
be seen as old enough to upload by bbackupd. (merges [1918])


Modified: box/chris/general/test/backupstorefix/testbackupstorefix.cpp
===================================================================
--- box/chris/general/test/backupstorefix/testbackupstorefix.cpp	2007-12-08 22:03:16 UTC (rev 1959)
+++ box/chris/general/test/backupstorefix/testbackupstorefix.cpp	2007-12-08 22:04:25 UTC (rev 1960)
@@ -310,19 +310,24 @@
 		TEST_THAT_ABORTONFAIL(::system(PERL_EXECUTABLE 
 			" testfiles/testbackupstorefix.pl init") == 0);
 
-		int bbackupd_pid = LaunchServer(BBACKUPD 
-			" testfiles/bbackupd.conf", "testfiles/bbackupd.pid");
+		std::string cmd = BBACKUPD + bbackupd_args +
+			" testfiles/bbackupd.conf";
+		int bbackupd_pid = LaunchServer(cmd, "testfiles/bbackupd.pid");
 		TEST_THAT(bbackupd_pid != -1 && bbackupd_pid != 0);
 
 		if(bbackupd_pid > 0)
 		{
 			::safe_sleep(1);
 			TEST_THAT(ServerIsAlive(bbackupd_pid));
+
+			// Wait 4 more seconds for the files to be old enough
+			// to upload
+			::safe_sleep(4);
 	
-			// Create a nice store directory
+			// Upload files to create a nice store directory
 			::sync_and_wait();
 
-			// That'll do nicely, stop the server	
+			// Stop bbackupd
 			#ifdef WIN32
 				terminate_bbackupd(bbackupd_pid);
 				// implicit check for memory leaks