Skip to content
Snippets Groups Projects
Commit 1d420df7 authored by Jan Synacek's avatar Jan Synacek Committed by Quanah Gibson-Mount
Browse files

ITS#7423 Update slapo-constraint tests

parent b9f7fb07
No related branches found
No related tags found
No related merge requests found
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
delete: mail
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
add: mail
mail: a@example.com
......
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
delete: mail
-
......
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
delete: mail
-
......
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
......
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
replace: mail
mail: a@example.com
......
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
......
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
......
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
......
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
......
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
delete: description
description: desc1
......
dn: cn=John Doe,ou=users,dc=example,dc=com
changetype: modify
replace: uid
uid: 2
dn: cn=John Doe,dc=example,dc=com
dn: cn=John Doe,ou=users,dc=example,dc=com
objectclass: inetOrgPerson
objectclass: organizationalPerson
cn: John Doe
......@@ -7,3 +7,4 @@ sn: Doe
mail: original@example.com
description: desc1
description: desc2
uid: 1
......@@ -13,7 +13,7 @@ ROOTLDIF="$CONSTRAINTDIR/root.ldif"
USERLDIF="$CONSTRAINTDIR/user.ldif"
RESULTOUT="$CONSTRAINTDIR/constraint.out"
SCRIPTOUT="$TESTDIR/constraint.out"
USERDN="cn=John Doe,$BASEDN"
USERDN="cn=John Doe,ou=users,$BASEDN"
CONFDIR=$TESTDIR/slapd.d
mkdir -p $TESTDIR $CONFDIR $DBDIR1
......@@ -88,13 +88,21 @@ dn: olcOverlay=constraint,olcDatabase={1}$BACKEND,cn=config
objectClass: olcOverlayConfig
objectClass: olcConstraintConfig
olcOverlay: constraint
olcConstraintAttribute: mail count 3
olcConstraintAttribute: mail
count 3
restrict="ldap:///ou=users,$BASEDN??one?(objectClass=inetOrgPerson)"
# check if restrict works (if not, this will apply to ou=users subtree as well
# and some tests will fail)
olcConstraintAttribute: mail count 1 restrict="ldap:///ou=groups,$BASEDN??one"
olcConstraintAttribute: mail regex ^[[:alnum:]]+@example.com$
olcConstraintAttribute: description count 2
# cn value has to be concatenated givenName SP sn
olcConstraintAttribute: cn,sn,givenName
set "(this/givenName + [ ] + this/sn) & this/cn"
restrict="ldap:///$USERDN??sub?(objectClass=inetOrgPerson)"
olcConstraintAttribute: uid
uri "ldap:///ou=groups,$BASEDN?uid?one?(objectClass=inetOrgPerson)"
restrict="ldap:///ou=users,$BASEDN??one"
EOF
$SLAPADD -F $CONFDIR -n 0 -l $TESTDIR/config.ldif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment