-#! /bin/sh -xv
+#! /bin/sh
# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
-## Copyright 2004 The OpenLDAP Foundation.
+## Copyright 2004-2006 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
fi
KILLPIDS="$PID"
+sleep 1
+
echo "Testing slapd attribute uniqueness operations..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
#$LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
# $TESTOUT 2>&1 << EOTUNIQ1
-$LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD << EOTUNIQ1
+$LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \
+ > /dev/null << EOTUNIQ1
dn: uid=dave,ou=users,o=unique
objectClass: inetOrgPerson
uid: dave
businessCategory: otest
carLicense: TEST
departmentNumber: 42
-displayName: Dave
+# NOTE: use special chars in attr value to be used
+# in internal searches ITS#4212
+displayName: Dave (ITS#4212)
employeeNumber: 69
employeeType: contractor
givenName: Dave
EOTUNIQ2
RC=$?
-if test $RC != 0 ; then
- echo "ldapadd failed ($RC)!"
+if test $RC != 19 ; then
+ echo "unique check failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit -1
fi
test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded"
+
+test $KILLSERVERS != no && wait
+
exit 0