]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test064-constraint
ITS#7366 Update slapo-constraint tests
[openldap] / tests / scripts / test064-constraint
index 2d29baf1c612d726610236322ffd17e4810a28ff..a3104e168feb6c7bf7ece808a71bcf8b8bb7953c 100755 (executable)
@@ -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)!"