]> git.sur5r.net Git - openldap/blob - tests/scripts/test024-unique
Merge remote-tracking branch 'origin/mdb.RE/0.9'
[openldap] / tests / scripts / test024-unique
1 #! /bin/sh
2 # $OpenLDAP$
3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 ##
5 ## Copyright 2004-2014 The OpenLDAP Foundation.
6 ## All rights reserved.
7 ##
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted only as authorized by the OpenLDAP
10 ## Public License.
11 ##
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>.
15
16 echo "running defines.sh"
17 . $SRCDIR/scripts/defines.sh
18
19 if test $UNIQUE = uniqueno; then
20         echo "Attribute Uniqueness overlay not available, test skipped"
21         exit 0
22 fi
23
24 RCODEconstraint=19
25 test $BACKEND = null && RCODEconstraint=0
26
27 mkdir -p $TESTDIR $DBDIR1
28
29 $SLAPPASSWD -g -n >$CONFIGPWF
30 echo "rootpw `$SLAPPASSWD -T $CONFIGPWF`" >$TESTDIR/configpw.conf
31
32 echo "Running slapadd to build slapd database..."
33 . $CONFFILTER $BACKEND $MONITORDB < $UNIQUECONF > $CONF1
34 $SLAPADD -f $CONF1 -l $LDIFUNIQUE
35 RC=$?
36 if test $RC != 0 ; then
37         echo "slapadd failed ($RC)!"
38         exit $RC
39 fi
40
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 &
44 PID=$!
45 if test $WAIT != 0 ; then
46     echo PID $PID
47     read foo
48 fi
49 KILLPIDS="$PID"
50
51 sleep 1
52
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
57         RC=$?
58         if test $RC = 0 ; then
59                 break
60         fi
61         echo "Waiting 5 seconds for slapd to start..."
62         sleep 5
63 done
64
65 if test $RC != 0 ; then
66         echo "ldapsearch failed ($RC)!"
67         test $KILLSERVERS != no && kill -HUP $KILLPIDS
68         exit $RC
69 fi
70
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 uid: dave
77 sn: nothere
78 cn: dave
79 businessCategory: otest
80 carLicense: TEST
81 departmentNumber: 42
82 # NOTE: use special chars in attr value to be used
83 # in internal searches ITS#4212
84 displayName: Dave (ITS#4212)
85 employeeNumber: 69
86 employeeType: contractor
87 givenName: Dave
88 EOTUNIQ1
89 RC=$?
90 if test $RC != 0 ; then
91         echo "ldapadd failed ($RC)!"
92         test $KILLSERVERS != no && kill -HUP $KILLPIDS
93         exit $RC
94 fi
95
96 echo "Adding a non-unique record..."
97 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
98          $TESTOUT 2>&1 << EOTUNIQ2
99 dn: uid=bill,ou=users,o=unique
100 objectClass: inetOrgPerson
101 uid: bill
102 sn: johnson
103 cn: bill
104 businessCategory: rtest
105 carLicense: ABC123
106 departmentNumber: 42
107 displayName: Bill
108 employeeNumber: 5150
109 employeeType: contractor
110 givenName: Bill
111 EOTUNIQ2
112 RC=$?
113 if test $RC != $RCODEconstraint ; then
114         echo "unique check failed ($RC)!"
115         test $KILLSERVERS != no && kill -HUP $KILLPIDS
116         exit -1
117 fi
118
119 echo Dynamically retrieving initial configuration...
120 $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
121 cat <<EOF >$TESTDIR/initial-reference.ldif
122 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
123 objectClass: olcOverlayConfig
124 objectClass: olcUniqueConfig
125 olcOverlay: {0}unique
126 olcUniqueBase: o=unique
127 olcUniqueAttribute: employeeNumber
128 olcUniqueAttribute: displayName
129
130 EOF
131 diff $TESTDIR/initial-config.ldif $TESTDIR/initial-reference.ldif > /dev/null 2>&1
132 RC=$?
133 if test $RC != 0 ; then
134     echo "Initial configuration is not reported correctly."
135     test $KILLSERVERS != no && kill -HUP $KILLPIDS
136     exit -1
137 fi
138
139 echo Dynamically trying to add a URI with legacy attrs present...
140 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
141     > $TESTOUT 2>&1 <<EOF
142 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
143 changetype: modify
144 add: olcUniqueURI
145 olcUniqueURI: ldap:///?employeeNumber,displayName?sub
146 EOF
147 RC=$?
148 if test $RC != 80 ; then
149         echo "legacy and unique_uri allowed together"
150         test $KILLSERVERS != no && kill -HUP $KILLPIDS
151         exit -1
152 fi
153
154 echo Dynamically trying to add legacy ignored attrs with legacy attrs present...
155 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
156     > $TESTOUT 2>&1 <<EOF
157 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
158 changetype: modify
159 add: olcUniqueIgnore
160 olcUniqueIgnore: objectClass
161 EOF
162 RC=$?
163 if test $RC != 80 ; then
164         echo "legacy attrs and legacy ignore attrs allowed together"
165         test $KILLSERVERS != no && kill -HUP $KILLPIDS
166         exit -1
167 fi
168
169 echo Verifying initial configuration intact...
170 $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
171 diff $TESTDIR/initial-config-recheck.ldif $TESTDIR/initial-reference.ldif > /dev/null 2>&1
172 RC=$?
173 if test $RC != 0 ; then
174     echo "Initial configuration damaged by unsuccessful modifies."
175     test $KILLSERVERS != no && kill -HUP $KILLPIDS
176     exit -1
177 fi
178
179 echo Dynamically removing legacy base...
180 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
181     > $TESTOUT 2>&1 <<EOF
182 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
183 changetype: modify
184 delete: olcUniqueBase
185 EOF
186 RC=$?
187 if test $RC != 0 ; then
188         echo "base removal failed"
189         test $KILLSERVERS != no && kill -HUP $KILLPIDS
190         exit -1
191 fi
192
193 echo Verifying base removal...
194 $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
195 cat >$TESTDIR/baseremoval-reference.ldif <<EOF
196 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
197 objectClass: olcOverlayConfig
198 objectClass: olcUniqueConfig
199 olcOverlay: {0}unique
200 olcUniqueAttribute: employeeNumber
201 olcUniqueAttribute: displayName
202
203 EOF
204 diff $TESTDIR/baseremoval-config.ldif $TESTDIR/baseremoval-reference.ldif > /dev/null 2>&1
205 RC=$?
206 if test $RC != 0 ; then
207     echo "Configuration damaged by base removal"
208     test $KILLSERVERS != no && kill -HUP $KILLPIDS
209     exit -1
210 fi
211
212 echo "Adding a non-unique record..."
213 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
214          $TESTOUT 2>&1 << EOTUNIQ2
215 dn: uid=bill,ou=users,o=unique
216 objectClass: inetOrgPerson
217 uid: bill
218 sn: johnson
219 cn: bill
220 businessCategory: rtest
221 carLicense: ABC123
222 departmentNumber: 42
223 displayName: Bill
224 employeeNumber: 5150
225 employeeType: contractor
226 givenName: Bill
227 EOTUNIQ2
228 RC=$?
229 if test $RC != $RCODEconstraint ; then
230         echo "unique check failed ($RC)!"
231         test $KILLSERVERS != no && kill -HUP $KILLPIDS
232         exit -1
233 fi
234
235 echo Trying a legacy base outside of the backend...
236 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
237     > $TESTOUT 2>&1 <<EOF
238 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
239 changetype: modify
240 add: olcUniqueBase
241 olcUniqueBase: cn=config
242 EOF
243 RC=$?
244 if test $RC != 80 ; then
245         echo "out of backend scope base allowed"
246         test $KILLSERVERS != no && kill -HUP $KILLPIDS
247         exit -1
248 fi
249
250 echo "Adding and removing attrs..."
251 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
252     > $TESTOUT 2>&1 <<EOF
253 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
254 changetype: modify
255 add: olcUniqueAttribute
256 olcUniqueAttribute: description
257 olcUniqueAttribute: telephoneNumber
258 -
259 delete: olcUniqueAttribute
260 olcUniqueAttribute: displayName
261 EOF
262 RC=$?
263 if test $RC != 0 ; then
264         echo "Unable to remove an attribute"
265         test $KILLSERVERS != no && kill -HUP $KILLPIDS
266         exit -1
267 fi
268
269 echo "Verifying we removed the right attr..."
270 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
271          $TESTOUT 2>&1 << EOTUNIQ2
272 dn: uid=bill,ou=users,o=unique
273 objectClass: inetOrgPerson
274 uid: bill
275 sn: johnson
276 cn: bill
277 businessCategory: rtest
278 carLicense: ABC123
279 departmentNumber: 42
280 displayName: Bill
281 employeeNumber: 5150
282 employeeType: contractor
283 givenName: Bill
284 EOTUNIQ2
285 RC=$?
286 if test $RC != $RCODEconstraint ; then
287         echo "olcUniqueAttribtue single deletion hit the wrong value"
288         test $KILLSERVERS != no && kill -HUP $KILLPIDS
289         exit -1
290 fi
291
292 echo Removing legacy config and adding URIs...
293 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
294     > $TESTOUT 2>&1 <<EOF
295 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
296 changetype: modify
297 delete: olcUniqueAttribute
298 -
299 add: olcUniqueURI
300 olcUniqueURI: ldap:///?employeeNumber,displayName?sub
301 olcUniqueURI: ldap:///?description?one
302 EOF
303 RC=$?
304 if test $RC != 0 ; then
305         echo "Reconfiguration to URIs failed"
306         test $KILLSERVERS != no && kill -HUP $KILLPIDS
307         exit -1
308 fi
309
310 echo Dynamically retrieving second configuration...
311 $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
312 cat >$TESTDIR/second-reference.ldif <<EOF
313 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
314 objectClass: olcOverlayConfig
315 objectClass: olcUniqueConfig
316 olcOverlay: {0}unique
317 olcUniqueURI: ldap:///?employeeNumber,displayName?sub
318 olcUniqueURI: ldap:///?description?one
319
320 EOF
321 diff $TESTDIR/second-config.ldif $TESTDIR/second-reference.ldif > /dev/null 2>&1
322 RC=$?
323 if test $RC != 0 ; then
324     echo "Second configuration is not reported correctly."
325     test $KILLSERVERS != no && kill -HUP $KILLPIDS
326     exit -1
327 fi
328
329 echo "Adding a non-unique record..."
330 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
331          $TESTOUT 2>&1 << EOTUNIQ2
332 dn: uid=bill,ou=users,o=unique
333 objectClass: inetOrgPerson
334 uid: bill
335 sn: johnson
336 cn: bill
337 businessCategory: rtest
338 carLicense: ABC123
339 departmentNumber: 42
340 displayName: Bill
341 employeeNumber: 5150
342 employeeType: contractor
343 givenName: Bill
344 EOTUNIQ2
345 RC=$?
346 if test $RC != $RCODEconstraint ; then
347         echo "unique check failed ($RC)!"
348         test $KILLSERVERS != no && kill -HUP $KILLPIDS
349         exit -1
350 fi
351
352 echo Dynamically trying to add legacy base
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
356 changetype: modify
357 add: olcUniqueBase
358 olcUniqueBase: o=unique
359 EOF
360 RC=$?
361 if test $RC != 80 ; then
362         echo "legacy base allowed with URIs"
363         test $KILLSERVERS != no && kill -HUP $KILLPIDS
364         exit -1
365 fi
366
367 echo Dynamically trying to add legacy attrs
368 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
369     > $TESTOUT 2>&1 <<EOF
370 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
371 changetype: modify
372 add: olcUniqueAttribute
373 olcUniqueAttribute: description
374 EOF
375 RC=$?
376 if test $RC != 80 ; then
377         echo "legacy attributes allowed with URIs"
378         test $KILLSERVERS != no && kill -HUP $KILLPIDS
379         exit -1
380 fi
381
382 echo Dynamically trying to add legacy strictness
383 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
384     > $TESTOUT 2>&1 <<EOF
385 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
386 changetype: modify
387 add: olcUniqueStrict
388 olcUniqueStrict: TRUE
389 EOF
390 RC=$?
391 if test $RC != 80 ; then
392         echo "legacy strictness allowed with URIs"
393         test $KILLSERVERS != no && kill -HUP $KILLPIDS
394         exit -1
395 fi
396
397 #echo ----------------------
398 echo Dynamically trying a bad filter...
399 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
400     > $TESTOUT 2>&1 <<EOF
401 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
402 changetype: modify
403 replace: olcUniqueURI
404 olcUniqueURI: ldap:///?sn?sub?((cn=e*))
405 EOF
406 RC=$?
407 if test $RC != 80 ; then
408         echo "bad filter allowed"
409         test $KILLSERVERS != no && kill -HUP $KILLPIDS
410         exit -1
411 fi
412
413 echo Verifying second configuration intact...
414 $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
415 diff $TESTDIR/second-config-recheck.ldif $TESTDIR/second-reference.ldif > /dev/null 2>&1
416 RC=$?
417 if test $RC != 0 ; then
418     echo "Second configuration damaged by rejected modifies."
419     test $KILLSERVERS != no && kill -HUP $KILLPIDS
420     exit -1
421 fi
422
423 #echo ----------------------
424 echo Dynamically reconfiguring to use different URIs...
425 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
426     > $TESTOUT 2>&1 <<EOF
427 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
428 changetype: modify
429 add: olcUniqueURI
430 olcUniqueURI: ldap:///?sn?sub?(cn=e*)
431 olcUniqueURI: ldap:///?uid?sub?(cn=edgar)
432 -
433 delete: olcUniqueURI
434 olcUniqueURI: ldap:///?description?one
435 EOF
436 RC=$?
437 if test $RC != 0 ; then
438         echo "unable to reconfigure"
439         test $KILLSERVERS != no && kill -HUP $KILLPIDS
440         exit -1
441 fi
442
443 echo Dynamically retrieving third configuration...
444 $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
445 cat >$TESTDIR/third-reference.ldif <<EOF
446 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
447 objectClass: olcOverlayConfig
448 objectClass: olcUniqueConfig
449 olcOverlay: {0}unique
450 olcUniqueURI: ldap:///?employeeNumber,displayName?sub
451 olcUniqueURI: ldap:///?sn?sub?(cn=e*)
452 olcUniqueURI: ldap:///?uid?sub?(cn=edgar)
453
454 EOF
455 diff $TESTDIR/third-config.ldif $TESTDIR/third-reference.ldif > /dev/null 2>&1
456 RC=$?
457 if test $RC != 0 ; then
458     echo "Third configuration is not reported correctly."
459     test $KILLSERVERS != no && kill -HUP $KILLPIDS
460     exit -1
461 fi
462
463 echo "Adding a record unique in both domains if filtered..."
464
465 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
466          $TESTOUT 2>&1 << EOF
467 dn: uid=edgar,ou=users,o=unique
468 objectClass: inetOrgPerson
469 uid: edgar
470 sn: johnson
471 cn: edgar
472 EOF
473
474 RC=$?
475 if test $RC != 0 ; then
476         echo "unique check failed ($RC)!"
477         test $KILLSERVERS != no && kill -HUP $KILLPIDS
478         exit -1
479 fi
480
481 echo "Adding a record unique in all domains because of filter conditions "
482 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
483          $TESTOUT 2>&1 << EOF
484 dn: uid=empty,ou=users,o=unique
485 objectClass: inetOrgPerson
486 uid: edgar
487 cn: empty
488 sn: empty
489 EOF
490
491 RC=$?
492 if test $RC != 0 ; then
493         echo "spurious unique error ($RC)!"
494         test $KILLSERVERS != no && kill -HUP $KILLPIDS
495         exit -1
496 fi
497
498
499 echo "Adding a record unique in one domain, non-unique in the filtered domain..."
500
501 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
502          $TESTOUT 2>&1 << EOF
503 dn: uid=elvis,ou=users,o=unique
504 objectClass: inetOrgPerson
505 uid: elvis
506 sn: johnson
507 cn: elvis
508 EOF
509
510 RC=$?
511 if test $RC != $RCODEconstraint ; then
512         echo "unique check failed ($RC)!"
513         test $KILLSERVERS != no && kill -HUP $KILLPIDS
514         exit -1
515 fi
516
517 #echo ----------------------
518 echo Dynamically reconfiguring to use attribute-ignore URIs...
519 $LDAPMODIFY -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF \
520     > $TESTOUT 2>&1 <<EOF
521 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
522 changetype: modify
523 replace: olcUniqueURI
524 olcUniqueURI: ignore ldap:///?objectClass,uid,cn,sn?sub
525 EOF
526 RC=$?
527 if test $RC != 0 ; then
528         echo "unable to reconfigure"
529         test $KILLSERVERS != no && kill -HUP $KILLPIDS
530         exit -1
531 fi
532
533 echo Dynamically retrieving fourth configuration...
534 $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
535 cat >$TESTDIR/fourth-reference.ldif <<EOF
536 dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
537 objectClass: olcOverlayConfig
538 objectClass: olcUniqueConfig
539 olcOverlay: {0}unique
540 olcUniqueURI: ignore ldap:///?objectClass,uid,cn,sn?sub
541
542 EOF
543 diff $TESTDIR/fourth-config.ldif $TESTDIR/fourth-reference.ldif > /dev/null 2>&1
544 RC=$?
545 if test $RC != 0 ; then
546     echo "Fourth configuration is not reported correctly."
547     test $KILLSERVERS != no && kill -HUP $KILLPIDS
548     exit -1
549 fi
550
551 echo "Adding a record unique in the ignore-domain..."
552
553 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
554          $TESTOUT 2>&1 << EOF
555 dn: uid=elvis,ou=users,o=unique
556 objectClass: inetOrgPerson
557 uid: elvis
558 sn: johnson
559 cn: elvis
560 description: left the building
561 EOF
562
563 RC=$?
564 if test $RC != 0 ; then
565         echo "unique check failed ($RC)!"
566         test $KILLSERVERS != no && kill -HUP $KILLPIDS
567         exit -1
568 fi
569
570 echo "Adding a record non-unique in the ignore-domain..."
571
572 $LDAPADD -D "$UNIQUEDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
573          $TESTOUT 2>&1 << EOF
574 dn: uid=harry,ou=users,o=unique
575 objectClass: inetOrgPerson
576 uid: harry
577 sn: johnson
578 cn: harry
579 description: left the building
580 EOF
581
582 RC=$?
583 if test $RC != $RCODEconstraint ; then
584         echo "unique check failed ($RC)!"
585         test $KILLSERVERS != no && kill -HUP $KILLPIDS
586         exit -1
587 fi
588
589 test $KILLSERVERS != no && kill -HUP $KILLPIDS
590
591 echo ">>>>> Test succeeded"
592
593 test $KILLSERVERS != no && wait
594
595 exit 0