Debian Codegraph @

tests/scripts/test035-meta

raw symbols SCIP
1 #! /bin/shscip-shell filesystem . . `/bin/sh`.
2 # $OpenLDAP$
3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 ##
5 ## Copyright 1998-2024 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 echoscip-shell system . . echo. "running defines.sh"
17 . $SRCDIR/scripts/defines.sh
18
19 echoscip-shell system . . echo. ""
20
21 if testscip-shell system . . test. $BACKMETA = metano ; then
22 echoscip-shell system . . echo. "meta backend not available, test skipped"
23 exit 0
24 fi
25
26 if testscip-shell system . . test. $BACKLDAP = ldapno ; then
27 echoscip-shell system . . echo. "ldap backend not available, test skipped"
28 exit 0
29 fi
30
31 rmscip-shell system . . rm. -rf $TESTDIR
32
33 mkdirscip-shell system . . mkdir. -p $TESTDIR $DBDIR1 $DBDIR2
34
35 echoscip-shell system . . echo. "Starting slapd on TCP/IP port $PORT1..."
36 . $CONFFILTER $BACKEND < $METACONF1 > $CONF1
37 $SLAPD -f $CONF1 -h $URI1 -d $LVL > $LOG1 2>&1 &
38 PID=$!
39 if testscip-shell system . . test. $WAIT != 0 ; then
40 echoscip-shell system . . echo. PID $PID
41 read foo
42 fi
43 KILLPIDS="$PID"
44
45 sleepscip-shell system . . sleep. 1
46
47 echoscip-shell system . . 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 $URI1 \
50 'objectclass=*' > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1
51 RC=$?
52 if testscip-shell system . . test. $RC = 0 ; then
53 break
54 fi
55 echoscip-shell system . . echo. "Waiting 5 seconds for slapd to start..."
56 sleepscip-shell system . . sleep. 5
57 done
58 if testscip-shell system . . test. $RC != 0 ; then
59 echoscip-shell system . . echo. "ldapsearch failed ($RC)!"
60 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
61 exit $RC
62 fi
63
64 echoscip-shell system . . echo. "Using ldapadd to populate the database..."
65 $LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD < \
66 $LDIFORDERED > $TESTOUT 2>&1
67 RC=$?
68 if testscip-shell system . . test. $RC != 0 ; then
69 echoscip-shell system . . echo. "ldapadd failed ($RC)!"
70 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
71 exit $RC
72 fi
73
74 echoscip-shell system . . echo. "Starting slapd on TCP/IP port $PORT2..."
75 . $CONFFILTER $BACKEND < $METACONF2 > $CONF2
76 $SLAPD -f $CONF2 -h $URI2 -d $LVL > $LOG2 2>&1 &
77 PID=$!
78 if testscip-shell system . . test. $WAIT != 0 ; then
79 echoscip-shell system . . echo. PID $PID
80 read foo
81 fi
82 KILLPIDS="$KILLPIDS $PID"
83
84 sleepscip-shell system . . sleep. 1
85
86 echoscip-shell system . . 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 $URI2 \
89 'objectclass=*' > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1
90 RC=$?
91 if testscip-shell system . . test. $RC = 0 ; then
92 break
93 fi
94 echoscip-shell system . . echo. "Waiting 5 seconds for slapd to start..."
95 sleepscip-shell system . . sleep. 5
96 done
97 if testscip-shell system . . test. $RC != 0 ; then
98 echoscip-shell system . . echo. "ldapsearch failed ($RC)!"
99 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
100 exit $RC
101 fi
102
103 echoscip-shell system . . echo. "Using ldapadd to populate the database..."
104 $LDAPADD -D "$METAMANAGERDN" -H $URI2 -w $PASSWD < \
105 $LDIFMETA >> $TESTOUT 2>&1
106 RC=$?
107 if testscip-shell system . . test. $RC != 0 ; then
108 echoscip-shell system . . echo. "ldapadd failed ($RC)!"
109 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
110 exit $RC
111 fi
112
113 echoscip-shell system . . echo. "Starting slapd on TCP/IP port $PORT3..."
114 . $CONFFILTER $BACKEND < $METACONF > $CONF3
115 $SLAPD -f $CONF3 -h $URI3 -d $LVL > $LOG3 2>&1 &
116 PID=$!
117 if testscip-shell system . . test. $WAIT != 0 ; then
118 echoscip-shell system . . echo. PID $PID
119 read foo
120 fi
121 KILLPIDS="$KILLPIDS $PID"
122
123 sleepscip-shell system . . sleep. 1
124
125 echoscip-shell system . . 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 $URI3 \
128 'objectclass=*' > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1
129 RC=$?
130 if testscip-shell system . . test. $RC = 0 ; then
131 break
132 fi
133 echoscip-shell system . . echo. "Waiting 5 seconds for slapd to start..."
134 sleepscip-shell system . . sleep. 5
135 done
136 if testscip-shell system . . test. $RC != 0 ; then
137 echoscip-shell system . . echo. "ldapsearch failed ($RC)!"
138 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
139 exit $RC
140 fi
141
142 catscip-shell system . . cat. /dev/nullscip-shell filesystem . . `/dev/null`. > $SEARCHOUT
143
144 BASEDN="o=Example,c=US"
145 echoscip-shell system . . echo. "Searching base=\"$BASEDN\"..."
146 echoscip-shell system . . echo. "# searching base=\"$BASEDN\"..." >> $SEARCHOUT
147 $LDAPSEARCH -S "" -H $URI3 -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
153 #fi
154 case $RC in
155 0)
156 ;;
157 51)
158 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
159 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
160 exit 0
161 ;;
162 *)
163 echoscip-shell system . . echo. "Search failed ($RC)!"
164 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
165 exit $RC
166 ;;
167 esac
168
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 echoscip-shell system . . echo. "Searching base=\"$BASEDN\"..."
173 echoscip-shell system . . echo. "# searching base=\"$BASEDN\"..." >> $SEARCHOUT
174 $LDAPSEARCH -S "" -H $URI3 -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
180 #fi
181 case $RC in
182 0)
183 ;;
184 51)
185 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
186 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
187 exit 0
188 ;;
189 *)
190 echoscip-shell system . . echo. "Search failed ($RC)!"
191 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
192 exit $RC
193 ;;
194 esac
195
196 #
197 # Do some modifications
198 #
199
200 BASEDN="o=Example,c=US"
201 echoscip-shell system . . echo. "Modifying database \"$BASEDN\"..."
202 $LDAPMODIFY -v -D "cn=Manager,$BASEDN" -H $URI3 -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
212
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
219
220 dn: cn=Another Added Group,ou=Groups,$BASEDN
221 changetype: modify
222 add: objectClass
223 objectClass: uidObject
224 -
225 add: uid
226 uid: added
227 -
228
229 dn: cn=Added Group,ou=Groups,$BASEDN
230 changetype: modify
231 delete: objectClass
232 objectClass: uidObject
233 -
234 delete: uid
235 -
236
237 dn: ou=Meta,$BASEDN
238 changetype: modify
239 add: description
240 description: added to "ou=Meta,$BASEDN"
241 -
242
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
249
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
256
257 dn: ou=Who's going to handle this?,$BASEDN
258 changetype: delete
259
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
266
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
273
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
280
281 dn: ou=Who's going to handle this?,ou=Meta,$BASEDN
282 changetype: delete
283 EOMODS
284
285 RC=$?
286 #if test $RC != 0 ; then
287 # echo "Modify failed ($RC)!"
288 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
289 # exit $RC
290 #fi
291 case $RC in
292 0)
293 ;;
294 51)
295 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
296 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
297 exit 0
298 ;;
299 *)
300 echoscip-shell system . . echo. "Modify failed ($RC)!"
301 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
302 exit $RC
303 ;;
304 esac
305
306 echoscip-shell system . . echo. "Searching base=\"$BASEDN\"..."
307 echoscip-shell system . . echo. "# searching base=\"$BASEDN\"..." >> $SEARCHOUT
308 $LDAPSEARCH -S "" -H $URI3 -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
314 #fi
315 case $RC in
316 0)
317 ;;
318 51)
319 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
320 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
321 exit 0
322 ;;
323 *)
324 echoscip-shell system . . echo. "Search failed ($RC)!"
325 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
326 exit $RC
327 ;;
328 esac
329
330 BASEDN="o=Example,c=US"
331 echoscip-shell system . . echo. " base=\"$BASEDN\"..."
332 echoscip-shell system . . echo. "# base=\"$BASEDN\"..." >> $SEARCHOUT
333 $LDAPSEARCH -S "" -H $URI3 -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
340 #fi
341 case $RC in
342 0)
343 ;;
344 51)
345 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
346 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
347 exit 0
348 ;;
349 *)
350 echoscip-shell system . . echo. "Search failed ($RC)!"
351 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
352 exit $RC
353 ;;
354 esac
355
356 BASEDN="o=Example,c=US"
357 FILTER="(seeAlso=cn=all staff,ou=Groups,$BASEDN)"
358 echoscip-shell system . . echo. "Searching filter=\"$FILTER\""
359 echoscip-shell system . . echo. " attrs=\"seeAlso\""
360 echoscip-shell system . . echo. " base=\"$BASEDN\"..."
361 echoscip-shell system . . echo. "# searching filter=\"$FILTER\"" >> $SEARCHOUT
362 echoscip-shell system . . echo. "# attrs=\"seeAlso\"" >> $SEARCHOUT
363 echoscip-shell system . . echo. "# base=\"$BASEDN\"..." >> $SEARCHOUT
364 $LDAPSEARCH -S "" -H $URI3 -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
371 #fi
372 case $RC in
373 0)
374 ;;
375 51)
376 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
377 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
378 exit 0
379 ;;
380 *)
381 echoscip-shell system . . echo. "Search failed ($RC)!"
382 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
383 exit $RC
384 ;;
385 esac
386
387 FILTER="(uid=example)"
388 echoscip-shell system . . echo. "Searching filter=\"$FILTER\""
389 echoscip-shell system . . echo. " attrs=\"uid\""
390 echoscip-shell system . . echo. " base=\"$BASEDN\"..."
391 echoscip-shell system . . echo. "# searching filter=\"$FILTER\"" >> $SEARCHOUT
392 echoscip-shell system . . echo. "# attrs=\"uid\"" >> $SEARCHOUT
393 echoscip-shell system . . echo. "# base=\"$BASEDN\"..." >> $SEARCHOUT
394 $LDAPSEARCH -S "" -H $URI3 -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
401 #fi
402 case $RC in
403 0)
404 ;;
405 51)
406 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
407 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
408 exit 0
409 ;;
410 *)
411 echoscip-shell system . . echo. "Search failed ($RC)!"
412 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
413 exit $RC
414 ;;
415 esac
416
417 FILTER="(member=cn=Another Added Group,ou=Groups,$BASEDN)"
418 echoscip-shell system . . echo. "Searching filter=\"$FILTER\""
419 echoscip-shell system . . echo. " attrs=\"member\""
420 echoscip-shell system . . echo. " base=\"$BASEDN\"..."
421 echoscip-shell system . . echo. "# searching filter=\"$FILTER\"" >> $SEARCHOUT
422 echoscip-shell system . . echo. "# attrs=\"member\"" >> $SEARCHOUT
423 echoscip-shell system . . echo. "# base=\"$BASEDN\"..." >> $SEARCHOUT
424 $LDAPSEARCH -S "" -H $URI3 -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
431 #fi
432 case $RC in
433 0)
434 ;;
435 51)
436 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
437 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
438 exit 0
439 ;;
440 *)
441 echoscip-shell system . . echo. "Search failed ($RC)!"
442 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
443 exit $RC
444 ;;
445 esac
446
447 echoscip-shell system . . echo. "Waiting 10 seconds for cached connections to timeout..."
448 sleepscip-shell system . . sleep. 10
449
450 echoscip-shell system . . echo. "Searching with a timed out connection..."
451 echoscip-shell system . . echo. "# searching filter=\"$FILTER\"" >> $SEARCHOUT
452 echoscip-shell system . . echo. "# attrs=\"member\"" >> $SEARCHOUT
453 echoscip-shell system . . echo. "# base=\"$BASEDN\"" >> $SEARCHOUT
454 echoscip-shell system . . echo. "# with a timed out connection..." >> $SEARCHOUT
455 $LDAPSEARCH -S "" -H $URI3 -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
463 #fi
464 case $RC in
465 0)
466 ;;
467 51)
468 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
469 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
470 exit 0
471 ;;
472 *)
473 echoscip-shell system . . echo. "Search failed ($RC)!"
474 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
475 exit $RC
476 ;;
477 esac
478
479 # NOTE: cannot send to $SEARCHOUT because the returned entries
480 # are not predictable...
481 echoscip-shell system . . echo. "Checking server-enforced size limit..."
482 echoscip-shell system . . echo. "# Checking server-enforced size limit..." >> $SEARCHOUT
483 $LDAPSEARCH -S "" -H $URI3 \
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,$BACKEND in
489 4,* | 0,null)
490 ;;
491 0,*)
492 echoscip-shell system . . echo. "Search should have failed ($RC)!"
493 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
494 exit 1
495 ;;
496 *)
497 echoscip-shell system . . echo. "Search failed ($RC)!"
498 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
499 exit $RC
500 ;;
501 esac
502
503 # NOTE: cannot send to $SEARCHOUT because the returned entries
504 # are not predictable...
505 echoscip-shell system . . echo. "Checking client-requested size limit..."
506 echoscip-shell system . . echo. "# Checking client-requested size limit..." >> $SEARCHOUT
507 $LDAPSEARCH -S "" -H $URI3 \
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,$BACKEND in
513 4,* | 0,null)
514 ;;
515 0,*)
516 echoscip-shell system . . echo. "Search should have failed ($RC)!"
517 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
518 exit 1
519 ;;
520 *)
521 echoscip-shell system . . echo. "Search failed ($RC)!"
522 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
523 exit $RC
524 ;;
525 esac
526
527 echoscip-shell system . . echo. "Filtering ldapsearch results..."
528 $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
529 echoscip-shell system . . echo. "Filtering original ldif used to create database..."
530 $LDIFFILTER < $METAOUT > $LDIFFLT
531 echoscip-shell system . . echo. "Comparing filter output..."
532 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
533
534 if testscip-shell system . . test. $? != 0 ; then
535 echoscip-shell system . . echo. "comparison failed - meta search/modification didn't succeed"
536 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
537 exit 1
538 fi
539
540 BASEDN="o=Example,c=US"
541 echoscip-shell system . . echo. "Changing password to database \"$BASEDN\"..."
542 $LDAPPASSWD -H $URI3 -D "cn=Manager,$BASEDN" -w $PASSWD \
543 -s $PASSWD "cn=Ursula Hampster,ou=Alumni Association,ou=People,$BASEDN" \
544 >> $TESTOUT 2>&1
545 RC=$?
546 #if test $RC != 0 ; then
547 # echo "Passwd ExOp failed ($RC)!"
548 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
549 # exit $RC
550 #fi
551 case $RC in
552 0)
553 ;;
554 51)
555 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
556 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
557 exit 0
558 ;;
559 *)
560 echoscip-shell system . . echo. "Passwd ExOp failed ($RC)!"
561 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
562 exit $RC
563 ;;
564 esac
565
566 echoscip-shell system . . echo. "Binding with newly changed password to database \"$BASEDN\"..."
567 $LDAPWHOAMI -H $URI3 \
568 -D "cn=Ursula Hampster,ou=Alumni Association,ou=People,$BASEDN" \
569 -w $PASSWD >> $TESTOUT 2>&1
570 RC=$?
571 #if test $RC != 0 ; then
572 # echo "WhoAmI failed ($RC)!"
573 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
574 # exit $RC
575 #fi
576 case $RC in
577 0)
578 ;;
579 51)
580 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
581 ;;
582 *)
583 echoscip-shell system . . echo. "WhoAmI failed ($RC)!"
584 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
585 exit $RC
586 ;;
587 esac
588
589 echoscip-shell system . . echo. "Binding as newly added user to database \"$BASEDN\"..."
590 $LDAPWHOAMI -H $URI3 \
591 -D "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
592 -w $PASSWD >> $TESTOUT 2>&1
593 RC=$?
594 #if test $RC != 0 ; then
595 # echo "WhoAmI failed ($RC)!"
596 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
597 # exit $RC
598 #fi
599 case $RC in
600 0)
601 ;;
602 51)
603 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
604 ;;
605 *)
606 echoscip-shell system . . echo. "WhoAmI failed ($RC)!"
607 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
608 exit $RC
609 ;;
610 esac
611
612 echoscip-shell system . . echo. "Changing password to database \"$BASEDN\"..."
613 $LDAPPASSWD -H $URI3 -D "cn=Manager,$BASEDN" -w $PASSWD \
614 -s meta "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
615 >> $TESTOUT 2>&1
616 RC=$?
617 #if test $RC != 0 ; then
618 # echo "Passwd ExOp failed ($RC)!"
619 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
620 # exit $RC
621 #fi
622 case $RC in
623 0)
624 ;;
625 51)
626 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
627 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
628 exit 0
629 ;;
630 *)
631 echoscip-shell system . . echo. "Passwd ExOp failed ($RC)!"
632 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
633 exit $RC
634 ;;
635 esac
636
637 echoscip-shell system . . echo. "Binding with newly changed password to database \"$BASEDN\"..."
638 $LDAPWHOAMI -H $URI3 \
639 -D "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
640 -w meta >> $TESTOUT 2>&1
641 RC=$?
642 #if test $RC != 0 ; then
643 # echo "WhoAmI failed ($RC)!"
644 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
645 # exit $RC
646 #fi
647 case $RC in
648 0)
649 ;;
650 51)
651 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
652 ;;
653 *)
654 echoscip-shell system . . echo. "WhoAmI failed ($RC)!"
655 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
656 exit $RC
657 ;;
658 esac
659
660 echoscip-shell system . . echo. "Binding with incorrect password to database \"$BASEDN\"..."
661 $LDAPWHOAMI -H $URI3 \
662 -D "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
663 -w bogus >> $TESTOUT 2>&1
664 RC=$?
665 #if test $RC != 0 ; then
666 # echo "WhoAmI failed ($RC)!"
667 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
668 # exit $RC
669 #fi
670 case $RC,$BACKEND in
671 0,null)
672 ;;
673 0,*)
674 echoscip-shell system . . echo. "WhoAmI should have failed ($RC)!"
675 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
676 exit 1
677 ;;
678 51,*)
679 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
680 ;;
681 *)
682 ;;
683 esac
684
685 echoscip-shell system . . echo. "Binding with non-existing user to database \"$BASEDN\"..."
686 $LDAPWHOAMI -H $URI3 \
687 -D "cn=Non-existing User,ou=Same as above,ou=Meta,$BASEDN" \
688 -w bogus >> $TESTOUT 2>&1
689 RC=$?
690 #if test $RC != 0 ; then
691 # echo "WhoAmI failed ($RC)!"
692 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
693 # exit $RC
694 #fi
695 case $RC,$BACKEND in
696 0,null)
697 ;;
698 0,*)
699 echoscip-shell system . . echo. "WhoAmI should have failed ($RC)!"
700 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
701 exit 1
702 ;;
703 51,*)
704 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
705 ;;
706 *)
707 ;;
708 esac
709
710 echoscip-shell system . . echo. "Comparing to database \"$BASEDN\"..."
711 $LDAPCOMPARE -H $URI3 \
712 "cn=Another Added Group,ou=Groups,$BASEDN" \
713 "member:cn=Added Group,ou=Groups,$BASEDN" >> $TESTOUT 2>&1
714 RC=$?
715 #if test $RC != 6 ; then
716 # echo "Compare failed ($RC)!"
717 # test $KILLSERVERS != no && kill -HUP $KILLPIDS
718 # exit 1
719 #fi
720 case $RC,$BACKEND in
721 6,* | 5,null)
722 ;;
723 51,*)
724 echoscip-shell system . . echo. "### Hit LDAP_BUSY problem; you may want to re-run the test"
725 ;;
726 *)
727 echoscip-shell system . . echo. "Compare failed ($RC)!"
728 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
729 exit 1
730 ;;
731 esac
732
733 testscip-shell system . . test. $KILLSERVERS != no && killscip-shell system . . kill. -HUP $KILLPIDS
734
735 echoscip-shell system . . echo. ">>>>> Test succeeded"
736
737 testscip-shell system . . test. $KILLSERVERS != no && wait
738
739 exit 0