]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9718 test022: preserve DELAY search output
authorHoward Chu <hyc@openldap.org>
Thu, 28 Oct 2021 22:51:39 +0000 (23:51 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 1 Nov 2021 17:15:05 +0000 (17:15 +0000)
Save a copy in $SEARCHOUT or test.out so it can be examined in
case the test fails.

tests/scripts/test022-ppolicy

index ad6a0f44cd471570b3d792f58c6ac76151585a9d..a30432d6967e3fc6ec09ff46affc7246453c65ed 100755 (executable)
@@ -103,8 +103,9 @@ if test $COUNT != 2 ; then
        exit 1
 fi
 
-DELAY=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
-    -b "$USER" -E accountUsability 1.1 | sed -n -e 's/.*seconds_before_unlock=\(\d*\)/\1/p'`
+DELAYATTR=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD -b "$USER" -E accountUsability 1.1`
+echo "$DELAYATTR" >> $SEARCHOUT
+DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*seconds_before_unlock=\(\d*\)/\1/p'`
 
 echo "Waiting $DELAY seconds for lockout to reset..."
 sleep $DELAY
@@ -119,8 +120,9 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-DELAY=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
-    -b "$USER" -E accountUsability 1.1 | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
+DELAYATTR=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD -b "$USER" -E accountUsability 1.1`
+echo "$DELAYATTR" >> $SEARCHOUT
+DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
 
 echo "Testing password expiration"
 echo "Waiting $DELAY seconds for password to expire..."
@@ -489,8 +491,9 @@ fi
 $LDAPSEARCH -e ppolicy -H $URI1 -D "$USER" -w $PASS \
        -b "$BASEDN" -s base > $SEARCHOUT 2>&1
 
-DELAY=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
-    -b "$USER" -E accountUsability 1.1 | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
+DELAYATTR=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD -b "$USER" -E accountUsability 1.1`
+echo "$DELAYATTR" >> $SEARCHOUT
+DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
 
 echo "Waiting $DELAY seconds for password to expire..."
 sleep $DELAY
@@ -734,8 +737,9 @@ delete: pwdReset
 
 EOMODS
 
-DELAY=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
-    -b "$USER" -E accountUsability 1.1 | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
+DELAYATTR=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD -b "$USER" -E accountUsability 1.1`
+echo "$DELAYATTR" >> $TESTOUT
+DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
 DELAY=`expr $DELAY - 10`
 
 echo "Testing password expiration"