https://bugs.openldap.org/show_bug.cgi?id=10582
Issue ID: 10582 Summary: The method 'date -u -r ... %T' to print time periods when testing is incorrectly implemented Product: OpenLDAP Version: 2.6.14 Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: test suite Assignee: bugs@openldap.org Reporter: Peter_Dyballa@Web.DE Target Milestone: ---
'date -u -r ... %T' works when "..." stands for a file name. Otherwise one gets:
In tests/scripts/all the decision is made which date utility has to be controlled:
# check for BSD vs GNU date date -j >/dev/null 2>&1 RC=$? if [ $RC -ne 0 ]; then DATEOPT="-d @" else DATEOPT="-r " fi
On Macs 'date -j' produces useful output (So 30 Aug 2026 18:57:39 CEST), so it's decided to use -r on Macs – which implies that the argument following this option is a file. And so date has to complain:
date: 0: No such file or directory ... date: 23: No such file or directory ...
It might work to change the time() function become for example:
timer() { if [ -n "$STARTTIME" ]; then now=`date +%s` delta=`expr $now - $STARTTIME` touch $delta date -u $DATEOPT $delta +%T fi }
For Macs it might work to patch tests/scripts/all to start with
gdate -j >/dev/null 2>&1
Then timer() would use -d @ which gdate and the macOS systems' date do understand.