]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test025-limits
more whoami tests
[openldap] / tests / scripts / test025-limits
index 607cab5bd14b347f3c7d5765e3596ced71e9b55e..1f22388fabe6f8bbdaedfa913b218e834e102d40 100755 (executable)
@@ -71,10 +71,10 @@ echo ""
 
 echo "Testing no limits requested for unlimited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
-       -D 'cn=Unlimited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
        '(objectClass=*)' >$SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success (got $COUNT entries)"
@@ -89,10 +89,10 @@ esac
 SIZELIMIT=2
 echo "Testing size limit request ($SIZELIMIT) for unlimited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-       -D 'cn=Unlimited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success (got $COUNT entries)"
@@ -110,10 +110,10 @@ esac
 TIMELIMIT=10
 echo "Testing time limit request ($TIMELIMIT s) for unlimited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -l $TIMELIMIT \
-       -D 'cn=Unlimited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success (got $COUNT entries)"
@@ -130,10 +130,10 @@ esac
 
 echo "Testing no limits requested for soft limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
-       -D 'cn=Soft Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success; didn't bump into server-side size limit (got $COUNT entries)"
@@ -151,17 +151,17 @@ esac
 SIZELIMIT=2
 echo "Testing lower than soft limit request ($SIZELIMIT) for soft limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-       -D 'cn=Soft Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
        ;;
        4)
                if test "x$COUNT" != "x" ; then
-                       if test $SIZELIMIT = $COUNT ; then
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"
@@ -180,17 +180,17 @@ esac
 SIZELIMIT=100
 echo "Testing higher than soft limit request ($SIZELIMIT) for soft limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-       -D 'cn=Soft Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
        ;;
        4)
                if test "x$COUNT" != "x" ; then
-                       if test $SIZELIMIT = $COUNT ; then
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"
@@ -209,10 +209,10 @@ esac
 SIZELIMIT=2
 echo "Testing lower than hard limit request ($SIZELIMIT) for hard limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-       -D 'cn=Hard Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Hard Limited User,ou=People,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
@@ -230,10 +230,10 @@ esac
 SIZELIMIT=100
 echo "Testing higher than hard limit request ($SIZELIMIT) for hard limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-       -D 'cn=Hard Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Hard Limited User,ou=People,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
@@ -253,10 +253,10 @@ esac
 
 echo "Testing lower than unchecked limit request for unchecked limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
-       -D 'cn=Unchecked Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Unchecked Limited User,ou=People,dc=example,dc=com' \
        '(uid=uncheckedlimited)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
@@ -273,10 +273,10 @@ esac
 
 echo "Testing higher than unchecked limit requested for unchecked limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
-       -D 'cn=Unchecked Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Unchecked Limited User,ou=People,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
@@ -293,10 +293,10 @@ esac
 
 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' \
+       -D 'cn=Unchecked Limited User 2,ou=People,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
@@ -313,17 +313,17 @@ esac
 
 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' \
+       -D 'cn=Foo User,ou=People,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
        ;;
        4)
                if test "x$COUNT" != "x" ; then
-                       if test $SIZELIMIT = $COUNT ; then
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"
@@ -341,17 +341,17 @@ esac
 
 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' \
+       -D 'cn=Bar User,ou=People,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
        ;;
        4)
                if test "x$COUNT" != "x" ; then
-                       if test $SIZELIMIT = $COUNT ; then
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"
@@ -369,17 +369,17 @@ esac
 
 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' \
+       -D 'cn=Unchecked Limited Users,ou=Groups,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
        ;;
        4)
                if test "x$COUNT" != "x" ; then
-                       if test $SIZELIMIT = $COUNT ; then
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"
@@ -397,17 +397,17 @@ esac
 
 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' \
+       -D 'cn=Unchecked Limited User 3,ou=Admin,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
        ;;
        4)
                if test "x$COUNT" != "x" ; then
-                       if test $SIZELIMIT = $COUNT ; then
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"
@@ -425,17 +425,17 @@ esac
 
 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' \
+       -D 'cn=Special User,dc=example,dc=com' \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
        ;;
        4)
                if test "x$COUNT" != "x" ; then
-                       if test $SIZELIMIT = $COUNT ; then
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"
@@ -455,14 +455,14 @@ echo "Testing no limit requested for limited anonymous..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
        '(objectClass=*)' > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
        ;;
        4)
                if test "x$COUNT" != "x" ; then
-                       if test $SIZELIMIT = $COUNT ; then
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"
@@ -497,10 +497,10 @@ echo ""
 PAGESIZE=5
 echo "Testing no limits requested for unlimited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
-       -D 'cn=Unlimited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null >$SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success (got $COUNT entries)"
@@ -515,10 +515,10 @@ esac
 SIZELIMIT=2
 echo "Testing size limit request ($SIZELIMIT) for unlimited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-       -D 'cn=Unlimited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success (got $COUNT entries)"
@@ -536,10 +536,10 @@ esac
 TIMELIMIT=10
 echo "Testing time limit request ($TIMELIMIT s) for unlimited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -l $TIMELIMIT \
-       -D 'cn=Unlimited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success (got $COUNT entries)"
@@ -556,10 +556,10 @@ esac
 
 echo "Testing no limits requested for soft limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
-       -D 'cn=Soft Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success; didn't bump into server-side size limit (got $COUNT entries)"
@@ -577,17 +577,17 @@ esac
 SIZELIMIT=2
 echo "Testing lower than soft limit request ($SIZELIMIT) for soft limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-       -D 'cn=Soft Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
        ;;
        4)
                if test "x$COUNT" != "x" ; then
-                       if test $SIZELIMIT = $COUNT ; then
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"
@@ -606,17 +606,17 @@ esac
 SIZELIMIT=100
 echo "Testing higher than soft limit request ($SIZELIMIT) for soft limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-       -D 'cn=Soft Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Soft Limited User,ou=People,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
        ;;
        4)
                if test "x$COUNT" != "x" ; then
-                       if test $SIZELIMIT = $COUNT ; then
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"
@@ -635,10 +635,10 @@ esac
 SIZELIMIT=2
 echo "Testing lower than hard limit request ($SIZELIMIT) for hard limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-       -D 'cn=Hard Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Hard Limited User,ou=People,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
@@ -656,10 +656,10 @@ esac
 SIZELIMIT=100
 echo "Testing higher than hard limit request ($SIZELIMIT) for hard limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-       -D 'cn=Hard Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Hard Limited User,ou=People,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+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)"
@@ -679,10 +679,10 @@ esac
 
 echo "Testing lower than unchecked limit request for unchecked limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
-       -D 'cn=Unchecked Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Unchecked Limited User,ou=People,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(uid=uncheckedlimited)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
@@ -699,10 +699,10 @@ esac
 
 echo "Testing higher than unchecked limit requested for unchecked limited ID..."
 $LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
-       -D 'cn=Unchecked Limited User,ou=People,o=University of Michigan,c=US' \
+       -D 'cn=Unchecked Limited User,ou=People,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
@@ -723,10 +723,10 @@ 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' \
+       -D 'cn=Unlimited User,ou=Paged Results Users,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success; didn't bump into server-side size limit (got $COUNT entries)"
@@ -743,10 +743,10 @@ 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' \
+       -D 'cn=Page Size Limited User,ou=Paged Results Users,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success; didn't bump into server-side page size limit (got $COUNT entries)"
@@ -766,10 +766,10 @@ 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' \
+       -D 'cn=Paged Results Disabled User,ou=Paged Results Users,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
@@ -789,10 +789,10 @@ 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' \
+       -D 'cn=Paged Results Limited User,ou=Paged Results Users,dc=example,dc=com' \
        -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 case $RC in
        0)
                echo "...success; didn't bump into server-side unchecked limit (got $COUNT entries)"
@@ -813,17 +813,17 @@ 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' \
+       -D 'cn=Paged Results Limited User,ou=Paged Results Users,dc=example,dc=com' \
        -z $SIZELIMIT -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 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
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"
@@ -845,17 +845,17 @@ 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' \
+       -D 'cn=Paged Results Limited User,ou=Paged Results Users,dc=example,dc=com' \
        -z $SIZELIMIT -E '!pr='$PAGESIZE '(objectClass=*)' </dev/null > $SEARCHOUT 2>&1
 RC=$?
-COUNT=`cat $SEARCHOUT | grep '^# numEntries:' | sed 's;[^0-9]\+\([0-9]\+\)$;\1;'`
+COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
 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
+                       if test "x$SIZELIMIT" = "x$COUNT" ; then
                                echo "...bumped into requested ($SIZELIMIT) size limit"
                        else
                                echo "...bumped into server-side size limit ($COUNT)"