[Box Backup-dev] COMMIT r650 - in box/chris/general/test/bbackupd: . testfiles

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Wed Jul 19 03:36:48 BST 2006


Author: chris
Date: 2006-07-19 02:36:43 +0000 (Wed, 19 Jul 2006)
New Revision: 650

Modified:
   box/chris/general/test/bbackupd/testbbackupd.cpp
   box/chris/general/test/bbackupd/testfiles/extcheck1.pl
   box/chris/general/test/bbackupd/testfiles/extcheck2.pl
Log:
* bbackupd/testfiles/extcheck1.pl
* bbackupd/testfiles/extcheck2.pl
* bbackupd/testbbackupd.cpp
- More final fixes:
- Pass flags to extcheck*.pl to cause them not to check attributes
- Made locked file test work properly, and enabled it


Modified: box/chris/general/test/bbackupd/testbbackupd.cpp
===================================================================
--- box/chris/general/test/bbackupd/testbbackupd.cpp	2006-07-19 00:59:16 UTC (rev 649)
+++ box/chris/general/test/bbackupd/testbbackupd.cpp	2006-07-19 02:36:43 UTC (rev 650)
@@ -562,6 +562,13 @@
 	TestRemoteProcessMemLeaks("bbackupctl.memleaks");
 }
 
+void sync_and_wait()
+{
+	TEST_THAT(::system(BBACKUPCTL " -q -c testfiles/bbackupd.conf "
+		"force-sync") == 0);
+	TestRemoteProcessMemLeaks("bbackupctl.memleaks");
+}
+
 void terminate_bbackupd(int pid)
 {
 	TEST_THAT(::system(BBACKUPCTL " -q -c testfiles/bbackupd.conf "
@@ -915,7 +922,12 @@
 			printf("\n");
 			
 			// Check there's a difference
+			#ifdef WIN32
+			compareReturnValue = ::system("perl testfiles/extcheck1.pl A");
+			#else
 			compareReturnValue = ::system("perl testfiles/extcheck1.pl");
+			#endif
+
 			TEST_RETURN(compareReturnValue, 1);
 			TestRemoteProcessMemLeaks("bbackupquery.memleaks");
 
@@ -935,7 +947,12 @@
 			}
 			printf("\n");
 
+			#ifdef WIN32
+			compareReturnValue = ::system("perl testfiles/extcheck2.pl A");
+			#else
 			compareReturnValue = ::system("perl testfiles/extcheck2.pl");
+			#endif
+
 			TEST_RETURN(compareReturnValue, 1);
 			TestRemoteProcessMemLeaks("bbackupquery.memleaks");
 		}
@@ -1190,13 +1207,15 @@
 		TEST_THAT(!TestFileExists("testfiles/notifyran.store-full.2"));
 		TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.2"));
 
-		#if 0 // WIN32
+		#ifdef WIN32
 		printf("Testing locked file behaviour:\n");
 
 		// Test that locked files cannot be backed up,
 		// and the appropriate error is reported.
-		// Wait for a sync to finish, so that we have time to work
-		wait_for_sync_end();
+		// force a sync, since otherwise we will have to wait
+		// forever because of the ClientStoreMarker error above
+		// Wait for the sync to finish, so that we have time to work
+		sync_and_wait();
 		// Now we have about three seconds to work
 
 		HANDLE handle = openfile("testfiles/TestDir1/lockedfile",
@@ -1207,19 +1226,19 @@
 		{
 			// first sync will ignore the file, it's too new
 			wait_for_sync_end();
-			TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.2"));
+			TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1"));
 
 			// this sync should try to back up the file, 
 			// and fail, because it's locked
 			wait_for_sync_end();
-			TEST_THAT(TestFileExists("testfiles/notifyran.read-error.2"));
-			TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.3"));
+			TEST_THAT(TestFileExists("testfiles/notifyran.read-error.1"));
+			TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.2"));
 
 			// now close the file and check that it is
 			// backed up on the next run.
 			CloseHandle(handle);
 			wait_for_sync_end();
-			TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.3"));
+			TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.2"));
 
 			// compare, and check that it works
 			// reports the correct error message (and finishes)
@@ -1240,7 +1259,7 @@
 				" -q -c testfiles/bbackupd.conf "
 				"-l testfiles/query15.log "
 				"\"compare -ac\" quit");
-			TEST_RETURN(compareReturnValue, 2);
+			TEST_RETURN(compareReturnValue, 3);
 			TestRemoteProcessMemLeaks("bbackupquery.memleaks");
 
 			// close the file again, check that compare

Modified: box/chris/general/test/bbackupd/testfiles/extcheck1.pl
===================================================================
--- box/chris/general/test/bbackupd/testfiles/extcheck1.pl	2006-07-19 00:59:16 UTC (rev 649)
+++ box/chris/general/test/bbackupd/testfiles/extcheck1.pl	2006-07-19 02:36:43 UTC (rev 650)
@@ -1,7 +1,9 @@
 #!/usr/bin/perl
 use strict;
 
-unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac\" quit|")
+my $flags = $ARGV[0] or "";
+
+unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac$flags\" quit|")
 {
 	print "Couldn't open compare utility\n";
 	exit 2;

Modified: box/chris/general/test/bbackupd/testfiles/extcheck2.pl
===================================================================
--- box/chris/general/test/bbackupd/testfiles/extcheck2.pl	2006-07-19 00:59:16 UTC (rev 649)
+++ box/chris/general/test/bbackupd/testfiles/extcheck2.pl	2006-07-19 02:36:43 UTC (rev 650)
@@ -1,7 +1,9 @@
 #!/usr/bin/perl
 use strict;
 
-unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac\" quit|")
+my $flags = $ARGV[0] or "";
+
+unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac$flags\" quit|")
 {
 	print "Couldn't open compare utility\n";
 	exit 2;




More information about the Boxbackup-dev mailing list