add test for rootdn; better check search results (not over yet)...

This commit is contained in:
Pierangelo Masarati 2004-06-21 10:06:23 +00:00
parent 120470e1d6
commit 40a632cdde

View File

@ -88,6 +88,55 @@ case $RC in
;;
esac
echo "Testing no limits requested for rootdn=$MANAGERDN..."
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
-D "$MANAGERDN" \
'(objectClass=*)' >$SEARCHOUT 2>&1
RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success (got $COUNT entries)"
;;
*)
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
;;
esac
SIZELIMIT=4
echo "Testing limit requested for rootdn=$MANAGERDN..."
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-D "$MANAGERDN" \
'(objectClass=*)' >$SEARCHOUT 2>&1
RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
if test x"$COUNT" != x ; then
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "...didn't bump into the requested size limit ($SIZELIMIT; got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
echo "...bumped into requested size limit ($SIZELIMIT)"
;;
*)
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
;;
esac
SIZELIMIT=2
echo "Testing size limit request ($SIZELIMIT) for unlimited ID..."
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
@ -97,7 +146,18 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success (got $COUNT entries)"
if test x"$COUNT" != x ; then
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "...didn't bump into the requested size limit ($SIZELIMIT; got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
echo "...bumped into requested size limit ($SIZELIMIT)"
@ -118,10 +178,10 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success (got $COUNT entries)"
echo "...didn't bump into the requested time limit ($TIMELIMIT s; got $COUNT entries)"
;;
3)
echo "...bumped into requested time limit ($TIMELIMIT s; $COUNT entries)"
echo "...bumped into requested time limit ($TIMELIMIT s; got $COUNT entries)"
;;
*)
echo "ldapsearch failed ($RC)!"
@ -138,10 +198,10 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into server-side size limit (got $COUNT entries)"
echo "...didn't bump into server-side size limit (got $COUNT entries)"
;;
4)
echo "...bumped into server-side size limit ($COUNT)"
echo "...bumped into server-side size limit (got $COUNT entries)"
;;
*)
echo "ldapsearch failed ($RC)!"
@ -159,7 +219,18 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
if test "x$COUNT" != "x" ; then
@ -188,7 +259,18 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
if test "x$COUNT" != "x" ; then
@ -217,7 +299,18 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
echo "...bumped into requested ($SIZELIMIT) size limit"
@ -238,10 +331,23 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
echo "...bumped into requested ($SIZELIMIT) size limit"
echo "...error:bumped into requested ($SIZELIMIT) size limit"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
;;
11)
echo "...bumped into server-side hard size administrative limit"
@ -262,7 +368,13 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
echo "...bumped into requested ($SIZELIMIT=$COUNT) size limit"
@ -285,7 +397,13 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
if test x"$COUNT" != x ; then
echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
11)
echo "...bumped into unchecked administrative limit"
@ -305,7 +423,13 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
echo "...error: didn't bump into server-side unchecked limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
fi
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
;;
11)
echo "...bumped into unchecked administrative limit"
@ -325,7 +449,13 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
echo "...error: didn't bump into server-side unchecked limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
fi
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
;;
11)
echo "...bumped into unchecked administrative limit"
@ -345,17 +475,21 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
echo "...didn't bump into server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
if test "x$COUNT" != "x" ; then
if test "x$SIZELIMIT" = "x$COUNT" ; then
echo "...bumped into requested ($SIZELIMIT) size limit"
else
echo "...bumped into server-side size limit ($COUNT)"
fi
else
echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
echo "...error: bumped into server-side size limit, but got 0 entries!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
*)
@ -373,17 +507,21 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
echo "...didn't bump into server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
if test "x$COUNT" != "x" ; then
if test "x$SIZELIMIT" = "x$COUNT" ; then
echo "...bumped into requested ($SIZELIMIT) size limit"
else
echo "...bumped into server-side size limit ($COUNT)"
fi
else
echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
echo "...error: bumped into server-side size limit, but got 0 entries!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
*)
@ -401,17 +539,21 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
echo "...didn't bump into server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
if test "x$COUNT" != "x" ; then
if test "x$SIZELIMIT" = "x$COUNT" ; then
echo "...bumped into requested ($SIZELIMIT) size limit"
else
echo "...bumped into server-side size limit ($COUNT)"
fi
else
echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
echo "...error: bumped into server-side size limit, but got 0 entries!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
*)
@ -429,17 +571,21 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
echo "...didn't bump into server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
if test "x$COUNT" != "x" ; then
if test "x$SIZELIMIT" = "x$COUNT" ; then
echo "...bumped into requested ($SIZELIMIT) size limit"
else
echo "...bumped into server-side size limit ($COUNT)"
fi
else
echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
echo "...error: bumped into server-side size limit, but got 0 entries!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
*)
@ -457,17 +603,21 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
echo "...didn't bump into server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
if test "x$COUNT" != "x" ; then
if test "x$SIZELIMIT" = "x$COUNT" ; then
echo "...bumped into requested ($SIZELIMIT) size limit"
else
echo "...bumped into server-side size limit ($COUNT)"
fi
else
echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
echo "...error: bumped into server-side size limit, but got 0 entries!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
*)
@ -484,17 +634,21 @@ RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
if test x"$COUNT" != x ; then
echo "...didn't bump into server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
4)
if test "x$COUNT" != "x" ; then
if test "x$SIZELIMIT" = "x$COUNT" ; then
echo "...bumped into requested ($SIZELIMIT) size limit"
else
echo "...bumped into server-side size limit ($COUNT)"
fi
else
echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
echo "...error: bumped into server-side size limit, but got 0 entries!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
*)