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
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`
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`
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`
TESTWD=`pwd`
+if [ -z "$STARTTIME" ]; then
+ STARTTIME=$(date +%s)
+fi
+export STARTTIME
+
# per instance
TESTDIR=${USER_TESTDIR-$TESTWD/testrun}
BASEPORT=${SLAPD_BASEPORT-9010}
MEMBEROFREFINTOUT=$DATADIR/memberof-refint.out
SHTOOL="$SRCDIR/../build/shtool"
+. $ABS_SRCDIR/scripts/functions.sh
--- /dev/null
+#! /bin/sh
+# $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## 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
+## <http://www.OpenLDAP.org/license.html>.
+
+timer() {
+ if [ -n "$STARTTIME" ]; then
+ date -u -d "now - $STARTTIME sec" +%T
+ fi
+}
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
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`
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`
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`