diff --git a/tests/scripts/test005-modrdn b/tests/scripts/test005-modrdn index 70392336cf..8a31e49e02 100755 --- a/tests/scripts/test005-modrdn +++ b/tests/scripts/test005-modrdn @@ -73,6 +73,80 @@ if test $RC != 0 ; then exit $RC fi + +# Ensure the new rdn's can be found + +echo "Using ldapsearch to retrieve entries using new rdn (cn=James A Jones III)..." +$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \ + 'cn=James A Jones III' | egrep -iv '^createtimestamp:|^modifytimestamp:' \ + > $SEARCHOUT 2>&1 +RC=$? +if test $RC != 0 ; then + echo "ldapsearch failed!" + kill -HUP $PID + exit $RC +fi + + +LDIF=$MODRDNOUTMASTER0 + +echo "Filtering ldapsearch results..." +. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +echo "Filtering original ldif used to create database..." +. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +echo "Comparing filter output..." +cmp $SEARCHFLT $LDIFFLT + +if test $? != 0 ; then + echo "comparison failed - modrdn operations did not complete correctly" + kill -HUP $PID + exit 1 +fi + + +echo "Using ldapsearch to retrieve entries using new rdn (cn=James A Jones II)..." +$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \ + 'cn=James A Jones II' | egrep -iv '^createtimestamp:|^modifytimestamp:' \ + > $SEARCHOUT 2>&1 +RC=$? +if test $RC != 0 ; then + echo "ldapsearch failed!" + kill -HUP $PID + exit $RC +fi + + +LDIF=$MODRDNOUTMASTER1 + +echo "Filtering ldapsearch results..." +. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +echo "Filtering original ldif used to create database..." +. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +echo "Comparing filter output..." +cmp $SEARCHFLT $LDIFFLT + +if test $? != 0 ; then + echo "comparison failed - modrdn operations did not complete correctly" + kill -HUP $PID + exit 1 +fi + + + +# Ensure that you cannot find the entry for which the rdn was deleted as +# an attribute. + +echo "Using ldapsearch to retrieve entries using removed rdn (cn=James A Jones 2)..." +$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \ + 'cn=James A Jones 2' | egrep -iv '^createtimestamp:|^modifytimestamp:' \ + > /dev/null 2>&1 +RC=$? +if test $RC = 0 ; then + echo "failure: ldapsearch found attribute that was to be removed!" + kill -HUP $PID + exit $RC +fi + echo "Using ldapsearch to retrieve all the entries..." $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \ 'objectClass=*' > $SEARCHOUT 2>&1