ITS#6152 test pwdModify

This commit is contained in:
Howard Chu 2009-08-21 13:50:59 +00:00
parent 27c39c56c4
commit 07237a711c

View file

@ -493,6 +493,12 @@ mail: dots@admin.example2.com
-
EOF
RC=$?
if test $RC != 0 ; then
echo "ldapmodify failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
SLEEP=`expr $PCACHETTR + $PCACHE_CCPERIOD`
echo "Waiting $SLEEP seconds for cache to refresh"
@ -564,6 +570,44 @@ if test $RC != 0 ; then
exit 0
fi
echo ""
echo "Testing pwdModify"
$LDAPPASSWD -h $LOCALHOST -p $PORT2 \
-D "$MANAGERDN" -w "$PASSWD" -s newpw "$USERDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
RC=`grep "CACH.* BIND" $LOG2 | wc -l`
if test $RC != 3 ; then
echo "ldappasswd didn't update the cache"
test $KILLSERVERS != no && kill -HUP $KILLPIDS && wait
exit 0
fi
CNT=`expr $CNT + 1`
USERDN="cn=James A Jones 1,ou=Alumni Association,ou=People,dc=example,dc=com"
UPASSWD=newpw
echo "Query $CNT: (Bind should be cached)"
echo "# Query $CNT: (Bind should be cached)" >> $SEARCHOUT
$LDAPSEARCH -S "" -b "" -s base -h $LOCALHOST -p $PORT2 \
-D "$USERDN" -w "$UPASSWD" >> $SEARCHOUT 2>> $TESTOUT
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
RC=`grep "CACH.* BIND" $LOG2 | wc -l`
if test $RC != 4 ; then
echo "Bind wasn't answered from cache"
test $KILLSERVERS != no && kill -HUP $KILLPIDS && wait
exit 0
fi
test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded"