]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test024-unique
Sync with HEAD
[openldap] / tests / scripts / test024-unique
index a6939a9220ed2707b8686e20d58dfd0b3694e6c6..dff70391a812fda7b3b193e4f8d0c8f8d1cad0e1 100755 (executable)
@@ -1,8 +1,8 @@
-#! /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
@@ -41,6 +41,8 @@ if test $WAIT != 0 ; then
 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 \
@@ -63,7 +65,8 @@ echo "Adding a unique record..."
 
 #$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
@@ -72,7 +75,9 @@ cn: 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
@@ -107,10 +112,10 @@ givenName: Bill
 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
 
 
@@ -122,4 +127,7 @@ fi
 test $KILLSERVERS != no && kill -HUP $KILLPIDS
 
 echo ">>>>> Test succeeded"
+
+test $KILLSERVERS != no && wait
+
 exit 0