diff --git a/tests/scripts/all b/tests/scripts/all
index cd6690c779..a4808f4358 100755
--- a/tests/scripts/all
+++ b/tests/scripts/all
@@ -25,7 +25,7 @@ FAILCOUNT=0
SKIPCOUNT=0
SLEEPTIME=10
-echo ">>>>> Executing all LDAP tests for $BACKEND"
+echo ">>>>> $(timer) Executing all LDAP tests for $BACKEND"
if [ -n "$NOEXIT" ]; then
echo "Result Test" > $TESTWD/results
@@ -50,7 +50,7 @@ for CMD in $SRCDIR/scripts/test*; do
BCMD=`basename $CMD`
if [ -x "$CMD" ]; then
- MSG=">>>>> Starting ${TB}$BCMD${TN} for $BACKEND..."
+ MSG=">>>>> $(timer) Starting ${TB}$BCMD${TN} for $BACKEND..."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
START=`date +%s`
@@ -63,11 +63,11 @@ for CMD in $SRCDIR/scripts/test*; do
END=`date +%s`
if test $RC -eq 0 ; then
- MSG=">>>>> Finished $BCMD for $BACKEND after $(( $END - $START )) seconds."
+ MSG=">>>>> $(timer) Finished $BCMD for $BACKEND after $(( $END - $START )) seconds."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
else
- MSG=">>>>> Failed $BCMD for $BACKEND after $(( $END - $START )) seconds"
+ MSG=">>>>> $(timer) Failed $BCMD for $BACKEND after $(( $END - $START )) seconds"
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
FAILCOUNT=`expr $FAILCOUNT + 1`
@@ -80,7 +80,7 @@ for CMD in $SRCDIR/scripts/test*; do
fi
fi
else
- MSG=">>>>> Skipping ${TB}$BCMD${TN} for $BACKEND."
+ MSG=">>>>> $(timer) Skipping ${TB}$BCMD${TN} for $BACKEND."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
SKIPCOUNT=`expr $SKIPCOUNT + 1`
diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh
index 23e7c0c2f7..192b30440e 100755
--- a/tests/scripts/defines.sh
+++ b/tests/scripts/defines.sh
@@ -17,6 +17,11 @@ umask 077
TESTWD=`pwd`
+if [ -z "$STARTTIME" ]; then
+ STARTTIME=$(date +%s)
+fi
+export STARTTIME
+
# per instance
TESTDIR=${USER_TESTDIR-$TESTWD/testrun}
BASEPORT=${SLAPD_BASEPORT-9010}
@@ -455,3 +460,4 @@ MEMBEROFOUT=$DATADIR/memberof.out
MEMBEROFREFINTOUT=$DATADIR/memberof-refint.out
SHTOOL="$SRCDIR/../build/shtool"
+. $ABS_SRCDIR/scripts/functions.sh
diff --git a/tests/scripts/functions.sh b/tests/scripts/functions.sh
new file mode 100755
index 0000000000..c10dfebc44
--- /dev/null
+++ b/tests/scripts/functions.sh
@@ -0,0 +1,20 @@
+#! /bin/sh
+# $OpenLDAP$
+## This work is part of OpenLDAP Software .
+##
+## Copyright 2022 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## .
+
+timer() {
+ if [ -n "$STARTTIME" ]; then
+ date -u -d "now - $STARTTIME sec" +%T
+ fi
+}
diff --git a/tests/scripts/lloadd-all b/tests/scripts/lloadd-all
index 3f744d1881..07a90de867 100755
--- a/tests/scripts/lloadd-all
+++ b/tests/scripts/lloadd-all
@@ -25,7 +25,7 @@ FAILCOUNT=0
SKIPCOUNT=0
SLEEPTIME=10
-echo ">>>>> Executing all LDAP tests for the Load Balancer"
+echo ">>>>> $(timer) Executing all LDAP tests for the Load Balancer"
if [ -n "$NOEXIT" ]; then
echo "Result Test" > $TESTWD/results
@@ -49,7 +49,7 @@ for CMD in $SRCDIR/scripts/lloadd/test*; do
BCMD=`basename $CMD`
if [ -x "$CMD" ]; then
- MSG=">>>>> Starting ${TB}$BCMD${TN} for lloadd+$BACKEND..."
+ MSG=">>>>> $(timer) Starting ${TB}$BCMD${TN} for lloadd+$BACKEND..."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
START=`date +%s`
@@ -62,11 +62,11 @@ for CMD in $SRCDIR/scripts/lloadd/test*; do
END=`date +%s`
if test $RC -eq 0 ; then
- MSG=">>>>> Finished $BCMD for lloadd+$BACKEND after $(( $END - $START )) seconds."
+ MSG=">>>>> $(timer) Finished $BCMD for lloadd+$BACKEND after $(( $END - $START )) seconds."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
else
- MSG=">>>>> Failed $BCMD for lloadd+$BACKEND after $(( $END - $START )) seconds"
+ MSG=">>>>> $(timer) Failed $BCMD for lloadd+$BACKEND after $(( $END - $START )) seconds"
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
FAILCOUNT=`expr $FAILCOUNT + 1`
@@ -79,7 +79,7 @@ for CMD in $SRCDIR/scripts/lloadd/test*; do
fi
fi
else
- MSG=">>>>> Skipping ${TB}$BCMD${TN} for lloadd+$BACKEND."
+ MSG=">>>>> $(timer) Skipping ${TB}$BCMD${TN} for lloadd+$BACKEND."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
SKIPCOUNT=`expr $SKIPCOUNT + 1`