[Box Backup-commit] COMMIT r1918 - box/trunk/test/backupstorefix

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sun, 04 Nov 2007 15:20:10 +0000


Author: chris
Date: 2007-11-04 15:20:09 +0000 (Sun, 04 Nov 2007)
New Revision: 1918

Modified:
   box/trunk/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.

Fix comments.


Modified: box/trunk/test/backupstorefix/testbackupstorefix.cpp
===================================================================
--- box/trunk/test/backupstorefix/testbackupstorefix.cpp	2007-11-04 14:52:31 UTC (rev 1917)
+++ box/trunk/test/backupstorefix/testbackupstorefix.cpp	2007-11-04 15:20:09 UTC (rev 1918)
@@ -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