3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 ## Copyright 2004-2017 The OpenLDAP Foundation.
6 ## All rights reserved.
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted only as authorized by the OpenLDAP
12 ## A copy of this license is available in the file LICENSE in the
13 ## top-level directory of the distribution or, alternatively, at
14 ## <http://www.OpenLDAP.org/license.html>.
16 echo "running defines.sh"
17 . $SRCDIR/scripts/defines.sh
19 if test $UNIQUE = uniqueno; then
20 echo "Attribute Uniqueness overlay not available, test skipped"
25 test $BACKEND = null && RCODEconstraint=0
27 mkdir -p $TESTDIR $DBDIR1
29 $SLAPPASSWD -g -n >$CONFIGPWF
30 echo "rootpw `$SLAPPASSWD -T $CONFIGPWF`" >$TESTDIR/configpw.conf
32 echo "Running slapadd to build slapd database..."
33 . $CONFFILTER $BACKEND $MONITORDB < $UNIQUECONF > $CONF1
34 $SLAPADD -f $CONF1 -l $LDIFUNIQUE
36 if test $RC != 0 ; then
37 echo "slapadd failed ($RC)!"
41 echo "Starting slapd on TCP/IP port $PORT1..."
42 mkdir $TESTDIR/confdir
43 $SLAPD -f $CONF1 -F $TESTDIR/confdir -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
45 if test $WAIT != 0 ; then
53 echo "Testing slapd attribute uniqueness operations..."
54 for i in 0 1 2 3 4 5; do
55 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
56 'objectclass=*' > /dev/null 2>&1
58 if test $RC = 0 ; then
61 echo "Waiting 5 seconds for slapd to start..."
65 if test $RC != 0 ; then
66 echo "ldapsearch failed ($RC)!"
67 test $KILLSERVERS != no && kill -HUP $KILLPIDS
71 echo "Adding a unique record..."
72 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \
73 > /dev/null << EOTUNIQ1
74 dn: uid=dave,ou=users,o=unique
75 objectClass: inetOrgPerson
76 objectClass: simpleSecurityObject
80 businessCategory: otest
83 # NOTE: use special chars in attr value to be used
84 # in internal searches ITS#4212
85 displayName: Dave (ITS#4212)
87 employeeType: contractor
92 if test $RC != 0 ; then
93 echo "ldapadd failed ($RC)!"
94 test $KILLSERVERS != no && kill -HUP $KILLPIDS
98 echo "Adding a non-unique record..."
99 $LDAPADD -D "uid=dave,ou=users,o=unique" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
100 $TESTOUT 2>&1 << EOTUNIQ2
101 dn: uid=bill,ou=users,o=unique
102 objectClass: inetOrgPerson
106 businessCategory: rtest
111 employeeType: contractor
115 if test $RC != $RCODEconstraint ; then
116 echo "unique check failed ($RC)!"
117 test $KILLSERVERS != no && kill -HUP $KILLPIDS
122 echo "Trying to bypass uniqueness as a normal user..."
123 $LDAPADD -M -D "uid=dave,ou=users,o=unique" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
124 $TESTOUT 2>&1 << EOTUNIQ2
125 dn: uid=bill,ou=users,o=unique
126 objectClass: inetOrgPerson
130 businessCategory: rtest
135 employeeType: contractor
139 if test $RC != $RCODEconstraint ; then
140 echo "unique check failed ($RC)!"
141 test $KILLSERVERS != no && kill -HUP $KILLPIDS
146 echo "Bypassing uniqueness as an admin user..."
147 $LDAPADD -M -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
148 $TESTOUT 2>&1 << EOTUNIQ2
149 dn: uid=bill,ou=users,o=unique
150 objectClass: inetOrgPerson
154 businessCategory: rtest
159 employeeType: contractor
163 if test $RC != 0 ; then
164 echo "spurious unique error ($RC)!"
165 test $KILLSERVERS != no && kill -HUP $KILLPIDS
170 $LDAPDELETE -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \
171 "uid=bill,ou=users,o=unique" > $TESTOUT 2>&1
173 if test $RC != 0; then
174 echo "ldapdelete failed ($RC)!"
175 test $KILLSERVERS != no && kill -HUP $KILLPIDS
179 echo Dynamically retrieving initial configuration...
180 $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/initial-config.ldif
181 cat <<EOF >$TESTDIR/initial-reference.ldif
182 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
183 objectClass: olcOverlayConfig
184 objectClass: olcUniqueConfig
185 olcOverlay: {0}unique
186 olcUniqueBase: o=unique
187 olcUniqueAttribute: employeeNumber
188 olcUniqueAttribute: displayName
191 diff $TESTDIR/initial-config.ldif $TESTDIR/initial-reference.ldif > /dev/null 2>&1
193 if test $RC != 0 ; then
194 echo "Initial configuration is not reported correctly."
195 test $KILLSERVERS != no && kill -HUP $KILLPIDS
199 echo Dynamically trying to add a URI with legacy attrs present...
200 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
201 > $TESTOUT 2>&1 <<EOF
202 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
205 olcUniqueURI: ldap:///?employeeNumber,displayName?sub
208 if test $RC != 80 ; then
209 echo "legacy and unique_uri allowed together"
210 test $KILLSERVERS != no && kill -HUP $KILLPIDS
214 echo Dynamically trying to add legacy ignored attrs with legacy attrs present...
215 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
216 > $TESTOUT 2>&1 <<EOF
217 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
220 olcUniqueIgnore: objectClass
223 if test $RC != 80 ; then
224 echo "legacy attrs and legacy ignore attrs allowed together"
225 test $KILLSERVERS != no && kill -HUP $KILLPIDS
229 echo Verifying initial configuration intact...
230 $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/initial-config-recheck.ldif
231 diff $TESTDIR/initial-config-recheck.ldif $TESTDIR/initial-reference.ldif > /dev/null 2>&1
233 if test $RC != 0 ; then
234 echo "Initial configuration damaged by unsuccessful modifies."
235 test $KILLSERVERS != no && kill -HUP $KILLPIDS
239 echo Dynamically removing legacy base...
240 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
241 > $TESTOUT 2>&1 <<EOF
242 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
244 delete: olcUniqueBase
247 if test $RC != 0 ; then
248 echo "base removal failed"
249 test $KILLSERVERS != no && kill -HUP $KILLPIDS
253 echo Verifying base removal...
254 $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/baseremoval-config.ldif
255 cat >$TESTDIR/baseremoval-reference.ldif <<EOF
256 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
257 objectClass: olcOverlayConfig
258 objectClass: olcUniqueConfig
259 olcOverlay: {0}unique
260 olcUniqueAttribute: employeeNumber
261 olcUniqueAttribute: displayName
264 diff $TESTDIR/baseremoval-config.ldif $TESTDIR/baseremoval-reference.ldif > /dev/null 2>&1
266 if test $RC != 0 ; then
267 echo "Configuration damaged by base removal"
268 test $KILLSERVERS != no && kill -HUP $KILLPIDS
272 echo "Adding a non-unique record..."
273 $LDAPADD -D "uid=dave,ou=users,o=unique" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
274 $TESTOUT 2>&1 << EOTUNIQ2
275 dn: uid=bill,ou=users,o=unique
276 objectClass: inetOrgPerson
280 businessCategory: rtest
285 employeeType: contractor
289 if test $RC != $RCODEconstraint ; then
290 echo "unique check failed ($RC)!"
291 test $KILLSERVERS != no && kill -HUP $KILLPIDS
295 echo Trying a legacy base outside of the backend...
296 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
297 > $TESTOUT 2>&1 <<EOF
298 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
301 olcUniqueBase: cn=config
304 if test $RC != 80 ; then
305 echo "out of backend scope base allowed"
306 test $KILLSERVERS != no && kill -HUP $KILLPIDS
310 echo "Adding and removing attrs..."
311 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
312 > $TESTOUT 2>&1 <<EOF
313 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
315 add: olcUniqueAttribute
316 olcUniqueAttribute: description
317 olcUniqueAttribute: telephoneNumber
319 delete: olcUniqueAttribute
320 olcUniqueAttribute: displayName
323 if test $RC != 0 ; then
324 echo "Unable to remove an attribute"
325 test $KILLSERVERS != no && kill -HUP $KILLPIDS
329 echo "Verifying we removed the right attr..."
330 $LDAPADD -D "uid=dave,ou=users,o=unique" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
331 $TESTOUT 2>&1 << EOTUNIQ2
332 dn: uid=bill,ou=users,o=unique
333 objectClass: inetOrgPerson
337 businessCategory: rtest
342 employeeType: contractor
346 if test $RC != $RCODEconstraint ; then
347 echo "olcUniqueAttribtue single deletion hit the wrong value"
348 test $KILLSERVERS != no && kill -HUP $KILLPIDS
352 echo Removing legacy config and adding URIs...
353 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
354 > $TESTOUT 2>&1 <<EOF
355 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
357 delete: olcUniqueAttribute
360 olcUniqueURI: ldap:///?employeeNumber,displayName?sub
361 olcUniqueURI: ldap:///?description?one
364 if test $RC != 0 ; then
365 echo "Reconfiguration to URIs failed"
366 test $KILLSERVERS != no && kill -HUP $KILLPIDS
370 echo Dynamically retrieving second configuration...
371 $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/second-config.ldif
372 cat >$TESTDIR/second-reference.ldif <<EOF
373 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
374 objectClass: olcOverlayConfig
375 objectClass: olcUniqueConfig
376 olcOverlay: {0}unique
377 olcUniqueURI: ldap:///?employeeNumber,displayName?sub
378 olcUniqueURI: ldap:///?description?one
381 diff $TESTDIR/second-config.ldif $TESTDIR/second-reference.ldif > /dev/null 2>&1
383 if test $RC != 0 ; then
384 echo "Second configuration is not reported correctly."
385 test $KILLSERVERS != no && kill -HUP $KILLPIDS
389 echo "Adding a non-unique record..."
390 $LDAPADD -D "uid=dave,ou=users,o=unique" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
391 $TESTOUT 2>&1 << EOTUNIQ2
392 dn: uid=bill,ou=users,o=unique
393 objectClass: inetOrgPerson
397 businessCategory: rtest
402 employeeType: contractor
406 if test $RC != $RCODEconstraint ; then
407 echo "unique check failed ($RC)!"
408 test $KILLSERVERS != no && kill -HUP $KILLPIDS
412 echo Dynamically trying to add legacy base
413 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
414 > $TESTOUT 2>&1 <<EOF
415 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
418 olcUniqueBase: o=unique
421 if test $RC != 80 ; then
422 echo "legacy base allowed with URIs"
423 test $KILLSERVERS != no && kill -HUP $KILLPIDS
427 echo Dynamically trying to add legacy attrs
428 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
429 > $TESTOUT 2>&1 <<EOF
430 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
432 add: olcUniqueAttribute
433 olcUniqueAttribute: description
436 if test $RC != 80 ; then
437 echo "legacy attributes allowed with URIs"
438 test $KILLSERVERS != no && kill -HUP $KILLPIDS
442 echo Dynamically trying to add legacy strictness
443 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
444 > $TESTOUT 2>&1 <<EOF
445 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
448 olcUniqueStrict: TRUE
451 if test $RC != 80 ; then
452 echo "legacy strictness allowed with URIs"
453 test $KILLSERVERS != no && kill -HUP $KILLPIDS
457 #echo ----------------------
458 echo Dynamically trying a bad filter...
459 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
460 > $TESTOUT 2>&1 <<EOF
461 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
463 replace: olcUniqueURI
464 olcUniqueURI: ldap:///?sn?sub?((cn=e*))
467 if test $RC != 80 ; then
468 echo "bad filter allowed"
469 test $KILLSERVERS != no && kill -HUP $KILLPIDS
473 echo Verifying second configuration intact...
474 $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/second-config-recheck.ldif
475 diff $TESTDIR/second-config-recheck.ldif $TESTDIR/second-reference.ldif > /dev/null 2>&1
477 if test $RC != 0 ; then
478 echo "Second configuration damaged by rejected modifies."
479 test $KILLSERVERS != no && kill -HUP $KILLPIDS
483 #echo ----------------------
484 echo Dynamically reconfiguring to use different URIs...
485 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
486 > $TESTOUT 2>&1 <<EOF
487 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
490 olcUniqueURI: ldap:///?sn?sub?(cn=e*)
491 olcUniqueURI: ldap:///?uid?sub?(cn=edgar)
494 olcUniqueURI: ldap:///?description?one
497 if test $RC != 0 ; then
498 echo "unable to reconfigure"
499 test $KILLSERVERS != no && kill -HUP $KILLPIDS
503 echo Dynamically retrieving third configuration...
504 $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/third-config.ldif
505 cat >$TESTDIR/third-reference.ldif <<EOF
506 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
507 objectClass: olcOverlayConfig
508 objectClass: olcUniqueConfig
509 olcOverlay: {0}unique
510 olcUniqueURI: ldap:///?employeeNumber,displayName?sub
511 olcUniqueURI: ldap:///?sn?sub?(cn=e*)
512 olcUniqueURI: ldap:///?uid?sub?(cn=edgar)
515 diff $TESTDIR/third-config.ldif $TESTDIR/third-reference.ldif > /dev/null 2>&1
517 if test $RC != 0 ; then
518 echo "Third configuration is not reported correctly."
519 test $KILLSERVERS != no && kill -HUP $KILLPIDS
523 echo "Adding a record unique in both domains if filtered..."
525 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
527 dn: uid=edgar,ou=users,o=unique
528 objectClass: inetOrgPerson
535 if test $RC != 0 ; then
536 echo "unique check failed ($RC)!"
537 test $KILLSERVERS != no && kill -HUP $KILLPIDS
541 echo "Adding a record unique in all domains because of filter conditions "
542 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
544 dn: uid=empty,ou=users,o=unique
545 objectClass: inetOrgPerson
552 if test $RC != 0 ; then
553 echo "spurious unique error ($RC)!"
554 test $KILLSERVERS != no && kill -HUP $KILLPIDS
558 echo "Sending an empty modification"
560 $LDAPMODIFY -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
562 dn: uid=empty,ou=users,o=unique
567 if test $RC != 0 ; then
568 echo "spurious unique error ($RC)!"
569 test $KILLSERVERS != no && kill -HUP $KILLPIDS
573 echo "Making a record non-unique"
574 $LDAPMODIFY -D "uid=dave,ou=users,o=unique" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
576 dn: uid=empty,ou=users,o=unique
583 if test $RC != $RCODEconstraint ; then
584 echo "unique check failed ($RC)!"
585 test $KILLSERVERS != no && kill -HUP $KILLPIDS
590 echo "Trying to bypass uniqueness as a normal user..."
591 $LDAPMODIFY -M -D "uid=dave,ou=users,o=unique" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
593 dn: uid=empty,ou=users,o=unique
600 if test $RC != $RCODEconstraint ; then
601 echo "unique check failed ($RC)!"
602 test $KILLSERVERS != no && kill -HUP $KILLPIDS
607 echo "Bypassing uniqueness as an admin user..."
608 $LDAPMODIFY -M -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
610 dn: uid=empty,ou=users,o=unique
617 if test $RC != 0 ; then
618 echo "spurious unique error ($RC)!"
619 test $KILLSERVERS != no && kill -HUP $KILLPIDS
624 $LDAPMODIFY -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
626 dn: uid=empty,ou=users,o=unique
633 if test $RC != 0; then
634 echo "ldapmodify failed ($RC)!"
635 test $KILLSERVERS != no && kill -HUP $KILLPIDS
639 echo "Adding another unique record..."
640 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
642 dn: uid=not edgar,uid=edgar,ou=users,o=unique
643 objectClass: inetOrgPerson
650 if test $RC != 0 ; then
651 echo "unique check failed ($RC)!"
652 test $KILLSERVERS != no && kill -HUP $KILLPIDS
656 echo "Making the record non-unique with modrdn..."
657 $LDAPMODRDN -D "uid=dave,ou=users,o=unique" -h $LOCALHOST -p $PORT1 -w $PASSWD \
658 "uid=not edgar,uid=edgar,ou=users,o=unique" "uid=edgar" > $TESTOUT 2>&1
661 if test $RC != $RCODEconstraint ; then
662 echo "unique check failed ($RC)!"
663 test $KILLSERVERS != no && kill -HUP $KILLPIDS
668 echo "Trying to bypass uniqueness as a normal user..."
669 $LDAPMODRDN -M -D "uid=dave,ou=users,o=unique" -h $LOCALHOST -p $PORT1 -w $PASSWD \
670 "uid=not edgar,uid=edgar,ou=users,o=unique" "uid=edgar" > $TESTOUT 2>&1
673 if test $RC != $RCODEconstraint ; then
674 echo "unique check failed ($RC)!"
675 test $KILLSERVERS != no && kill -HUP $KILLPIDS
680 echo "Bypassing uniqueness as an admin user..."
681 $LDAPMODRDN -M -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \
682 "uid=not edgar,uid=edgar,ou=users,o=unique" "uid=edgar" > $TESTOUT 2>&1
685 if test $RC != 0 ; then
686 echo "spurious unique error ($RC)!"
687 test $KILLSERVERS != no && kill -HUP $KILLPIDS
692 $LDAPDELETE -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \
693 "uid=edgar,uid=edgar,ou=users,o=unique" > $TESTOUT 2>&1
695 if test $RC != 0; then
696 echo "ldapdelete failed ($RC)!"
697 test $KILLSERVERS != no && kill -HUP $KILLPIDS
701 echo "Adding a record unique in one domain, non-unique in the filtered domain..."
703 $LDAPADD -D "uid=dave,ou=users,o=unique" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
705 dn: uid=elvis,ou=users,o=unique
706 objectClass: inetOrgPerson
713 if test $RC != $RCODEconstraint ; then
714 echo "unique check failed ($RC)!"
715 test $KILLSERVERS != no && kill -HUP $KILLPIDS
719 #echo ----------------------
720 echo Dynamically reconfiguring to use attribute-ignore URIs...
721 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
722 > $TESTOUT 2>&1 <<EOF
723 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
725 replace: olcUniqueURI
726 olcUniqueURI: ignore ldap:///?objectClass,uid,cn,sn?sub
729 if test $RC != 0 ; then
730 echo "unable to reconfigure"
731 test $KILLSERVERS != no && kill -HUP $KILLPIDS
735 echo Dynamically retrieving fourth configuration...
736 $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -h $LOCALHOST -p $PORT1 -LLL | tr -d \\r >$TESTDIR/fourth-config.ldif
737 cat >$TESTDIR/fourth-reference.ldif <<EOF
738 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
739 objectClass: olcOverlayConfig
740 objectClass: olcUniqueConfig
741 olcOverlay: {0}unique
742 olcUniqueURI: ignore ldap:///?objectClass,uid,cn,sn?sub
745 diff $TESTDIR/fourth-config.ldif $TESTDIR/fourth-reference.ldif > /dev/null 2>&1
747 if test $RC != 0 ; then
748 echo "Fourth configuration is not reported correctly."
749 test $KILLSERVERS != no && kill -HUP $KILLPIDS
753 echo "Adding a record unique in the ignore-domain..."
755 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
757 dn: uid=elvis,ou=users,o=unique
758 objectClass: inetOrgPerson
762 description: left the building
766 if test $RC != 0 ; then
767 echo "unique check failed ($RC)!"
768 test $KILLSERVERS != no && kill -HUP $KILLPIDS
772 echo "Adding a record non-unique in the ignore-domain..."
774 $LDAPADD -D "uid=dave,ou=users,o=unique" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
776 dn: uid=harry,ou=users,o=unique
777 objectClass: inetOrgPerson
781 description: left the building
785 if test $RC != $RCODEconstraint ; then
786 echo "unique check failed ($RC)!"
787 test $KILLSERVERS != no && kill -HUP $KILLPIDS
791 test $KILLSERVERS != no && kill -HUP $KILLPIDS
793 echo ">>>>> Test succeeded"
795 test $KILLSERVERS != no && wait