Whamcloud - gitweb
LU-3764 tests: Make calls to error_ignore not trigger FAIL 82/7782/3
authorJames Nunez <james.a.nunez@intel.com>
Thu, 26 Sep 2013 21:21:42 +0000 (15:21 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 25 Oct 2013 02:24:05 +0000 (02:24 +0000)
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 <james.a.nunez@intel.com>
Change-Id: I30f5387105f6cbce54050682b16387f73ab541d6
Reviewed-on: http://review.whamcloud.com/7782
Reviewed-by: Minh Diep <minh.diep@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/test-framework.sh

index 9b8737a..1ba5230 100644 (file)
@@ -4275,7 +4275,11 @@ error_noexit() {
        if [ -z "$*" ]; then
                echo "error() without useful message, please fix" > $LOGDIR/err
        else
        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
 }
 
        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
        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
        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]}
 
        (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))
                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)
 
        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
        elif [[ -f $LOGDIR/skip ]]; then
                TEST_ERROR=$(cat $LOGDIR/skip)
        fi