mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
more pagedResults tests
This commit is contained in:
parent
a7d591b0b6
commit
f7aa0221db
@ -40,6 +40,11 @@ rootpw secret
|
||||
#bdb#index objectClass eq
|
||||
#bdb#index uid eq
|
||||
|
||||
#bdb#limits dn.exact="cn=Unlimited User,ou=Paged Results Users,o=University of Michigan,c=US" size=4 size.pr=none
|
||||
#bdb#limits dn.exact="cn=Page Size Limited User,ou=Paged Results Users,o=University of Michigan,c=US" size=4 size.pr=4
|
||||
#bdb#limits dn.exact="cn=Paged Results Disabled User,ou=Paged Results Users,o=University of Michigan,c=US" size=4 size.prtotal=disabled
|
||||
#bdb#limits dn.exact="cn=Paged Results Limited User,ou=Paged Results Users,o=University of Michigan,c=US" size=4 size.prtotal=10
|
||||
|
||||
limits dn.exact="cn=Unlimited User,ou=People,o=University of Michigan,c=US" size=none time=none
|
||||
limits dn.exact="cn=Soft Limited User,ou=People,o=University of Michigan,c=US" size.soft=4 size.hard=none
|
||||
limits dn.exact="cn=Hard Limited User,ou=People,o=University of Michigan,c=US" size.soft=4 size.hard=8
|
||||
|
@ -105,3 +105,35 @@ sn: User
|
||||
uid: special
|
||||
userpassword:: c2VjcmV0
|
||||
|
||||
dn: ou=Paged Results Users,o=University of Michigan,c=US
|
||||
objectclass: organizationalUnit
|
||||
ou: Paged Results Users
|
||||
|
||||
dn: cn=Unlimited User,ou=Paged Results Users,o=University of Michigan,c=US
|
||||
objectclass: OpenLDAPperson
|
||||
cn: Unlimited User
|
||||
sn: User
|
||||
uid: unlimited
|
||||
userpassword:: c2VjcmV0
|
||||
|
||||
dn: cn=Page Size Limited User,ou=Paged Results Users,o=University of Michigan,c=US
|
||||
objectclass: OpenLDAPperson
|
||||
cn: Page Size Limited User
|
||||
sn: User
|
||||
uid: pagesizelimited
|
||||
userpassword:: c2VjcmV0
|
||||
|
||||
dn: cn=Paged Results Disabled User,ou=Paged Results Users,o=University of Michigan,c=US
|
||||
objectclass: OpenLDAPperson
|
||||
cn: Paged Results Disabled User
|
||||
sn: User
|
||||
uid: pagedresultsdisabled
|
||||
userpassword:: c2VjcmV0
|
||||
|
||||
dn: cn=Paged Results Limited User,ou=Paged Results Users,o=University of Michigan,c=US
|
||||
objectclass: OpenLDAPperson
|
||||
cn: Paged Results Limited User
|
||||
sn: User
|
||||
uid: pagedresultslimited
|
||||
userpassword:: c2VjcmV0
|
||||
|
||||
|
@ -242,7 +242,7 @@ case $RC in
|
||||
echo "...bumped into requested ($SIZELIMIT) size limit"
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into server-side size limit"
|
||||
echo "...bumped into server-side hard size administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -262,7 +262,7 @@ case $RC in
|
||||
echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into server-side unchecked limit"
|
||||
echo "...bumped into unchecked administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -282,7 +282,7 @@ case $RC in
|
||||
echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into server-side unchecked limit"
|
||||
echo "...bumped into unchecked administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -291,7 +291,7 @@ case $RC in
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Testing higher than unchecked limit requested for unchecked limited group..."
|
||||
echo "Testing no limits requested for unchecked limited group..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Unchecked Limited User 2,ou=People,o=University of Michigan,c=US' \
|
||||
'(objectClass=*)' > $SEARCHOUT 2>&1
|
||||
@ -302,7 +302,7 @@ case $RC in
|
||||
echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into server-side unchecked limit"
|
||||
echo "...bumped into unchecked administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -311,7 +311,7 @@ case $RC in
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Testing higher than unchecked limit requested for unchecked limited regex..."
|
||||
echo "Testing no limits requested for limited regex..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Foo User,ou=People,o=University of Michigan,c=US' \
|
||||
'(objectClass=*)' > $SEARCHOUT 2>&1
|
||||
@ -339,7 +339,7 @@ case $RC in
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Testing higher than unchecked limit requested for unchecked limited onelevel..."
|
||||
echo "Testing no limits requested for limited onelevel..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Bar User,ou=People,o=University of Michigan,c=US' \
|
||||
'(objectClass=*)' > $SEARCHOUT 2>&1
|
||||
@ -367,7 +367,7 @@ case $RC in
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Testing higher than unchecked limit requested for unchecked limited children..."
|
||||
echo "Testing no limit requested for limited children..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Unchecked Limited Users,ou=Groups,o=University of Michigan,c=US' \
|
||||
'(objectClass=*)' > $SEARCHOUT 2>&1
|
||||
@ -395,7 +395,7 @@ case $RC in
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Testing higher than unchecked limit requested for unchecked limited subtree..."
|
||||
echo "Testing no limit requested for limited subtree..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Unchecked Limited User 3,ou=Admin,o=University of Michigan,c=US' \
|
||||
'(objectClass=*)' > $SEARCHOUT 2>&1
|
||||
@ -423,7 +423,7 @@ case $RC in
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Testing higher than unchecked limit requested for unchecked limited users..."
|
||||
echo "Testing no limit requested for limited users..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Special User,o=University of Michigan,c=US' \
|
||||
'(objectClass=*)' > $SEARCHOUT 2>&1
|
||||
@ -451,7 +451,7 @@ case $RC in
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Testing higher than unchecked limit requested for unchecked limited anonymous..."
|
||||
echo "Testing no limit requested for limited anonymous..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
||||
'(objectClass=*)' > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
@ -668,7 +668,7 @@ case $RC in
|
||||
echo "...bumped into requested ($SIZELIMIT) size limit"
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into server-side size limit"
|
||||
echo "...bumped into hard size administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -688,7 +688,7 @@ case $RC in
|
||||
echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into server-side unchecked limit"
|
||||
echo "...bumped into unchecked administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -708,7 +708,7 @@ case $RC in
|
||||
echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into server-side unchecked limit"
|
||||
echo "...bumped into unchecked administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -717,10 +717,162 @@ case $RC in
|
||||
;;
|
||||
esac
|
||||
|
||||
# TODO
|
||||
#echo ""
|
||||
#echo "Testing specific search limits with pagedResults control"
|
||||
#echo ""
|
||||
echo ""
|
||||
echo "Testing specific search limits with pagedResults control"
|
||||
echo ""
|
||||
|
||||
echo "Testing no limit requested for unlimited page size ID..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Unlimited User,ou=Paged Results Users,o=University of Michigan,c=US' \
|
||||
-E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
|
||||
case $RC in
|
||||
0)
|
||||
echo "...success; didn't bump into server-side size limit (got $COUNT entries)"
|
||||
;;
|
||||
4)
|
||||
echo "...bumped into server-side size limit ($COUNT)"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Testing no limit requested for limited page size ID..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Page Size Limited User,ou=Paged Results Users,o=University of Michigan,c=US' \
|
||||
-E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
|
||||
case $RC in
|
||||
0)
|
||||
echo "...success; didn't bump into server-side page size limit (got $COUNT entries)"
|
||||
;;
|
||||
4)
|
||||
echo "...bumped into page size limit ($COUNT)"
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into page size administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Testing no limit requested for pagedResults disabled ID..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Paged Results Disabled User,ou=Paged Results Users,o=University of Michigan,c=US' \
|
||||
-E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
|
||||
case $RC in
|
||||
0)
|
||||
echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
|
||||
;;
|
||||
4)
|
||||
echo "...bumped into server-side size limit ($COUNT)"
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into pagedResults disabled administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Testing no limit requested for pagedResults total count limited ID..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Paged Results Limited User,ou=Paged Results Users,o=University of Michigan,c=US' \
|
||||
-E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
|
||||
case $RC in
|
||||
0)
|
||||
echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
|
||||
;;
|
||||
4)
|
||||
echo "...bumped into server-side size limit ($COUNT)"
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into pagedResults total count administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
;;
|
||||
esac
|
||||
|
||||
SIZELIMIT=8
|
||||
echo "Testing higher than hard but lower then total count limit requested for pagedResults total count limited ID..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Paged Results Limited User,ou=Paged Results Users,o=University of Michigan,c=US' \
|
||||
-z $SIZELIMIT -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
|
||||
case $RC in
|
||||
0)
|
||||
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side unchecked limit (got $COUNT entries)"
|
||||
;;
|
||||
4)
|
||||
if test "x$COUNT" != "x" ; then
|
||||
if test $SIZELIMIT = $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"
|
||||
fi
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into either hard size or pagedResults total count administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
;;
|
||||
esac
|
||||
|
||||
SIZELIMIT=15
|
||||
echo "Testing higher than total count limit requested for pagedResults total count limited ID..."
|
||||
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
|
||||
-D 'cn=Paged Results Limited User,ou=Paged Results Users,o=University of Michigan,c=US' \
|
||||
-z $SIZELIMIT -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
|
||||
case $RC in
|
||||
0)
|
||||
echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side unchecked limit (got $COUNT entries)"
|
||||
;;
|
||||
4)
|
||||
if test "x$COUNT" != "x" ; then
|
||||
if test $SIZELIMIT = $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"
|
||||
fi
|
||||
;;
|
||||
11)
|
||||
echo "...bumped into pagedResults total count administrative limit"
|
||||
;;
|
||||
*)
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
;;
|
||||
esac
|
||||
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user