[Box Backup-commit] COMMIT r1177 - box/chris/merge/infrastructure

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sun Nov 26 19:45:45 GMT 2006


Author: chris
Date: 2006-11-26 19:45:44 +0000 (Sun, 26 Nov 2006)
New Revision: 1177

Modified:
   box/chris/merge/infrastructure/makebuildenv.pl.in
Log:
 * Try to kill any daemons left over from previous tests before running 
   new tests.
 * Try to kill any remaining daemons at the end of the test (refs #3)


Modified: box/chris/merge/infrastructure/makebuildenv.pl.in
===================================================================
--- box/chris/merge/infrastructure/makebuildenv.pl.in	2006-11-26 19:43:20 UTC (rev 1176)
+++ box/chris/merge/infrastructure/makebuildenv.pl.in	2006-11-26 19:45:44 UTC (rev 1177)
@@ -401,24 +401,46 @@
 		sub writetestfile
 		{
 			my ($filename,$runcmd,$module) = @_;		
-			open TESTFILE,">$filename" or die "Can't open test script file for $module for writing\n";
+
+			open TESTFILE,">$filename" or die "Can't open " .
+				"test script file for $module for writing\n";
 			print TESTFILE "#!/bin/sh\necho TEST: $module\n";
+
 			if(-d "$module/testfiles")
 			{
 				print TESTFILE <<__E;
+echo Killing any running daemons...
+test -r testfiles/bbackupd.pid && kill `cat testfiles/bbackupd.pid`
+test -r testfiles/bbstored.pid && kill `cat testfiles/bbstored.pid`
+
 echo Removing old test files...
 rm -rf testfiles
+
 echo Copying new test files...
 cp -p -R ../../../$module/testfiles .
+
 __E
 			}
+
 			if(-e "$module/testextra")
 			{
-				open FL,"$module/testextra" or die "Can't open $module/testextra";
+				open FL,"$module/testextra" or die 
+					"Can't open $module/testextra";
 				while(<FL>) {print TESTFILE}
 				close FL;
 			}
+
 			print TESTFILE "$runcmd\n";
+
+			if(-d "$module/testfiles")
+			{
+				print TESTFILE <<__E;
+# echo Killing any running daemons...
+test -r testfiles/bbackupd.pid && kill `cat testfiles/bbackupd.pid`
+test -r testfiles/bbstored.pid && kill `cat testfiles/bbstored.pid`
+__E
+			}
+
 			close TESTFILE;
 		}
 		




More information about the Boxbackup-commit mailing list