]> git.sur5r.net Git - openldap/commitdiff
Added tests for special cases--->avoid regressions.
authorJuan Gomez <gomez@openldap.org>
Wed, 26 May 1999 02:17:21 +0000 (02:17 +0000)
committerJuan Gomez <gomez@openldap.org>
Wed, 26 May 1999 02:17:21 +0000 (02:17 +0000)
tests/scripts/test005-modrdn

index 70392336cfc477ad416116c7c4f3c228a18a8691..8a31e49e0251b23ece326659eb09c991d1435d6a 100755 (executable)
@@ -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