Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Barchiesi
OpenLDAP
Commits
f7aa0221
Commit
f7aa0221
authored
20 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
more pagedResults tests
parent
a7d591b0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/data/slapd-limits.conf
+5
-0
5 additions, 0 deletions
tests/data/slapd-limits.conf
tests/data/test-limits.ldif
+32
-0
32 additions, 0 deletions
tests/data/test-limits.ldif
tests/scripts/test025-limits
+170
-18
170 additions, 18 deletions
tests/scripts/test025-limits
with
207 additions
and
18 deletions
tests/data/slapd-limits.conf
+
5
−
0
View file @
f7aa0221
...
@@ -40,6 +40,11 @@ rootpw secret
...
@@ -40,6 +40,11 @@ rootpw secret
#bdb#index objectClass eq
#bdb#index objectClass eq
#bdb#index uid 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=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=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
limits
dn
.
exact
=
"cn=Hard Limited User,ou=People,o=University of Michigan,c=US"
size
.
soft
=
4
size
.
hard
=
8
...
...
This diff is collapsed.
Click to expand it.
tests/data/test-limits.ldif
+
32
−
0
View file @
f7aa0221
...
@@ -105,3 +105,35 @@ sn: User
...
@@ -105,3 +105,35 @@ sn: User
uid: special
uid: special
userpassword:: c2VjcmV0
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
This diff is collapsed.
Click to expand it.
tests/scripts/test025-limits
+
170
−
18
View file @
f7aa0221
...
@@ -242,7 +242,7 @@ case $RC in
...
@@ -242,7 +242,7 @@ case $RC in
echo
"...bumped into requested (
$SIZELIMIT
) size limit"
echo
"...bumped into requested (
$SIZELIMIT
) size limit"
;;
;;
11
)
11
)
echo
"...bumped into server-side
siz
e limit"
echo
"...bumped into server-side
hard size administrativ
e limit"
;;
;;
*
)
*
)
echo
"ldapsearch failed (
$RC
)!"
echo
"ldapsearch failed (
$RC
)!"
...
@@ -262,7 +262,7 @@ case $RC in
...
@@ -262,7 +262,7 @@ case $RC in
echo
"...success; didn't bump into server-side unchecked limit (got
$COUNT
entries)"
echo
"...success; didn't bump into server-side unchecked limit (got
$COUNT
entries)"
;;
;;
11
)
11
)
echo
"...bumped into
server-side unchecked
limit"
echo
"...bumped into
unchecked administrative
limit"
;;
;;
*
)
*
)
echo
"ldapsearch failed (
$RC
)!"
echo
"ldapsearch failed (
$RC
)!"
...
@@ -282,7 +282,7 @@ case $RC in
...
@@ -282,7 +282,7 @@ case $RC in
echo
"...success; didn't bump into server-side unchecked limit (got
$COUNT
entries)"
echo
"...success; didn't bump into server-side unchecked limit (got
$COUNT
entries)"
;;
;;
11
)
11
)
echo
"...bumped into
server-side unchecked
limit"
echo
"...bumped into
unchecked administrative
limit"
;;
;;
*
)
*
)
echo
"ldapsearch failed (
$RC
)!"
echo
"ldapsearch failed (
$RC
)!"
...
@@ -291,7 +291,7 @@ case $RC in
...
@@ -291,7 +291,7 @@ case $RC in
;;
;;
esac
esac
echo
"Testing
higher than unchecked
limit requested for unchecked limited group..."
echo
"Testing
no
limit
s
requested for unchecked limited group..."
$LDAPRSEARCH
-S
""
-b
"
$BASEDN
"
-h
$LOCALHOST
-p
$PORT1
-w
secret
\
$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,o=University of Michigan,c=US'
\
'(objectClass=*)'
>
$SEARCHOUT
2>&1
'(objectClass=*)'
>
$SEARCHOUT
2>&1
...
@@ -302,7 +302,7 @@ case $RC in
...
@@ -302,7 +302,7 @@ case $RC in
echo
"...success; didn't bump into server-side unchecked limit (got
$COUNT
entries)"
echo
"...success; didn't bump into server-side unchecked limit (got
$COUNT
entries)"
;;
;;
11
)
11
)
echo
"...bumped into
server-side unchecked
limit"
echo
"...bumped into
unchecked administrative
limit"
;;
;;
*
)
*
)
echo
"ldapsearch failed (
$RC
)!"
echo
"ldapsearch failed (
$RC
)!"
...
@@ -311,7 +311,7 @@ case $RC in
...
@@ -311,7 +311,7 @@ case $RC in
;;
;;
esac
esac
echo
"Testing
higher than unchecked
limit requested for
unchecked
limited regex..."
echo
"Testing
no
limit
s
requested for limited regex..."
$LDAPRSEARCH
-S
""
-b
"
$BASEDN
"
-h
$LOCALHOST
-p
$PORT1
-w
secret
\
$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,o=University of Michigan,c=US'
\
'(objectClass=*)'
>
$SEARCHOUT
2>&1
'(objectClass=*)'
>
$SEARCHOUT
2>&1
...
@@ -339,7 +339,7 @@ case $RC in
...
@@ -339,7 +339,7 @@ case $RC in
;;
;;
esac
esac
echo
"Testing
higher than unchecked
limit requested for
unchecked
limited onelevel..."
echo
"Testing
no
limit
s
requested for limited onelevel..."
$LDAPRSEARCH
-S
""
-b
"
$BASEDN
"
-h
$LOCALHOST
-p
$PORT1
-w
secret
\
$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,o=University of Michigan,c=US'
\
'(objectClass=*)'
>
$SEARCHOUT
2>&1
'(objectClass=*)'
>
$SEARCHOUT
2>&1
...
@@ -367,7 +367,7 @@ case $RC in
...
@@ -367,7 +367,7 @@ case $RC in
;;
;;
esac
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
\
$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,o=University of Michigan,c=US'
\
'(objectClass=*)'
>
$SEARCHOUT
2>&1
'(objectClass=*)'
>
$SEARCHOUT
2>&1
...
@@ -395,7 +395,7 @@ case $RC in
...
@@ -395,7 +395,7 @@ case $RC in
;;
;;
esac
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
\
$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,o=University of Michigan,c=US'
\
'(objectClass=*)'
>
$SEARCHOUT
2>&1
'(objectClass=*)'
>
$SEARCHOUT
2>&1
...
@@ -423,7 +423,7 @@ case $RC in
...
@@ -423,7 +423,7 @@ case $RC in
;;
;;
esac
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
\
$LDAPRSEARCH
-S
""
-b
"
$BASEDN
"
-h
$LOCALHOST
-p
$PORT1
-w
secret
\
-D
'cn=Special User,o=University of Michigan,c=US'
\
-D
'cn=Special User,o=University of Michigan,c=US'
\
'(objectClass=*)'
>
$SEARCHOUT
2>&1
'(objectClass=*)'
>
$SEARCHOUT
2>&1
...
@@ -451,7 +451,7 @@ case $RC in
...
@@ -451,7 +451,7 @@ case $RC in
;;
;;
esac
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
\
$LDAPRSEARCH
-S
""
-b
"
$BASEDN
"
-h
$LOCALHOST
-p
$PORT1
\
'(objectClass=*)'
>
$SEARCHOUT
2>&1
'(objectClass=*)'
>
$SEARCHOUT
2>&1
RC
=
$?
RC
=
$?
...
@@ -668,7 +668,7 @@ case $RC in
...
@@ -668,7 +668,7 @@ case $RC in
echo
"...bumped into requested (
$SIZELIMIT
) size limit"
echo
"...bumped into requested (
$SIZELIMIT
) size limit"
;;
;;
11
)
11
)
echo
"...bumped into
server-
si
d
e
siz
e limit"
echo
"...bumped into
hard
si
z
e
administrativ
e limit"
;;
;;
*
)
*
)
echo
"ldapsearch failed (
$RC
)!"
echo
"ldapsearch failed (
$RC
)!"
...
@@ -688,7 +688,7 @@ case $RC in
...
@@ -688,7 +688,7 @@ case $RC in
echo
"...success; didn't bump into server-side unchecked limit (got
$COUNT
entries)"
echo
"...success; didn't bump into server-side unchecked limit (got
$COUNT
entries)"
;;
;;
11
)
11
)
echo
"...bumped into
server-side unchecked
limit"
echo
"...bumped into
unchecked administrative
limit"
;;
;;
*
)
*
)
echo
"ldapsearch failed (
$RC
)!"
echo
"ldapsearch failed (
$RC
)!"
...
@@ -708,7 +708,7 @@ case $RC in
...
@@ -708,7 +708,7 @@ case $RC in
echo
"...success; didn't bump into server-side unchecked limit (got
$COUNT
entries)"
echo
"...success; didn't bump into server-side unchecked limit (got
$COUNT
entries)"
;;
;;
11
)
11
)
echo
"...bumped into
server-side unchecked
limit"
echo
"...bumped into
unchecked administrative
limit"
;;
;;
*
)
*
)
echo
"ldapsearch failed (
$RC
)!"
echo
"ldapsearch failed (
$RC
)!"
...
@@ -717,10 +717,162 @@ case $RC in
...
@@ -717,10 +717,162 @@ case $RC in
;;
;;
esac
esac
# TODO
echo
""
#echo ""
echo
"Testing specific search limits with pagedResults control"
#echo "Testing specific search limits with pagedResults control"
echo
""
#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
test
$KILLSERVERS
!=
no
&&
kill
-HUP
$KILLPIDS
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment