summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-11-26 09:36:38 +0100
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-11-27 13:55:06 +0100
commit4447238f882270bb7239c38510c5ce08bc3880b9 (patch)
tree88f518464e81685faffe7ded03fec7b361b87530
parenttest: Log execution time (diff)
downloadmdadm-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-xtest20
1 files changed, 12 insertions, 8 deletions
diff --git a/test b/test
index 76e64ea7..4b37a46b 100755
--- a/test
+++ b/test
@@ -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 $@