From: Howard Chu Date: Fri, 21 Aug 2009 13:50:59 +0000 (+0000) Subject: ITS#6152 test pwdModify X-Git-Tag: ACLCHECK_0~252 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=07237a711cc8a476dd201682a6bbc6b11c3209de;p=openldap ITS#6152 test pwdModify --- diff --git a/tests/scripts/test020-proxycache b/tests/scripts/test020-proxycache index 8502b4eda1..a31aa34168 100755 --- a/tests/scripts/test020-proxycache +++ b/tests/scripts/test020-proxycache @@ -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"