[Devel] [PATCH 03/11] Check for failure while waiting for checkpoint-ready

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Fri Jan 29 12:38:19 PST 2010


From: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
Date: Mon, 25 Jan 2010 18:09:50 -0800
Subject: [PATCH 03/11] Check for failure while waiting for checkpoint-ready

It is possible that an application has encountered an error before creating
the checkpoint-ready file. So while polling for 'checkpoint-ready' to be true,
look for errors in the log file.

Also, ensure filelock temp files are cleaned up by 'make clean'.

Signed-off-by: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
---
 fileio/Makefile         |    2 +-
 fileio/run-filelock1.sh |   24 +++++++++++++++---------
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/fileio/Makefile b/fileio/Makefile
index 40d19da..eb3887b 100644
--- a/fileio/Makefile
+++ b/fileio/Makefile
@@ -9,4 +9,4 @@ all: $(LIBCRTEST) $(targets)
 
 clean:
 	rm -f $(targets)
-	rm -rf cr_fileio*
+	rm -rf cr_fileio* cr_filelock1*
diff --git a/fileio/run-filelock1.sh b/fileio/run-filelock1.sh
index 0ba2d18..b4bbaec 100755
--- a/fileio/run-filelock1.sh
+++ b/fileio/run-filelock1.sh
@@ -45,11 +45,25 @@ checkpoint()
 	fi
 }
 
+function check_for_failure()
+{
+	grep --binary-files=text FAIL $PWD/$TEST_LOG > /dev/null 2>&1
+	if [ $? -eq 0 ]; then
+		$ECHO "\t***** Application FAILED after restart" >> $SCRIPT_LOG
+		$ECHO "\t***** See $TEST_LOG for details" >> $SCRIPT_LOG
+
+		$ECHO "\t***** Application FAILED after restart"
+		$ECHO "\tSee $PWD/$TEST_LOG for details"
+		exit 1;
+	fi
+}
+
 function wait_for_checkpoint_ready()
 {
 	# Wait for test to finish setup
 	while [ ! -f $CHECKPOINT_READY ]; do
 		$ECHO "\t- Waiting for $CHECKPOINT_READY"
+		check_for_failure;
 		sleep 1;
 	done;
 }
@@ -202,15 +216,7 @@ while [ $cnt -lt 20 ]; do
 	wait $nspid;
 	ret=$?
 
-	grep --binary-files=text FAIL $PWD/$TEST_LOG > /dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		$ECHO "\t***** Application FAILED after restart" >> $SCRIPT_LOG
-		$ECHO "\t***** See $TEST_LOG for details" >> $SCRIPT_LOG
-
-		$ECHO "\t***** Application FAILED after restart"
-		$ECHO "\tSee $PWD/$TEST_LOG for details"
-		exit 1;
-	fi
+	check_for_failure;
 
 	$ECHO "\t- Container exited, status $ret"
 
-- 
1.6.0.4

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list