Whamcloud - gitweb
LU-13773 tests: subscript failure propagation 09/39409/14
authorJames Nunez <jnunez@whamcloud.com>
Fri, 24 Jul 2020 20:13:39 +0000 (14:13 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 1 Sep 2020 03:44:23 +0000 (03:44 +0000)
When a test script calls another test script and there is a
failure in the called test script, the failure is not
propagated up to the main/calling test suite and Maloo is
not registering the failed test.  An example of this is
sanity-dom calls sanity and sanityn, but, if a sanity test
fails, Maloo does not recognize the sanity failure.

Signed-off-by: James Nunez <jnunez@whamcloud.com>
Change-Id: I1914ecbece469cc1faffdffa4c980241ba3020b2
Reviewed-on: https://review.whamcloud.com/39409
Reviewed-by: Wei Liu <sarah@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-dom.sh
lustre/tests/test-framework.sh

index a95d62b..9385c21 100644 (file)
@@ -206,4 +206,4 @@ run_test sanityn "Run sanityn with Data-on-MDT files"
 
 complete $SECONDS
 check_and_cleanup_lustre
 
 complete $SECONDS
 check_and_cleanup_lustre
-exit_status
+exit_status "${TMP}/sanity.log ${TMP}/sanityn.log"
index 41ac61e..9354b38 100755 (executable)
@@ -6208,9 +6208,14 @@ error_noexit() {
 
 exit_status () {
        local status=0
 
 exit_status () {
        local status=0
-       local log=$TESTSUITELOG
+       local logs="$TESTSUITELOG $1"
+
+       for log in $logs; do
+               if [ -f "$log" ]; then
+                       grep -qw FAIL $log && status=1
+               fi
+       done
 
 
-       [ -f "$log" ] && grep -qw FAIL $log && status=1
        exit $status
 }
 
        exit $status
 }