Whamcloud - gitweb
b=22075 buffalo-v2 should detect test timeouts
authorManoj Joseph <Manoj.Joseph@sun.com>
Thu, 29 Apr 2010 03:27:21 +0000 (21:27 -0600)
committerRobert Read <robert.read@oracle.com>
Thu, 29 Apr 2010 18:12:47 +0000 (11:12 -0700)
buffalo-v2 now detects test timeouts. It now generates status entries
in results.yml after a sub-test completes. If the test status is missing
a timeout is assumed to have occured.

i=robert.read
i=grev

lustre/tests/test-framework.sh
lustre/tests/yaml.sh

index ea708a2..3a9573e 100644 (file)
@@ -2713,6 +2713,7 @@ run_one_logged() {
     rm -rf $LOGDIR/err
 
     echo
+    log_sub_test_begin test_${1}
     (run_one $1 "$2") 2>&1 | tee $test_log
     local RC=${PIPESTATUS[0]}
 
@@ -2722,7 +2723,7 @@ run_one_logged() {
     duration=$((`date +%s` - $BEFORE))
     pass "(${duration}s)"
     [ -f $LOGDIR/err ] && TEST_ERROR=$(cat $LOGDIR/err)
-    log_sub_test test_${1} $TEST_STATUS $duration "$RC" "$TEST_ERROR"
+    log_sub_test_end $TEST_STATUS $duration "$RC" "$TEST_ERROR"
 
     if [ -f $LOGDIR/err ]; then
         $FAIL_ON_ERROR && exit $RC
@@ -3929,8 +3930,12 @@ log_test() {
     yml_log_test $1 >> $YAML_LOG
 }
 
-log_sub_test() {
-    yml_log_sub_test $@ >> $YAML_LOG
+log_sub_test_begin() {
+    yml_log_sub_test_begin $@ >> $YAML_LOG
+}
+
+log_sub_test_end() {
+    yml_log_sub_test_end $@ >> $YAML_LOG
 }
 
 run_llverdev()
index 506a1e7..4dbdfe7 100644 (file)
@@ -159,15 +159,20 @@ yml_log_test_status() {
 EOF
 }
 
-yml_log_sub_test() {
+yml_log_sub_test_begin() {
     cat <<EOF
         -
             name: $1
-            status: $2
-            duration: $3
-            return_code: $4
 EOF
-    shift 4
+}
+
+yml_log_sub_test_end() {
+    cat <<EOF
+            status: $1
+            duration: $2
+            return_code: $3
+EOF
+    shift 3
     if [ -z "$*" ]; then
         printf '            error:\n'
     else