Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / openldap / dist / tests / scripts / test047-ldap
blob75633184b98b7f8c19d943868f7868d0d9083229
1 #! /bin/sh
2 # $OpenLDAP: pkg/ldap/tests/scripts/test047-ldap,v 1.1.2.5 2008/02/11 23:26:51 kurt Exp $
3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 ##
5 ## Copyright 1998-2008 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.
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 echo ""
21 if test $BACKLDAP = ldapno ; then
22 echo "ldap backend not available, test skipped"
23 exit 0
26 if test $RWM = rwmno ; then
27 echo "rwm (rewrite/remap) overlay not available, test skipped"
28 exit 0
29 fi
31 rm -rf $TESTDIR
33 mkdir -p $TESTDIR $DBDIR1 $DBDIR2
35 echo "Starting slapd on TCP/IP port $PORT1..."
36 . $CONFFILTER $BACKEND $MONITORDB < $METACONF1 > $CONF1
37 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
38 PID=$!
39 if test $WAIT != 0 ; then
40 echo PID $PID
41 read foo
43 KILLPIDS="$PID"
45 sleep 1
47 echo "Using ldapsearch to check that slapd is running..."
48 for i in 0 1 2 3 4 5; do
49 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
50 'objectclass=*' > /dev/null 2>&1
51 RC=$?
52 if test $RC = 0 ; then
53 break
55 echo "Waiting 5 seconds for slapd to start..."
56 sleep 5
57 done
58 if test $RC != 0 ; then
59 echo "ldapsearch failed ($RC)!"
60 test $KILLSERVERS != no && kill -HUP $KILLPIDS
61 exit $RC
64 echo "Using ldapadd to populate the database..."
65 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
66 $LDIFORDERED > $TESTOUT 2>&1
67 RC=$?
68 if test $RC != 0 ; then
69 echo "ldapadd failed ($RC)!"
70 test $KILLSERVERS != no && kill -HUP $KILLPIDS
71 exit $RC
74 echo "Starting slapd on TCP/IP port $PORT2..."
75 . $CONFFILTER $BACKEND $MONITORDB < $METACONF2 > $CONF2
76 $SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
77 PID=$!
78 if test $WAIT != 0 ; then
79 echo PID $PID
80 read foo
82 KILLPIDS="$KILLPIDS $PID"
84 sleep 1
86 echo "Using ldapsearch to check that slapd is running..."
87 for i in 0 1 2 3 4 5; do
88 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
89 'objectclass=*' > /dev/null 2>&1
90 RC=$?
91 if test $RC = 0 ; then
92 break
94 echo "Waiting 5 seconds for slapd to start..."
95 sleep 5
96 done
97 if test $RC != 0 ; then
98 echo "ldapsearch failed ($RC)!"
99 test $KILLSERVERS != no && kill -HUP $KILLPIDS
100 exit $RC
103 echo "Using ldapadd to populate the database..."
104 $LDAPADD -D "$METAMANAGERDN" -h $LOCALHOST -p $PORT2 -w $PASSWD < \
105 $LDIFMETA >> $TESTOUT 2>&1
106 RC=$?
107 if test $RC != 0 ; then
108 echo "ldapadd failed ($RC)!"
109 test $KILLSERVERS != no && kill -HUP $KILLPIDS
110 exit $RC
113 echo "Starting slapd on TCP/IP port $PORT3..."
114 . $CONFFILTER $BACKEND $MONITORDB < $GLUELDAPCONF > $CONF3
115 $SLAPD -f $CONF3 -h $URI3 -d $LVL $TIMING > $LOG3 2>&1 &
116 PID=$!
117 if test $WAIT != 0 ; then
118 echo PID $PID
119 read foo
121 KILLPIDS="$KILLPIDS $PID"
123 sleep 1
125 echo "Using ldapsearch to check that slapd is running..."
126 for i in 0 1 2 3 4 5; do
127 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT3 \
128 'objectclass=*' > /dev/null 2>&1
129 RC=$?
130 if test $RC = 0 ; then
131 break
133 echo "Waiting 5 seconds for slapd to start..."
134 sleep 5
135 done
136 if test $RC != 0 ; then
137 echo "ldapsearch failed ($RC)!"
138 test $KILLSERVERS != no && kill -HUP $KILLPIDS
139 exit $RC
142 cat /dev/null > $SEARCHOUT
144 BASEDN="o=Example,c=US"
145 echo "Searching base=\"$BASEDN\"..."
146 echo "# searching base=\"$BASEDN\"..." >> $SEARCHOUT
147 $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" >> $SEARCHOUT 2>&1
148 RC=$?
149 #if test $RC != 0 ; then
150 # echo "Search failed ($RC)!"
151 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
152 # exit $RC
154 case $RC in
158 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
159 test $KILLSERVERS != no && kill -HUP $KILLPIDS
160 exit 0
163 echo "Search failed ($RC)!"
164 test $KILLSERVERS != no && kill -HUP $KILLPIDS
165 exit $RC
167 esac
169 # ITS#4195: spurious matchedDN when the search scopes the main target,
170 # and the searchBase is not present, so that target returns noSuchObject
171 BASEDN="ou=Meta,o=Example,c=US"
172 echo "Searching base=\"$BASEDN\"..."
173 echo "# searching base=\"$BASEDN\"..." >> $SEARCHOUT
174 $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" >> $SEARCHOUT 2>&1
175 RC=$?
176 #if test $RC != 0 ; then
177 # echo "Search failed ($RC)!"
178 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
179 # exit $RC
181 case $RC in
185 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
186 test $KILLSERVERS != no && kill -HUP $KILLPIDS
187 exit 0
190 echo "Search failed ($RC)!"
191 test $KILLSERVERS != no && kill -HUP $KILLPIDS
192 exit $RC
194 esac
197 # Do some modifications
200 BASEDN="o=Example,c=US"
201 echo "Modifying database \"$BASEDN\"..."
202 $LDAPMODIFY -v -D "cn=Manager,$BASEDN" -h $LOCALHOST -p $PORT3 -w $PASSWD \
203 -M >> $TESTOUT 2>&1 << EOMODS
204 # These operations (updates with objectClass mapping) triggered ITS#3499
205 dn: cn=Added Group,ou=Groups,$BASEDN
206 changetype: add
207 objectClass: groupOfNames
208 objectClass: uidObject
209 cn: Added Group
210 member: cn=Added Group,ou=Groups,$BASEDN
211 uid: added
213 dn: cn=Another Added Group,ou=Groups,$BASEDN
214 changetype: add
215 objectClass: groupOfNames
216 cn: Another Added Group
217 member: cn=Added Group,ou=Groups,$BASEDN
218 member: cn=Another Added Group,ou=Groups,$BASEDN
220 dn: cn=Another Added Group,ou=Groups,$BASEDN
221 changetype: modify
222 add: objectClass
223 objectClass: uidObject
225 add: uid
226 uid: added
229 dn: cn=Added Group,ou=Groups,$BASEDN
230 changetype: modify
231 delete: objectClass
232 objectClass: uidObject
234 delete: uid
237 dn: ou=Meta,$BASEDN
238 changetype: modify
239 add: description
240 description: added to "ou=Meta,$BASEDN"
243 dn: ou=Who's going to handle this?,$BASEDN
244 changetype: add
245 objectClass: organizationalUnit
246 ou: Who's going to handle this?
247 description: added
248 description: will be deleted
250 dn: ou=Same as above,$BASEDN
251 changetype: add
252 objectClass: organizationalUnit
253 ou: Same as above
254 description: added right after "Who's going to handle this?"
255 description: will be preserved
257 dn: ou=Who's going to handle this?,$BASEDN
258 changetype: delete
260 dn: ou=Who's going to handle this?,ou=Meta,$BASEDN
261 changetype: add
262 objectClass: organizationalUnit
263 ou: Who's going to handle this?
264 description: added
265 description: will be deleted
267 dn: ou=Same as above,ou=Meta,$BASEDN
268 changetype: add
269 objectClass: organizationalUnit
270 ou: Same as above
271 description: added right after "Who's going to handle this?"
272 description: will be preserved
274 dn: cn=Added User,ou=Same as above,ou=Meta,$BASEDN
275 changetype: add
276 objectClass: inetOrgPerson
277 cn: Added User
278 sn: User
279 userPassword: secret
281 dn: ou=Who's going to handle this?,ou=Meta,$BASEDN
282 changetype: delete
283 EOMODS
285 RC=$?
286 #if test $RC != 0 ; then
287 # echo "Modify failed ($RC)!"
288 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
289 # exit $RC
291 case $RC in
295 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
296 test $KILLSERVERS != no && kill -HUP $KILLPIDS
297 exit 0
300 echo "Modify failed ($RC)!"
301 test $KILLSERVERS != no && kill -HUP $KILLPIDS
302 exit $RC
304 esac
306 echo "Searching base=\"$BASEDN\"..."
307 echo "# searching base=\"$BASEDN\"..." >> $SEARCHOUT
308 $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" >> $SEARCHOUT 2>&1
309 RC=$?
310 #if test $RC != 0 ; then
311 # echo "Search failed ($RC)!"
312 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
313 # exit $RC
315 case $RC in
319 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
320 test $KILLSERVERS != no && kill -HUP $KILLPIDS
321 exit 0
324 echo "Search failed ($RC)!"
325 test $KILLSERVERS != no && kill -HUP $KILLPIDS
326 exit $RC
328 esac
330 BASEDN="o=Example,c=US"
331 echo " base=\"$BASEDN\"..."
332 echo "# base=\"$BASEDN\"..." >> $SEARCHOUT
333 $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" -M "$FILTER" '*' ref \
334 >> $SEARCHOUT 2>&1
335 RC=$?
336 #if test $RC != 0 ; then
337 # echo "Search failed ($RC)!"
338 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
339 # exit $RC
341 case $RC in
345 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
346 test $KILLSERVERS != no && kill -HUP $KILLPIDS
347 exit 0
350 echo "Search failed ($RC)!"
351 test $KILLSERVERS != no && kill -HUP $KILLPIDS
352 exit $RC
354 esac
356 BASEDN="o=Example,c=US"
357 FILTER="(seeAlso=cn=all staff,ou=Groups,$BASEDN)"
358 echo "Searching filter=\"$FILTER\""
359 echo " attrs=\"seeAlso\""
360 echo " base=\"$BASEDN\"..."
361 echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT
362 echo "# attrs=\"seeAlso\"" >> $SEARCHOUT
363 echo "# base=\"$BASEDN\"..." >> $SEARCHOUT
364 $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" "$FILTER" seeAlso \
365 >> $SEARCHOUT 2>&1
366 RC=$?
367 #if test $RC != 0 ; then
368 # echo "Search failed ($RC)!"
369 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
370 # exit $RC
372 case $RC in
376 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
377 test $KILLSERVERS != no && kill -HUP $KILLPIDS
378 exit 0
381 echo "Search failed ($RC)!"
382 test $KILLSERVERS != no && kill -HUP $KILLPIDS
383 exit $RC
385 esac
387 FILTER="(uid=example)"
388 echo "Searching filter=\"$FILTER\""
389 echo " attrs=\"uid\""
390 echo " base=\"$BASEDN\"..."
391 echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT
392 echo "# attrs=\"uid\"" >> $SEARCHOUT
393 echo "# base=\"$BASEDN\"..." >> $SEARCHOUT
394 $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" "$FILTER" uid \
395 >> $SEARCHOUT 2>&1
396 RC=$?
397 #if test $RC != 0 ; then
398 # echo "Search failed ($RC)!"
399 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
400 # exit $RC
402 case $RC in
406 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
407 test $KILLSERVERS != no && kill -HUP $KILLPIDS
408 exit 0
411 echo "Search failed ($RC)!"
412 test $KILLSERVERS != no && kill -HUP $KILLPIDS
413 exit $RC
415 esac
417 FILTER="(member=cn=Another Added Group,ou=Groups,$BASEDN)"
418 echo "Searching filter=\"$FILTER\""
419 echo " attrs=\"member\""
420 echo " base=\"$BASEDN\"..."
421 echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT
422 echo "# attrs=\"member\"" >> $SEARCHOUT
423 echo "# base=\"$BASEDN\"..." >> $SEARCHOUT
424 $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" "$FILTER" member \
425 >> $SEARCHOUT 2>&1
426 RC=$?
427 #if test $RC != 0 ; then
428 # echo "Search failed ($RC)!"
429 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
430 # exit $RC
432 case $RC in
436 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
437 test $KILLSERVERS != no && kill -HUP $KILLPIDS
438 exit 0
441 echo "Search failed ($RC)!"
442 test $KILLSERVERS != no && kill -HUP $KILLPIDS
443 exit $RC
445 esac
447 echo "Waiting 10 seconds for cached connections to timeout..."
448 sleep 10
450 echo "Searching with a timed out connection..."
451 echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT
452 echo "# attrs=\"member\"" >> $SEARCHOUT
453 echo "# base=\"$BASEDN\"" >> $SEARCHOUT
454 echo "# with a timed out connection..." >> $SEARCHOUT
455 $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -D "cn=Manager,$BASEDN" -w $PASSWD \
456 -b "$BASEDN" "$FILTER" member \
457 >> $SEARCHOUT 2>&1
458 RC=$?
459 #if test $RC != 0 ; then
460 # echo "Search failed ($RC)!"
461 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
462 # exit $RC
464 case $RC in
468 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
469 test $KILLSERVERS != no && kill -HUP $KILLPIDS
470 exit 0
473 echo "Search failed ($RC)!"
474 test $KILLSERVERS != no && kill -HUP $KILLPIDS
475 exit $RC
477 esac
479 # NOTE: cannot send to $SEARCHOUT because the returned entries
480 # are not predictable...
481 echo "Checking server-enforced size limit..."
482 echo "# Checking server-enforced size limit..." >> $SEARCHOUT
483 $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 \
484 -D "cn=Bjorn Jensen,ou=Information Technology Division,ou=People,$BASEDN" -w bjorn \
485 -b "$BASEDN" "(objectClass=*)" 1.1 \
486 >> $TESTOUT 2>&1
487 RC=$?
488 case $RC in
490 echo "Search should have failed ($RC)!"
491 test $KILLSERVERS != no && kill -HUP $KILLPIDS
492 exit -1
497 echo "Search failed ($RC)!"
498 test $KILLSERVERS != no && kill -HUP $KILLPIDS
499 exit $RC
501 esac
503 # NOTE: cannot send to $SEARCHOUT because the returned entries
504 # are not predictable...
505 echo "Checking client-requested size limit..."
506 echo "# Checking client-requested size limit..." >> $SEARCHOUT
507 $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 \
508 -D "cn=Bjorn Jensen,ou=Information Technology Division,ou=People,$BASEDN" -w bjorn \
509 -b "$BASEDN" -z 2 "(objectClass=*)" 1.1 \
510 >> $TESTOUT 2>&1
511 RC=$?
512 case $RC in
514 echo "Search should have failed ($RC)!"
515 test $KILLSERVERS != no && kill -HUP $KILLPIDS
516 exit -1
521 echo "Search failed ($RC)!"
522 test $KILLSERVERS != no && kill -HUP $KILLPIDS
523 exit $RC
525 esac
527 echo "Filtering ldapsearch results..."
528 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
529 echo "Filtering original ldif used to create database..."
530 . $LDIFFILTER < $METAOUT > $LDIFFLT
531 echo "Comparing filter output..."
532 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
534 if test $? != 0 ; then
535 echo "comparison failed - meta search/modification didn't succeed"
536 test $KILLSERVERS != no && kill -HUP $KILLPIDS
537 exit 1
540 # ITS#4458 needs patch to slapo-rwm for global rewriting of passwd_exop
541 BASEDN="o=Example,c=US"
542 echo "Changing password to database \"$BASEDN\"..."
543 $LDAPPASSWD -h $LOCALHOST -p $PORT3 -D "cn=Manager,$BASEDN" -w $PASSWD \
544 -s $PASSWD "cn=Ursula Hampster,ou=Alumni Association,ou=People,$BASEDN" \
545 >> $TESTOUT 2>&1
546 RC=$?
547 #if test $RC != 0 ; then
548 # echo "Passwd ExOp failed ($RC)!"
549 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
550 # exit $RC
552 case $RC in
555 # 51)
556 # echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
557 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
558 # exit 0
559 # ;;
560 # 80)
562 echo "Passwd ExOp failed ($RC)! ITS#4458?"
565 echo "Passwd ExOp failed ($RC)!"
566 test $KILLSERVERS != no && kill -HUP $KILLPIDS
567 exit $RC
569 esac
571 if test $RC = 0 ; then
572 echo "Binding with newly changed password to database \"$BASEDN\"..."
573 $LDAPWHOAMI -h $LOCALHOST -p $PORT3 \
574 -D "cn=Ursula Hampster,ou=Alumni Association,ou=People,$BASEDN" \
575 -w $PASSWD >> $TESTOUT 2>&1
576 RC=$?
577 #if test $RC != 0 ; then
578 # echo "WhoAmI failed ($RC)!"
579 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
580 # exit $RC
582 case $RC in
586 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
589 echo "WhoAmI failed ($RC)!"
590 test $KILLSERVERS != no && kill -HUP $KILLPIDS
591 exit $RC
593 esac
596 echo "Binding as newly added user to database \"$BASEDN\"..."
597 $LDAPWHOAMI -h $LOCALHOST -p $PORT3 \
598 -D "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
599 -w $PASSWD >> $TESTOUT 2>&1
600 RC=$?
601 #if test $RC != 0 ; then
602 # echo "WhoAmI failed ($RC)!"
603 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
604 # exit $RC
606 case $RC in
610 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
613 echo "WhoAmI failed ($RC)!"
614 test $KILLSERVERS != no && kill -HUP $KILLPIDS
615 exit $RC
617 esac
619 echo "Changing password to database \"$BASEDN\"..."
620 $LDAPPASSWD -h $LOCALHOST -p $PORT3 -D "cn=Manager,$BASEDN" -w $PASSWD \
621 -s meta "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
622 >> $TESTOUT 2>&1
623 RC=$?
624 #if test $RC != 0 ; then
625 # echo "Passwd ExOp failed ($RC)!"
626 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
627 # exit $RC
629 case $RC in
632 # 51)
633 # echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
634 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
635 # exit 0
636 # ;;
637 # 80)
639 echo "Passwd ExOp failed ($RC)! ITS#4458?"
642 echo "Passwd ExOp failed ($RC)!"
643 test $KILLSERVERS != no && kill -HUP $KILLPIDS
644 exit $RC
646 esac
648 if test $RC = 0 ; then
649 echo "Binding with newly changed password to database \"$BASEDN\"..."
650 $LDAPWHOAMI -h $LOCALHOST -p $PORT3 \
651 -D "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
652 -w meta >> $TESTOUT 2>&1
653 RC=$?
654 #if test $RC != 0 ; then
655 # echo "WhoAmI failed ($RC)!"
656 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
657 # exit $RC
659 case $RC in
663 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
666 echo "WhoAmI failed ($RC)!"
667 test $KILLSERVERS != no && kill -HUP $KILLPIDS
668 exit $RC
670 esac
673 echo "Binding with incorrect password to database \"$BASEDN\"..."
674 $LDAPWHOAMI -h $LOCALHOST -p $PORT3 \
675 -D "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
676 -w bogus >> $TESTOUT 2>&1
677 RC=$?
678 #if test $RC != 0 ; then
679 # echo "WhoAmI failed ($RC)!"
680 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
681 # exit $RC
683 case $RC in
685 echo "WhoAmI should have failed ($RC)!"
686 test $KILLSERVERS != no && kill -HUP $KILLPIDS
687 exit -1
690 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
694 esac
696 echo "Binding with non-existing user to database \"$BASEDN\"..."
697 $LDAPWHOAMI -h $LOCALHOST -p $PORT3 \
698 -D "cn=Non-existing User,ou=Same as above,ou=Meta,$BASEDN" \
699 -w bogus >> $TESTOUT 2>&1
700 RC=$?
701 #if test $RC != 0 ; then
702 # echo "WhoAmI failed ($RC)!"
703 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
704 # exit $RC
706 case $RC in
708 echo "WhoAmI should have failed ($RC)!"
709 test $KILLSERVERS != no && kill -HUP $KILLPIDS
710 exit -1
713 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
717 esac
719 echo "Comparing to database \"$BASEDN\"..."
720 $LDAPCOMPARE -h $LOCALHOST -p $PORT3 \
721 "cn=Another Added Group,ou=Groups,$BASEDN" \
722 "member:cn=Added Group,ou=Groups,$BASEDN" >> $TESTOUT 2>&1
723 RC=$?
724 #if test $RC != 6 ; then
725 # echo "Compare failed ($RC)!"
726 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
727 # exit -1
729 case $RC in
733 echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
736 echo "Compare failed ($RC)!"
737 test $KILLSERVERS != no && kill -HUP $KILLPIDS
738 exit $RC
740 esac
742 test $KILLSERVERS != no && kill -HUP $KILLPIDS
744 echo ">>>>> Test succeeded"
746 test $KILLSERVERS != no && wait
748 exit 0