From 9604442677fcac62ae0599b9e36340587835afe0 Mon Sep 17 00:00:00 2001 From: James Nunez Date: Thu, 26 Sep 2013 15:21:42 -0600 Subject: [PATCH] LU-3764 tests: Make calls to error_ignore not trigger FAIL Currently, error_ignore calls error_noexit with a status of IGNORE and a message/comment. error_noexit writes the comment to the $LOGDIR/err file. If there is an err file, the pass routine assumes the test failed and reports the test status as FAIL. So, for errors that should be ignored, we don't want to be writing the comment out to the err file. Now, any message with an "IGNORE" status is written to $LOGDIR/ignore file and, thus, the test will no longer be classified as FAIL and the error will really be ignored. Signed-off-by: James Nunez Change-Id: I30f5387105f6cbce54050682b16387f73ab541d6 Reviewed-on: http://review.whamcloud.com/7782 Reviewed-by: Minh Diep Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- lustre/tests/test-framework.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 9b8737a..1ba5230 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -4275,7 +4275,11 @@ error_noexit() { if [ -z "$*" ]; then echo "error() without useful message, please fix" > $LOGDIR/err else - echo "$@" > $LOGDIR/err + if [[ `echo $TYPE | grep ^IGNORE` ]]; then + echo "$@" > $LOGDIR/ignore + else + echo "$@" > $LOGDIR/err + fi fi } @@ -4554,6 +4558,7 @@ run_one_logged() { local name=${TESTSUITE}.test_${1}.test_log.$(hostname -s).log local test_log=$LOGDIR/$name rm -rf $LOGDIR/err + rm -rf $LOGDIR/ignore rm -rf $LOGDIR/skip local SAVE_UMASK=`umask` umask 0022 @@ -4563,7 +4568,7 @@ run_one_logged() { (run_one $1 "$2") 2>&1 | tee -i $test_log local RC=${PIPESTATUS[0]} - [ $RC -ne 0 ] && [ ! -f $LOGDIR/err ] && \ + [ $RC -ne 0 ] && [ ! -f $LOGDIR/err ] && echo "test_$1 returned $RC" | tee $LOGDIR/err duration=$((`date +%s` - $BEFORE)) @@ -4571,6 +4576,8 @@ run_one_logged() { if [[ -f $LOGDIR/err ]]; then TEST_ERROR=$(cat $LOGDIR/err) + elif [[ -f $LOGDIR/ignore ]]; then + TEST_ERROR=$(cat $LOGDIR/ignore) elif [[ -f $LOGDIR/skip ]]; then TEST_ERROR=$(cat $LOGDIR/skip) fi -- 1.8.3.1