summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-12-12 17:22:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-12-12 17:22:10 +0000
commit55526d6577f82349bf6bb59816680d7483b61dff (patch)
tree456f8e2360e6bbd83e4f9a571f97cda281e4d9d9 /test
parentReleasing debian version 4.3+20241108-1. (diff)
downloadmdadm-55526d6577f82349bf6bb59816680d7483b61dff.tar.xz
mdadm-55526d6577f82349bf6bb59816680d7483b61dff.zip
Merging upstream version 4.3+20241202.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test')
-rwxr-xr-xtest33
1 files changed, 25 insertions, 8 deletions
diff --git a/test b/test
index f8f07ff..4b37a46 100755
--- a/test
+++ b/test
@@ -95,11 +95,22 @@ mdadm() {
return $rv
}
+print_time_elapsed() {
+ local start_sec=$1
+ local end_sec=$(date +%s)
+
+ local execution_time=$((end_sec - start_sec))
+
+ echo -ne "Execution time (seconds): ${execution_time} "
+}
+
do_test() {
_script=$1
_basename=`basename $_script`
_broken=0
+ local start_sec=$(date +%s)
+
if [ -f "$_script" ]
then
if [ -f "${_script}.broken" ]; then
@@ -121,6 +132,7 @@ do_test() {
echo -ne "$_script... "
if ( set -ex ; . $_script ) &> $targetdir/log
then
+ print_time_elapsed $start_sec
if [ -f "${_script}.inject_error" ]; then
echo "dmesg checking is skipped because test inject error"
else
@@ -130,6 +142,7 @@ do_test() {
succeed "succeeded\n"
_fail=0
else
+ print_time_elapsed $start_sec
save_log fail
_fail=1
if [ "$_broken" == "1" ]; then
@@ -137,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
}
@@ -327,6 +343,8 @@ main() {
[ "$savelogs" == "1" ] &&
echo "Saving logs to $logdir"
+ do_test_ret=0
+
while true; do
if [ "x$TESTLIST" != "x" ]
then
@@ -337,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
@@ -352,7 +369,7 @@ main() {
done
restore_selinux
- exit 0
+ exit $do_test_ret
}
parse_args $@