ITS#7366 Update slapo-constraint tests

This commit is contained in:
Jan Synacek 2012-08-23 13:09:05 +02:00 committed by Howard Chu
parent a1c2dc66db
commit 96b994e6dd
31 changed files with 55 additions and 29 deletions

View file

@ -23,3 +23,6 @@ FAIL
FAIL
FAIL
FAIL
FAIL
FAIL
FAIL

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: mail
mail: a@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: mail
mail: a@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: example@not-allowed.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: mail
mail: original@example.com

View file

@ -0,0 +1,10 @@
dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: mail
mail: original@example.com
-
add: mail
mail: notsooriginal@example.com
-
replace: cn
cn: John Fail

View file

@ -0,0 +1,4 @@
dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: givenname
givenname: Joe

View file

@ -0,0 +1,4 @@
dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: sn
sn: Down

View file

@ -1,3 +1,3 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: mail

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: mail
mail: a@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: mail
mail: a@example.com

View file

@ -1,3 +1,3 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: mail

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: a@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: mail
-

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: mail
-

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: mail
mail: a@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com

View file

@ -1,4 +1,4 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: description
description: desc1

View file

@ -1,7 +1,8 @@
dn: cn=user,dc=example,dc=com
dn: cn=John Doe,dc=example,dc=com
objectclass: inetOrgPerson
objectclass: organizationalPerson
cn: John
cn: John Doe
givenname: John
sn: Doe
mail: original@example.com
description: desc1

View file

@ -13,7 +13,7 @@ ROOTLDIF="$CONSTRAINTDIR/root.ldif"
USERLDIF="$CONSTRAINTDIR/user.ldif"
RESULTOUT="$CONSTRAINTDIR/constraint.out"
SCRIPTOUT="$TESTDIR/constraint.out"
USERDN="cn=user,$BASEDN"
USERDN="cn=John Doe,$BASEDN"
CONFDIR=$TESTDIR/slapd.d
mkdir -p $TESTDIR $CONFDIR $DBDIR1
@ -91,6 +91,10 @@ olcOverlay: constraint
olcConstraintAttribute: mail count 3
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)"
EOF
$SLAPADD -F $CONFDIR -n 0 -l $TESTDIR/config.ldif
@ -123,7 +127,7 @@ fi
echo "Running constraint tests..."
for ldif in $SRCDIR/data/constraint/{*ok*,*fail*}.ldif; do
### reload
$LDAPDELETE -D "$MANAGERDN" -H $URI1 -w $PASSWD $USERDN &>/dev/null
$LDAPDELETE -D "$MANAGERDN" -H $URI1 -w $PASSWD "$USERDN" &>/dev/null
RC=$?
if test $RC != 0 ; then
echo "ldapdelete failed ($RC)!"