diff options
author | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-11-26 09:36:38 +0100 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-11-27 13:55:06 +0100 |
commit | 4447238f882270bb7239c38510c5ce08bc3880b9 (patch) | |
tree | 88f518464e81685faffe7ded03fec7b361b87530 | |
parent | test: Log execution time (diff) | |
download | mdadm-4447238f882270bb7239c38510c5ce08bc3880b9.tar.xz mdadm-4447238f882270bb7239c38510c5ce08bc3880b9.zip |
test: return fail if any failed
GH action status should be failed if any test failed.
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
-rwxr-xr-x | test | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -150,11 +150,14 @@ do_test() { fi fi restore_system_speed_limit - [ "$savelogs" == "1" ] && - mv -f $targetdir/log $logdir/$_basename.log + + [ "$savelogs" == "1" ] && mv -f $targetdir/log $logdir/$_basename.log + [ "$ctrl_c_error" == "1" ] && exit 1 - [ "$_fail" == "1" -a "$exitonerror" == "1" \ - -a "$_broken" == "0" ] && exit 1 + + [ "$_fail" == "1" -a "$exitonerror" == "1" -a "$_broken" == "0" ] && exit 1 + + [ "$_fail" == "1" ] && do_test_ret=1 fi } @@ -340,6 +343,8 @@ main() { [ "$savelogs" == "1" ] && echo "Saving logs to $logdir" + do_test_ret=0 + while true; do if [ "x$TESTLIST" != "x" ] then @@ -350,11 +355,10 @@ main() { else for script in $testdir/$prefix $testdir/$prefix*[^~] do - case $script in - *.broken) ;; + case $script in *.broken) ;; *) do_test $script - esac + esac done fi @@ -365,7 +369,7 @@ main() { done restore_selinux - exit 0 + exit $do_test_ret } parse_args $@ |