ITS#4045 fix ldapsearch checks

This commit is contained in:
Howard Chu 2005-09-28 16:56:24 +00:00
parent 1769485868
commit 094f8f645d
2 changed files with 14 additions and 14 deletions

View File

@ -401,7 +401,7 @@ fi
echo "Testing operational attributes in request..." echo "Testing operational attributes in request..."
echo "# Testing operational attributes in request..." >> $SEARCHOUT echo "# Testing operational attributes in request..." >> $SEARCHOUT
$LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \ $LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \
'+' 2>&1 | grep -v '^entryCSN:' >> $SEARCHOUT '+' 2>&1 > $SEARCHFLT
RC=$? RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
@ -410,6 +410,8 @@ if test $RC != 0 ; then
exit $RC exit $RC
fi fi
grep -v '^entryCSN:' $SEARCHFLT >> $SEARCHOUT
echo -n "Testing compare (should be TRUE)... " echo -n "Testing compare (should be TRUE)... "
$LDAPCOMPARE -h $LOCALHOST -p $PORT1 "$BINDDN" \ $LDAPCOMPARE -h $LOCALHOST -p $PORT1 "$BINDDN" \
"sn:kovalev" >> $TESTOUT 2>&1 "sn:kovalev" >> $TESTOUT 2>&1

View File

@ -66,10 +66,7 @@ fi
echo "Searching unmodified database..." echo "Searching unmodified database..."
$LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 | \ $LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
$EGREP_CMD "(manager|secretary):" | sed "s/george/foster/g" | \
sort > $SEARCHOUT 2>&1
RC=$? RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
@ -77,6 +74,9 @@ if test $RC != 0 ; then
exit $RC exit $RC
fi fi
$EGREP_CMD "(manager|secretary):" $SEARCHOUT | sed "s/george/foster/g" | \
sort > $TESTOUT 2>&1
echo "Testing modrdn..." echo "Testing modrdn..."
$LDAPMODRDN -D "$REFINTDN" -r -h $LOCALHOST -p $PORT1 -w $PASSWD > \ $LDAPMODRDN -D "$REFINTDN" -r -h $LOCALHOST -p $PORT1 -w $PASSWD > \
/dev/null 2>&1 'uid=george,ou=users,o=refint' 'uid=foster' /dev/null 2>&1 'uid=george,ou=users,o=refint' 'uid=foster'
@ -92,8 +92,7 @@ fi
echo "Using ldapsearch to check dependents new rdn..." echo "Using ldapsearch to check dependents new rdn..."
$LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 | \ $LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
$EGREP_CMD "(manager|secretary):" | sort > $SEARCHFLT 2>&1
RC=$? RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
@ -102,8 +101,10 @@ RC=$?
exit $RC exit $RC
fi fi
$EGREP_CMD "(manager|secretary):" $SEARCHOUT | sort > $SEARCHFLT 2>&1
echo "Comparing ldapsearch results against original..." echo "Comparing ldapsearch results against original..."
$CMP $SEARCHOUT $SEARCHOUT > $CMPOUT $CMP $TESTOUT $SEARCHFLT > $CMPOUT
if test $? != 0 ; then if test $? != 0 ; then
echo "comparison failed - modify operations did not complete correctly" echo "comparison failed - modify operations did not complete correctly"
@ -127,8 +128,7 @@ if test $RC != 0 ; then
fi fi
echo "Using ldapsearch to verify dependents have been deleted..." echo "Using ldapsearch to verify dependents have been deleted..."
$LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 | \ $LDAPSEARCH -S "" -b "o=refint" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
$EGREP_CMD "(manager|secretary):" > $SEARCHFLT 2>&1
RC=$? RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
@ -137,6 +137,8 @@ if test $RC != 0 ; then
exit $RC exit $RC
fi fi
$EGREP_CMD "(manager|secretary):" $SEARCHOUT > $SEARCHFLT 2>&1
RC=`grep -c foster $SEARCHFLT` RC=`grep -c foster $SEARCHFLT`
if test $RC != 0 ; then if test $RC != 0 ; then
echo "dependent modify failed - dependents were not deleted" echo "dependent modify failed - dependents were not deleted"
@ -178,10 +180,6 @@ if test $RC != 0 ; then
exit $RC exit $RC
fi fi
#####
test $KILLSERVERS != no && kill -HUP $KILLPIDS test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded" echo ">>>>> Test succeeded"