Whamcloud - gitweb
LU-4304 tests: fix auster to detect "SKIP" test status 81/8381/3
authorJian Yu <jian.yu@intel.com>
Mon, 25 Nov 2013 03:41:28 +0000 (11:41 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 28 Dec 2013 03:25:16 +0000 (03:25 +0000)
This patch fixes run_suite() in auster to detect "SKIP"
test status for one test suite. If all of the sub-tests
in one test suite were skipped, then the status of the
test suite would be "SKIP" instead of "PASS".

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: Ice971aa4b15675c8a5f70f5b32092db69358565e
Reviewed-on: http://review.whamcloud.com/8381
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Wei Liu <wei3.liu@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/auster
lustre/tests/test-framework.sh

index 8f72494..d8570cc 100755 (executable)
@@ -11,6 +11,7 @@
 set -e
 
 export TF_FAIL=/tmp/tf.fail
+export TF_SKIP=/tmp/tf.skip
 
 usage() {
     less -F <<EOF
@@ -192,24 +193,28 @@ doit() {
 
 
 run_suite() {
-    suite_name=$1
-    suite_script=$2
-    title $suite_name
-    log_test $suite_name
-
-    rm -f $TF_FAIL
-    local start_ts=$(date +%s)
-    doit bash $suite_script
-    rc=$?
-    duration=$(($(date +%s) - $start_ts))
-    if [ -f $TF_FAIL -o $rc -ne 0 ]; then
-        status="FAIL"
-    else
-        status="PASS"
-    fi
-    log_test_status $duration $status
-
-    reset_lustre
+       local suite_name=$1
+       local suite_script=$2
+       title $suite_name
+       log_test $suite_name
+
+       rm -f $TF_FAIL
+       touch $TF_SKIP
+       local start_ts=$(date +%s)
+       doit bash $suite_script
+       local rc=$?
+       local duration=$(($(date +%s) - $start_ts))
+
+       local status="PASS"
+       if [[ $rc -ne 0 || -f $TF_FAIL ]]; then
+               status="FAIL"
+       elif [[ -f $TF_SKIP ]]; then
+               status="SKIP"
+       fi
+       log_test_status $duration $status
+       [[ ! -f $TF_SKIP ]] || rm -f $TF_SKIP
+
+       reset_lustre
 }
 
 run_suite_logged() {
index 14c5d3b..6b05b83 100644 (file)
@@ -4749,6 +4749,10 @@ run_one_logged() {
        fi
        log_sub_test_end $TEST_STATUS $duration "$RC" "$TEST_ERROR"
 
+       if [[ "$TEST_STATUS" != "SKIP" ]] && [[ -f $TF_SKIP ]]; then
+               rm -f $TF_SKIP
+       fi
+
        if [ -f $LOGDIR/err ]; then
                $FAIL_ON_ERROR && exit $RC
        fi