]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test064-constraint
Do not require ac/string.h for lber_pvt.h
[openldap] / tests / scripts / test064-constraint
index 79b9814ecae434f9814f382ac17b98aa8e442ab8..f0a68c4d419f2fb0141b40f5c5e2a7487cae23e6 100755 (executable)
@@ -96,6 +96,7 @@ olcConstraintAttribute: mail
 olcConstraintAttribute: mail count 1 restrict="ldap:///ou=groups,$BASEDN??one"
 olcConstraintAttribute: mail regex ^[[:alnum:]]+@example.com$
 olcConstraintAttribute: description count 2
+olcConstraintAttribute: jpegPhoto count 0
 # cn value has to be concatenated givenName SP sn
 olcConstraintAttribute: cn,sn,givenName
   set "(this/givenName + [ ] + this/sn) & this/cn"
@@ -114,8 +115,26 @@ if test $WAIT != 0 ; then
        echo PID $PID
        read foo
 fi
+KILLPIDS="$PID"
 sleep 1
 
+echo "Using ldapsearch to check that slapd is running..."
+for i in 0 1 2 3 4 5; do
+       $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
+               'objectclass=*' > /dev/null 2>&1
+       RC=$?
+       if test $RC = 0 ; then
+               break
+       fi
+       echo "Waiting 5 seconds for slapd to start..."
+       sleep 5
+done
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
 echo "Adding basic structure..."
 $LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $ROOTLDIF &>/dev/null
 RC=$?