X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tests%2Fscripts%2Ftest024-unique;h=1851bcab6a15a5c02c4425c15ddaa92461353650;hb=3743a5a68e4d608949d5fd04904733ee5c1ac959;hp=5b24d1b56018daa7f22846f3b6345084fc82de01;hpb=4af9eb971559e3a1f0432615e93ec870dc753ddb;p=openldap diff --git a/tests/scripts/test024-unique b/tests/scripts/test024-unique index 5b24d1b560..1851bcab6a 100755 --- a/tests/scripts/test024-unique +++ b/tests/scripts/test024-unique @@ -2,7 +2,7 @@ # $OpenLDAP$ ## This work is part of OpenLDAP Software . ## -## Copyright 2004-2009 The OpenLDAP Foundation. +## Copyright 2004-2012 The OpenLDAP Foundation. ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without @@ -21,6 +21,9 @@ if test $UNIQUE = uniqueno; then exit 0 fi +RCODEconstraint=19 +test $BACKEND = null && RCODEconstraint=0 + mkdir -p $TESTDIR $DBDIR1 $SLAPPASSWD -g -n >$CONFIGPWF @@ -107,7 +110,7 @@ employeeType: contractor givenName: Bill EOTUNIQ2 RC=$? -if test $RC != 19 ; then +if test $RC != $RCODEconstraint ; then echo "unique check failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 @@ -223,7 +226,7 @@ employeeType: contractor givenName: Bill EOTUNIQ2 RC=$? -if test $RC != 19 ; then +if test $RC != $RCODEconstraint ; then echo "unique check failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 @@ -280,7 +283,7 @@ employeeType: contractor givenName: Bill EOTUNIQ2 RC=$? -if test $RC != 19 ; then +if test $RC != $RCODEconstraint ; then echo "olcUniqueAttribtue single deletion hit the wrong value" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 @@ -340,7 +343,7 @@ employeeType: contractor givenName: Bill EOTUNIQ2 RC=$? -if test $RC != 19 ; then +if test $RC != $RCODEconstraint ; then echo "unique check failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 @@ -425,6 +428,7 @@ dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config changetype: modify add: olcUniqueURI olcUniqueURI: ldap:///?sn?sub?(cn=e*) +olcUniqueURI: ldap:///?uid?sub?(cn=edgar) - delete: olcUniqueURI olcUniqueURI: ldap:///?description?one @@ -445,6 +449,7 @@ objectClass: olcUniqueConfig olcOverlay: {0}unique olcUniqueURI: ldap:///?employeeNumber,displayName?sub olcUniqueURI: ldap:///?sn?sub?(cn=e*) +olcUniqueURI: ldap:///?uid?sub?(cn=edgar) EOF diff $TESTDIR/third-config.ldif $TESTDIR/third-reference.ldif > /dev/null 2>&1 @@ -473,6 +478,24 @@ if test $RC != 0 ; then exit -1 fi +echo "Adding a record unique in all domains because of filter conditions " +$LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \ + $TESTOUT 2>&1 << EOF +dn: uid=empty,ou=users,o=unique +objectClass: inetOrgPerson +uid: edgar +cn: empty +sn: empty +EOF + +RC=$? +if test $RC != 0 ; then + echo "spurious unique error ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit -1 +fi + + echo "Adding a record unique in one domain, non-unique in the filtered domain..." $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \ @@ -485,7 +508,7 @@ cn: elvis EOF RC=$? -if test $RC != 19 ; then +if test $RC != $RCODEconstraint ; then echo "unique check failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1 @@ -557,7 +580,7 @@ description: left the building EOF RC=$? -if test $RC != 19 ; then +if test $RC != $RCODEconstraint ; then echo "unique check failed ($RC)!" test $KILLSERVERS != no && kill -HUP $KILLPIDS exit -1