Whamcloud - gitweb
b=5494
authornathan <nathan>
Thu, 18 Oct 2007 17:42:47 +0000 (17:42 +0000)
committernathan <nathan>
Thu, 18 Oct 2007 17:42:47 +0000 (17:42 +0000)
i=adilger
add error_ignore method to run test but ignore failures

lustre/tests/recovery-small.sh
lustre/tests/test-framework.sh

index fbcc420..ae099f3 100755 (executable)
@@ -550,7 +550,7 @@ test_24() { # bug 2248 - eviction fails writeback but app doesn't see it
        rc=$?
        sysctl -w lustre.fail_loc=0x0
        client_reconnect
-       [ $rc -eq 0 ] && error "multiop didn't fail fsync: rc $rc" || true
+       [ $rc -eq 0 ] && error_ignore 5494 "multiop didn't fail fsync: rc $rc" || true
 }
 run_test 24 "fsync error (should return error)"
 
index 7f3a1f6..37f50e5 100644 (file)
@@ -1032,13 +1032,16 @@ debugrestore() {
     DEBUGSAVE=""
 }
 
-FAIL_ON_ERROR=true
 ##################################
 # Test interface 
+##################################
+
 error() {
+    local FAIL_ON_ERROR=${FAIL_ON_ERROR:-true}
+    local TYPE=${TYPE:-"FAIL"}
     local ERRLOG
     sysctl -w lustre.fail_loc=0 2> /dev/null || true
-    log "${TESTSUITE} ${TESTNAME}: **** FAIL:" $@
+    log "${TESTSUITE} ${TESTNAME}: **** ${TYPE}:" $@
     ERRLOG=$TMP/lustre_${TESTSUITE}_${TESTNAME}.$(date +%s)
     echo "Dumping lctl log to $ERRLOG"
     # We need to dump the logs on all nodes
@@ -1046,12 +1049,19 @@ error() {
     [ ! "$mds_HOST" = "$(hostname)" ] && do_node $mds_HOST $LCTL dk $ERRLOG
     [ ! "$ost_HOST" = "$(hostname)" -a ! "$ost_HOST" = "$mds_HOST" ] && do_node $ost_HOST $LCTL dk $ERRLOG
     debugrestore
-    [ "$TESTSUITELOG" ] && echo "$0: FAIL: $TESTNAME $@" >> $TESTSUITELOG
+    [ "$TESTSUITELOG" ] && echo "$0: ${TYPE}: $TESTNAME $@" >> $TESTSUITELOG
     if $FAIL_ON_ERROR; then
        exit 1
     fi
 }
 
+# use only if we are ignoring failures for this test, bugno required.
+# (like ALWAYS_EXCEPT, but run the test and ignore the results.)
+# e.g. error_ignore 5494 "your message"
+error_ignore() {
+    FAIL_ON_ERROR=false TYPE="IGNORE (bz$1)" error $2
+}
+
 skip () {
        log " SKIP: ${TESTSUITE} ${TESTNAME} $@"
        [ "$TESTSUITELOG" ] && echo "${TESTSUITE}: SKIP: $TESTNAME $@" >> $TESTSUITELOG