3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 ## Copyright 1998-2004 The OpenLDAP Foundation.
6 ## All rights reserved.
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted only as authorized by the OpenLDAP
12 ## A copy of this license is available in the file LICENSE in the
13 ## top-level directory of the distribution or, alternatively, at
14 ## <http://www.OpenLDAP.org/license.html>.
16 ## FIXME: need to exclude legal but wrong results...
18 echo "running defines.sh"
19 . $SRCDIR/scripts/defines.sh
21 mkdir -p $TESTDIR $DBDIR1
23 echo "Running slapadd to build slapd database..."
24 . $CONFFILTER $BACKEND $MONITORDB < $LIMITSCONF > $ADDCONF
25 $SLAPADD -f $ADDCONF -l $LDIFLIMITS
27 if test $RC != 0 ; then
28 echo "slapadd failed ($RC)!"
32 echo "Running slapindex to index slapd database..."
33 . $CONFFILTER $BACKEND $MONITORDB < $LIMITSCONF > $CONF1
36 if test $RC != 0 ; then
37 echo "warning: slapindex failed ($RC)"
38 echo " assuming no indexing support"
41 echo "Starting slapd on TCP/IP port $PORT1..."
42 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
44 if test $WAIT != 0 ; then
50 echo "Testing slapd searching..."
51 for i in 0 1 2 3 4 5; do
52 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
53 '(objectclass=*)' > /dev/null 2>&1
55 if test $RC = 0 ; then
58 echo "Waiting 5 seconds for slapd to start..."
62 if test $RC != 0 ; then
63 echo "ldapsearch failed ($RC)!"
64 test $KILLSERVERS != no && kill -HUP $KILLPIDS
68 cat /dev/null > $SEARCHOUT
71 echo "Testing regular search limits"
74 echo "Testing no limits requested for unlimited ID..."
75 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
76 -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
77 '(objectClass=*)' >$SEARCHOUT 2>&1
79 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
82 echo "...success (got $COUNT entries)"
85 echo "ldapsearch failed ($RC)!"
86 test $KILLSERVERS != no && kill -HUP $KILLPIDS
92 echo "Testing size limit request ($SIZELIMIT) for unlimited ID..."
93 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
94 -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
95 '(objectClass=*)' > $SEARCHOUT 2>&1
97 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
100 echo "...success (got $COUNT entries)"
103 echo "...bumped into requested size limit ($SIZELIMIT)"
106 echo "ldapsearch failed ($RC)!"
107 test $KILLSERVERS != no && kill -HUP $KILLPIDS
113 echo "Testing time limit request ($TIMELIMIT s) for unlimited ID..."
114 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -l $TIMELIMIT \
115 -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
116 '(objectClass=*)' > $SEARCHOUT 2>&1
118 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
121 echo "...success (got $COUNT entries)"
124 echo "...bumped into requested time limit ($TIMELIMIT s; $COUNT entries)"
127 echo "ldapsearch failed ($RC)!"
128 test $KILLSERVERS != no && kill -HUP $KILLPIDS
133 echo "Testing no limits requested for soft limited ID..."
134 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
135 -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
136 '(objectClass=*)' > $SEARCHOUT 2>&1
138 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
141 echo "...success; didn't bump into server-side size limit (got $COUNT entries)"
144 echo "...bumped into server-side size limit ($COUNT)"
147 echo "ldapsearch failed ($RC)!"
148 test $KILLSERVERS != no && kill -HUP $KILLPIDS
154 echo "Testing lower than soft limit request ($SIZELIMIT) for soft limited ID..."
155 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
156 -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
157 '(objectClass=*)' > $SEARCHOUT 2>&1
159 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
162 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
165 if test "x$COUNT" != "x" ; then
166 if test "x$SIZELIMIT" = "x$COUNT" ; then
167 echo "...bumped into requested ($SIZELIMIT) size limit"
169 echo "...bumped into server-side size limit ($COUNT)"
172 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
176 echo "ldapsearch failed ($RC)!"
177 test $KILLSERVERS != no && kill -HUP $KILLPIDS
183 echo "Testing higher than soft limit request ($SIZELIMIT) for soft limited ID..."
184 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
185 -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
186 '(objectClass=*)' > $SEARCHOUT 2>&1
188 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
191 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
194 if test "x$COUNT" != "x" ; then
195 if test "x$SIZELIMIT" = "x$COUNT" ; then
196 echo "...bumped into requested ($SIZELIMIT) size limit"
198 echo "...bumped into server-side size limit ($COUNT)"
201 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
205 echo "ldapsearch failed ($RC)!"
206 test $KILLSERVERS != no && kill -HUP $KILLPIDS
212 echo "Testing lower than hard limit request ($SIZELIMIT) for hard limited ID..."
213 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
214 -D 'cn=Hard Limited User,ou=People,dc=example,dc=com' \
215 '(objectClass=*)' > $SEARCHOUT 2>&1
217 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
220 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
223 echo "...bumped into requested ($SIZELIMIT) size limit"
226 echo "ldapsearch failed ($RC)!"
227 test $KILLSERVERS != no && kill -HUP $KILLPIDS
233 echo "Testing higher than hard limit request ($SIZELIMIT) for hard limited ID..."
234 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
235 -D 'cn=Hard Limited User,ou=People,dc=example,dc=com' \
236 '(objectClass=*)' > $SEARCHOUT 2>&1
238 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
241 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
244 echo "...bumped into requested ($SIZELIMIT) size limit"
247 echo "...bumped into server-side hard size administrative limit"
250 echo "ldapsearch failed ($RC)!"
251 test $KILLSERVERS != no && kill -HUP $KILLPIDS
257 echo "Testing max limit request ($SIZELIMIT) for hard limited ID..."
258 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
259 -D 'cn=Hard Limited User,ou=People,dc=example,dc=com' \
260 '(objectClass=*)' > $SEARCHOUT 2>&1
262 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
265 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
268 echo "...bumped into requested ($SIZELIMIT=$COUNT) size limit"
271 echo "...bumped into server-side hard size administrative limit"
274 echo "ldapsearch failed ($RC)!"
275 test $KILLSERVERS != no && kill -HUP $KILLPIDS
280 echo "Testing lower than unchecked limit request for unchecked limited ID..."
281 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
282 -D 'cn=Unchecked Limited User,ou=People,dc=example,dc=com' \
283 '(uid=uncheckedlimited)' > $SEARCHOUT 2>&1
285 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
288 echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
291 echo "...bumped into unchecked administrative limit"
294 echo "ldapsearch failed ($RC)!"
295 test $KILLSERVERS != no && kill -HUP $KILLPIDS
300 echo "Testing higher than unchecked limit requested for unchecked limited ID..."
301 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
302 -D 'cn=Unchecked Limited User,ou=People,dc=example,dc=com' \
303 '(objectClass=*)' > $SEARCHOUT 2>&1
305 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
308 echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
311 echo "...bumped into unchecked administrative limit"
314 echo "ldapsearch failed ($RC)!"
315 test $KILLSERVERS != no && kill -HUP $KILLPIDS
320 echo "Testing no limits requested for unchecked limited group..."
321 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
322 -D 'cn=Unchecked Limited User 2,ou=People,dc=example,dc=com' \
323 '(objectClass=*)' > $SEARCHOUT 2>&1
325 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
328 echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
331 echo "...bumped into unchecked administrative limit"
334 echo "ldapsearch failed ($RC)!"
335 test $KILLSERVERS != no && kill -HUP $KILLPIDS
340 echo "Testing no limits requested for limited regex..."
341 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
342 -D 'cn=Foo User,ou=People,dc=example,dc=com' \
343 '(objectClass=*)' > $SEARCHOUT 2>&1
345 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
348 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
351 if test "x$COUNT" != "x" ; then
352 if test "x$SIZELIMIT" = "x$COUNT" ; then
353 echo "...bumped into requested ($SIZELIMIT) size limit"
355 echo "...bumped into server-side size limit ($COUNT)"
358 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
362 echo "ldapsearch failed ($RC)!"
363 test $KILLSERVERS != no && kill -HUP $KILLPIDS
368 echo "Testing no limits requested for limited onelevel..."
369 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
370 -D 'cn=Bar User,ou=People,dc=example,dc=com' \
371 '(objectClass=*)' > $SEARCHOUT 2>&1
373 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
376 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
379 if test "x$COUNT" != "x" ; then
380 if test "x$SIZELIMIT" = "x$COUNT" ; then
381 echo "...bumped into requested ($SIZELIMIT) size limit"
383 echo "...bumped into server-side size limit ($COUNT)"
386 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
390 echo "ldapsearch failed ($RC)!"
391 test $KILLSERVERS != no && kill -HUP $KILLPIDS
396 echo "Testing no limit requested for limited children..."
397 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
398 -D 'cn=Unchecked Limited Users,ou=Groups,dc=example,dc=com' \
399 '(objectClass=*)' > $SEARCHOUT 2>&1
401 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
404 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
407 if test "x$COUNT" != "x" ; then
408 if test "x$SIZELIMIT" = "x$COUNT" ; then
409 echo "...bumped into requested ($SIZELIMIT) size limit"
411 echo "...bumped into server-side size limit ($COUNT)"
414 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
418 echo "ldapsearch failed ($RC)!"
419 test $KILLSERVERS != no && kill -HUP $KILLPIDS
424 echo "Testing no limit requested for limited subtree..."
425 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
426 -D 'cn=Unchecked Limited User 3,ou=Admin,dc=example,dc=com' \
427 '(objectClass=*)' > $SEARCHOUT 2>&1
429 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
432 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
435 if test "x$COUNT" != "x" ; then
436 if test "x$SIZELIMIT" = "x$COUNT" ; then
437 echo "...bumped into requested ($SIZELIMIT) size limit"
439 echo "...bumped into server-side size limit ($COUNT)"
442 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
446 echo "ldapsearch failed ($RC)!"
447 test $KILLSERVERS != no && kill -HUP $KILLPIDS
452 echo "Testing no limit requested for limited users..."
453 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
454 -D 'cn=Special User,dc=example,dc=com' \
455 '(objectClass=*)' > $SEARCHOUT 2>&1
457 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
460 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
463 if test "x$COUNT" != "x" ; then
464 if test "x$SIZELIMIT" = "x$COUNT" ; then
465 echo "...bumped into requested ($SIZELIMIT) size limit"
467 echo "...bumped into server-side size limit ($COUNT)"
470 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
474 echo "ldapsearch failed ($RC)!"
475 test $KILLSERVERS != no && kill -HUP $KILLPIDS
480 echo "Testing no limit requested for limited anonymous..."
481 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
482 '(objectClass=*)' > $SEARCHOUT 2>&1
484 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
487 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
490 if test "x$COUNT" != "x" ; then
491 if test "x$SIZELIMIT" = "x$COUNT" ; then
492 echo "...bumped into requested ($SIZELIMIT) size limit"
494 echo "...bumped into server-side size limit ($COUNT)"
497 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
501 echo "ldapsearch failed ($RC)!"
502 test $KILLSERVERS != no && kill -HUP $KILLPIDS
509 # only bdb|hdb currently supports pagedResults control
512 test $KILLSERVERS != no && kill -HUP $KILLPIDS
514 echo ">>>>> Test succeeded"
520 echo "Testing regular search limits with pagedResults control"
524 echo "Testing no limits requested for unlimited ID..."
525 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
526 -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
527 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' >$SEARCHOUT 2>&1
529 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
532 echo "...success (got $COUNT entries)"
535 echo "ldapsearch failed ($RC)!"
536 test $KILLSERVERS != no && kill -HUP $KILLPIDS
542 echo "Testing size limit request ($SIZELIMIT) for unlimited ID..."
543 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
544 -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
545 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
547 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
550 echo "...success (got $COUNT entries)"
553 echo "...bumped into requested size limit ($SIZELIMIT)"
556 echo "ldapsearch failed ($RC)!"
557 test $KILLSERVERS != no && kill -HUP $KILLPIDS
563 echo "Testing time limit request ($TIMELIMIT s) for unlimited ID..."
564 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -l $TIMELIMIT \
565 -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
566 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
568 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
571 echo "...success (got $COUNT entries)"
574 echo "...bumped into requested time limit ($TIMELIMIT s; $COUNT entries)"
577 echo "ldapsearch failed ($RC)!"
578 test $KILLSERVERS != no && kill -HUP $KILLPIDS
583 echo "Testing no limits requested for soft limited ID..."
584 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
585 -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
586 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
588 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
591 echo "...success; didn't bump into server-side size limit (got $COUNT entries)"
594 echo "...bumped into server-side size limit ($COUNT)"
597 echo "ldapsearch failed ($RC)!"
598 test $KILLSERVERS != no && kill -HUP $KILLPIDS
604 echo "Testing lower than soft limit request ($SIZELIMIT) for soft limited ID..."
605 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
606 -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
607 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
609 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
612 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
615 if test "x$COUNT" != "x" ; then
616 if test "x$SIZELIMIT" = "x$COUNT" ; then
617 echo "...bumped into requested ($SIZELIMIT) size limit"
619 echo "...bumped into server-side size limit ($COUNT)"
622 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
626 echo "ldapsearch failed ($RC)!"
627 test $KILLSERVERS != no && kill -HUP $KILLPIDS
633 echo "Testing higher than soft limit request ($SIZELIMIT) for soft limited ID..."
634 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
635 -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
636 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
638 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
641 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
644 if test "x$COUNT" != "x" ; then
645 if test "x$SIZELIMIT" = "x$COUNT" ; then
646 echo "...bumped into requested ($SIZELIMIT) size limit"
648 echo "...bumped into server-side size limit ($COUNT)"
651 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
655 echo "ldapsearch failed ($RC)!"
656 test $KILLSERVERS != no && kill -HUP $KILLPIDS
662 echo "Testing lower than hard limit request ($SIZELIMIT) for hard limited ID..."
663 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
664 -D 'cn=Hard Limited User,ou=People,dc=example,dc=com' \
665 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
667 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
670 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
673 echo "...bumped into requested ($SIZELIMIT) size limit"
676 echo "ldapsearch failed ($RC)!"
677 test $KILLSERVERS != no && kill -HUP $KILLPIDS
683 echo "Testing higher than hard limit request ($SIZELIMIT) for hard limited ID..."
684 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
685 -D 'cn=Hard Limited User,ou=People,dc=example,dc=com' \
686 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
688 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
691 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
694 echo "...bumped into requested ($SIZELIMIT) size limit"
697 echo "...bumped into hard size administrative limit"
700 echo "ldapsearch failed ($RC)!"
701 test $KILLSERVERS != no && kill -HUP $KILLPIDS
707 echo "Testing max limit request ($SIZELIMIT) for hard limited ID..."
708 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
709 -D 'cn=Hard Limited User,ou=People,dc=example,dc=com' \
710 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
712 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
715 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
718 echo "...bumped into requested ($SIZELIMIT=$COUNT) size limit"
721 echo "...bumped into hard size administrative limit"
724 echo "ldapsearch failed ($RC)!"
725 test $KILLSERVERS != no && kill -HUP $KILLPIDS
730 echo "Testing lower than unchecked limit request for unchecked limited ID..."
731 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
732 -D 'cn=Unchecked Limited User,ou=People,dc=example,dc=com' \
733 -E '!pr='$PAGESIZE'/noprompt' '(uid=uncheckedlimited)' > $SEARCHOUT 2>&1
735 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
738 echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
741 echo "...bumped into unchecked administrative limit"
744 echo "ldapsearch failed ($RC)!"
745 test $KILLSERVERS != no && kill -HUP $KILLPIDS
750 echo "Testing higher than unchecked limit requested for unchecked limited ID..."
751 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
752 -D 'cn=Unchecked Limited User,ou=People,dc=example,dc=com' \
753 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
755 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
758 echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
761 echo "...bumped into unchecked administrative limit"
764 echo "ldapsearch failed ($RC)!"
765 test $KILLSERVERS != no && kill -HUP $KILLPIDS
771 echo "Testing specific search limits with pagedResults control"
774 echo "Testing no limit requested for unlimited page size ID..."
775 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
776 -D 'cn=Unlimited User,ou=Paged Results Users,dc=example,dc=com' \
777 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
779 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
782 echo "...success; didn't bump into server-side size limit (got $COUNT entries)"
785 echo "...bumped into server-side size limit ($COUNT)"
788 echo "ldapsearch failed ($RC)!"
789 test $KILLSERVERS != no && kill -HUP $KILLPIDS
794 echo "Testing no limit requested for limited page size ID..."
795 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
796 -D 'cn=Page Size Limited User,ou=Paged Results Users,dc=example,dc=com' \
797 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
799 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
802 echo "...success; didn't bump into server-side page size limit (got $COUNT entries)"
805 echo "...bumped into page size limit ($COUNT)"
808 echo "...bumped into page size administrative limit"
811 echo "ldapsearch failed ($RC)!"
812 test $KILLSERVERS != no && kill -HUP $KILLPIDS
817 echo "Testing no limit requested for pagedResults disabled ID..."
818 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
819 -D 'cn=Paged Results Disabled User,ou=Paged Results Users,dc=example,dc=com' \
820 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
822 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
825 echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
828 echo "...bumped into server-side size limit ($COUNT)"
831 echo "...bumped into pagedResults disabled administrative limit"
834 echo "ldapsearch failed ($RC)!"
835 test $KILLSERVERS != no && kill -HUP $KILLPIDS
840 echo "Testing no limit requested for pagedResults total count limited ID..."
841 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
842 -D 'cn=Paged Results Limited User,ou=Paged Results Users,dc=example,dc=com' \
843 -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
845 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
848 echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
851 echo "...bumped into server-side size limit ($COUNT)"
854 echo "...bumped into pagedResults total count administrative limit"
857 echo "ldapsearch failed ($RC)!"
858 test $KILLSERVERS != no && kill -HUP $KILLPIDS
864 echo "Testing higher than hard but lower then total count limit requested for pagedResults total count limited ID..."
865 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
866 -D 'cn=Paged Results Limited User,ou=Paged Results Users,dc=example,dc=com' \
867 -z $SIZELIMIT -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
869 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
872 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side unchecked limit (got $COUNT entries)"
875 if test "x$COUNT" != "x" ; then
876 if test "x$SIZELIMIT" = "x$COUNT" ; then
877 echo "...bumped into requested ($SIZELIMIT) size limit"
879 echo "...bumped into server-side size limit ($COUNT)"
882 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
886 echo "...bumped into either hard size or pagedResults total count administrative limit"
889 echo "ldapsearch failed ($RC)!"
890 test $KILLSERVERS != no && kill -HUP $KILLPIDS
896 echo "Testing higher than total count limit requested for pagedResults total count limited ID..."
897 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
898 -D 'cn=Paged Results Limited User,ou=Paged Results Users,dc=example,dc=com' \
899 -z $SIZELIMIT -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
901 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
904 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side unchecked limit (got $COUNT entries)"
907 if test "x$COUNT" != "x" ; then
908 if test "x$SIZELIMIT" = "x$COUNT" ; then
909 echo "...bumped into requested ($SIZELIMIT) size limit"
911 echo "...bumped into server-side size limit ($COUNT)"
914 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
918 echo "...bumped into pagedResults total count administrative limit"
921 echo "ldapsearch failed ($RC)!"
922 test $KILLSERVERS != no && kill -HUP $KILLPIDS
928 echo "Testing max limit requested for pagedResults total count limited ID..."
929 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
930 -D 'cn=Paged Results Limited User,ou=Paged Results Users,dc=example,dc=com' \
931 -z $SIZELIMIT -E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
933 COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
936 echo "...success; didn't bump into either requested ($SIZELIMIT) or server-side unchecked limit (got $COUNT entries)"
939 if test "x$COUNT" != "x" ; then
940 if test "x$SIZELIMIT" = "x$COUNT" ; then
941 echo "...bumped into requested ($SIZELIMIT) size limit"
943 echo "...bumped into server-side size limit ($COUNT)"
946 echo "...bumped into either requested ($SIZELIMIT) or server-side size limit"
950 echo "...bumped into pagedResults total count administrative limit"
953 echo "ldapsearch failed ($RC)!"
954 test $KILLSERVERS != no && kill -HUP $KILLPIDS
959 test $KILLSERVERS != no && kill -HUP $KILLPIDS
961 echo ">>>>> Test succeeded"