ITS#9931 test scripts: fix BSD vs GNU date syntax

This commit is contained in:
Howard Chu 2022-10-11 15:14:54 +01:00
parent a858f892b3
commit 62f52807e2
2 changed files with 12 additions and 1 deletions

View file

@ -25,6 +25,15 @@ FAILCOUNT=0
SKIPCOUNT=0
SLEEPTIME=10
# check for BSD vs GNU date
date -j >/dev/null 2>&1
RC=$?
if [ $RC -ne 0 ]; then
DATEOPT="-d @"
else
DATEOPT="-r "
fi
echo ">>>>> $(timer) Executing all LDAP tests for $BACKEND"
if [ -n "$NOEXIT" ]; then

View file

@ -15,6 +15,8 @@
timer() {
if [ -n "$STARTTIME" ]; then
date -u -d "now - $STARTTIME sec" +%T
now=`date +%s`
delta=`expr $now - $STARTTIME`
date -u $DATEOPT$delta +%T
fi
}