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