echo "Testing operational attributes in request..."
echo "# Testing operational attributes in request..." >> $SEARCHOUT
$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
- '+' 2>&1 | grep -v '^entryCSN:' >> $SEARCHOUT
+ '+' 2>&1 > $SEARCHFLT
RC=$?
if test $RC != 0 ; then
exit $RC
fi
+grep -v '^entryCSN:' $SEARCHFLT >> $SEARCHOUT
+
echo -n "Testing compare (should be TRUE)... "
$LDAPCOMPARE -h $LOCALHOST -p $PORT1 "$BINDDN" \
"sn:kovalev" >> $TESTOUT 2>&1
echo "Searching unmodified database..."
-$LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 | \
- $EGREP_CMD "(manager|secretary):" | sed "s/george/foster/g" | \
- sort > $SEARCHOUT 2>&1
-
+$LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
exit $RC
fi
+$EGREP_CMD "(manager|secretary):" $SEARCHOUT | sed "s/george/foster/g" | \
+ sort > $TESTOUT 2>&1
+
echo "Testing modrdn..."
$LDAPMODRDN -D "$REFINTDN" -r -h $LOCALHOST -p $PORT1 -w $PASSWD > \
/dev/null 2>&1 'uid=george,ou=users,o=refint' 'uid=foster'
echo "Using ldapsearch to check dependents new rdn..."
-$LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 | \
- $EGREP_CMD "(manager|secretary):" | sort > $SEARCHFLT 2>&1
+$LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
exit $RC
fi
+$EGREP_CMD "(manager|secretary):" $SEARCHOUT | sort > $SEARCHFLT 2>&1
+
echo "Comparing ldapsearch results against original..."
-$CMP $SEARCHOUT $SEARCHOUT > $CMPOUT
+$CMP $TESTOUT $SEARCHFLT > $CMPOUT
if test $? != 0 ; then
echo "comparison failed - modify operations did not complete correctly"
fi
echo "Using ldapsearch to verify dependents have been deleted..."
-$LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 | \
- $EGREP_CMD "(manager|secretary):" > $SEARCHFLT 2>&1
+$LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
exit $RC
fi
+$EGREP_CMD "(manager|secretary):" $SEARCHOUT > $SEARCHFLT 2>&1
+
RC=`grep -c foster $SEARCHFLT`
if test $RC != 0 ; then
echo "dependent modify failed - dependents were not deleted"
exit $RC
fi
-
-
-#####
-
test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded"