Issue 9718 - test022 can fail on expiry
Summary: test022 can fail on expiry
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: build (show other issues)
Version: 2.5.8
Hardware: All All
: --- normal
Target Milestone: 2.6.1
Assignee: Howard Chu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-11 20:40 UTC by Quanah Gibson-Mount
Modified: 2023-01-30 23:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Quanah Gibson-Mount 2021-10-11 20:40:16 UTC
>>>>> Starting test022-ppolicy for mdb...
running defines.sh
Starting slapd on TCP/IP port 9011...
Using ldapsearch to check that slapd is running...
Testing redundant ppolicy instance...
Using ldapadd to populate the database...
Testing account lockout...
Waiting 13 seconds for lockout to reset...
Testing password expiration
Waiting  seconds for password to expire...
sleep: missing operand
Try 'sleep --help' for more information.
Password expiration test failed
>>>>> test022-ppolicy failed for mdb after 43 seconds
(exit 1)


The issue here is apparently that line 122-123 failed to populate the DELAY variable.

121
122 DELAY=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
123     -b "$USER" -E accountUsability 1.1 | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
124
125 echo "Testing password expiration"
126 echo "Waiting $DELAY seconds for password to expire..."
127 sleep $DELAY
128 sleep 1
Comment 1 Ondřej Kuzník 2021-10-12 09:14:39 UTC
If you add a "tee -a $TESTOUT", what is the output of ldapsearch here? Might be a legitimate failure for all we know ;)
Comment 2 Howard Chu 2021-10-28 22:54:14 UTC
Script changed to save the output from $LDAPSEARCH so it can be examined in case of failures. https://git.openldap.org/openldap/openldap/-/merge_requests/431
Comment 3 Quanah Gibson-Mount 2021-11-01 19:54:18 UTC
  • f07f8c20 
by Howard Chu at 2021-11-01T17:15:05+00:00 
ITS#9718 test022: preserve DELAY search output
Comment 4 Quanah Gibson-Mount 2021-11-01 19:57:02 UTC
RE26:

 fce2a2d2 
by Howard Chu at 2021-11-01T19:54:44+00:00 
ITS#9718 test022: preserve DELAY search output
Comment 5 Quanah Gibson-Mount 2023-01-30 20:39:41 UTC
This commit broke test022 on BSD OSes as it uses non portable SED syntax:

Running ./scripts/test022-ppolicy for mdb...
running defines.sh
Starting slapd on TCP/IP port 9011...
Using ldapsearch to check that slapd is running...
Testing redundant ppolicy instance...
Using ldapadd to populate the database...
Testing account lockout...
sed: 1: "s/.*seconds_before_unlo ...": RE error: trailing backslash (\)
ldapsearch failed (49)!
Comment 6 Quanah Gibson-Mount 2023-01-30 23:01:34 UTC
head:

  • b220ba10 
by Quanah Gibson-Mount at 2023-01-30T22:06:06+00:00 
ITS#9718 - Fix nonportable sed usage

RE26:

  • cc5d35f8 
by Quanah Gibson-Mount at 2023-01-30T22:59:19+00:00 
ITS#9718 - Fix nonportable sed usage


RE25:

  • 0d8122cd 
by Quanah Gibson-Mount at 2023-01-30T23:00:30+00:00 
ITS#9718 - Fix nonportable sed usage