3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 ## Copyright 2004-2012 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 PERSONAL="(objectClass=inetOrgPerson)"
21 FAILURE="additional info:"
23 if test $TRANSLUCENT = translucentno ; then
24 echo "Translucent Proxy overlay not available, test skipped"
28 if test $AC_ldap = ldapno ; then
29 echo "Translucent Proxy overlay requires back-ldap backend, test skipped"
34 mkdir -p $TESTDIR $DBDIR1
36 $SLAPPASSWD -g -n >$CONFIGPWF
37 echo "rootpw `$SLAPPASSWD -T $CONFIGPWF`" >$TESTDIR/configpw.conf
39 if test $MONITORDB != no ; then
45 . $CONFFILTER $BACKEND $MONITORDB < $TRANSLUCENTREMOTECONF > $CONF1
46 echo "Running slapadd to build remote slapd database..."
47 $SLAPADD -f $CONF1 -l $LDIFTRANSLUCENTCONFIG
49 if test $RC != 0 ; then
50 echo "slapadd failed ($RC)!"
54 echo "Starting remote slapd on TCP/IP port $PORT1..."
55 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
57 if test $WAIT != 0 ; then
66 for i in 0 1 2 3 4 5; do
67 $LDAPSEARCH -s base -b "$MONITOR" -H $URI1 \
68 'objectclass=*' > /dev/null 2>&1
70 if test $RC = 0 ; then
73 echo "Waiting 5 seconds for remote slapd to start..."
77 if test $RC != 0 ; then
78 echo "ldapsearch failed ($RC)!"
79 test $KILLSERVERS != no && kill -HUP $KILLPIDS
86 . $CONFFILTER $BACKEND $MONITORDB < $TRANSLUCENTLOCALCONF > $CONF2
88 echo "Starting local slapd on TCP/IP port $PORT2..."
89 $SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
91 if test $WAIT != 0 ; then
96 KILLPIDS="$LOCALPID $REMOTEPID"
100 for i in 0 1 2 3 4 5; do
101 $LDAPSEARCH -s base -b "$MONITOR" -H $URI2 \
102 'objectclass=*' > /dev/null 2>&1
104 if test $RC = 0 ; then
107 echo "Waiting 5 seconds for local slapd to start..."
111 if test $RC != 0 ; then
112 echo "ldapsearch failed ($RC)!"
113 test $KILLSERVERS != no && kill -HUP $KILLPIDS
117 echo "Testing slapd Translucent Proxy operations..."
119 echo "Testing search: no remote data defined..."
121 $LDAPSEARCH -H $URI2 -b "$TRANSLUCENTUSER" "$PERSONAL" >$SEARCHOUT 2>&1
124 if test $RC != 0 ; then
125 echo "ldapsearch failed ($RC)!"
126 test $KILLSERVERS != no && kill -HUP $KILLPIDS
130 if test -s $SEARCHOUT; then
131 echo "ldapsearch should have returned no records!"
132 test $KILLSERVERS != no && kill -HUP $KILLPIDS
136 echo "Populating remote database..."
138 $LDAPADD -D "$TRANSLUCENTROOT" -H $URI1 \
139 -w $PASSWD < $LDIFTRANSLUCENTDATA > $NOWHERE 2>&1
142 if test $RC != 0 ; then
143 echo "ldapadd failed ($RC)!"
144 test $KILLSERVERS != no && kill -HUP $KILLPIDS
148 echo "Testing search: remote database via local slapd..."
150 $LDAPSEARCH -H $URI2 -b "$TRANSLUCENTUSER" "$PERSONAL" > $SEARCHOUT 2>&1
153 if test $RC != 0 ; then
154 echo "ldapsearch failed ($RC)!"
155 test $KILLSERVERS != no && kill -HUP $KILLPIDS
159 $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
160 $LDIFFILTER < $LDIFTRANSLUCENTDATA > $LDIFFLT
161 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
163 if test $? != 0 ; then
164 echo "Comparison failed -- corruption from remote to local!"
165 test $KILLSERVERS != no && kill -HUP $KILLPIDS
169 echo "Testing add: prohibited local record..."
171 $LDAPADD -D "$TRANSLUCENTDN" -H $URI2 \
172 -w $TRANSLUCENTPASSWD < $LDIFTRANSLUCENTADD > $TESTOUT 2>&1
175 if test $RC != 50 ; then
176 echo "ldapadd failed ($RC), expected INSUFFICIENT ACCESS!"
177 grep "$FAILURE" $TESTOUT
178 test $KILLSERVERS != no && kill -HUP $KILLPIDS
182 echo "Testing add: valid local record, no_glue..."
184 $LDAPADD -v -v -v -D "$TRANSLUCENTROOT" -H $URI2 \
185 -w $PASSWD < $LDIFTRANSLUCENTADD > $TESTOUT 2>&1
188 if test $RC != 32 && test $RC,$BACKEND != 0,null ; then
189 echo "ldapadd failed ($RC), expected NO SUCH OBJECT!"
190 grep "$FAILURE" $TESTOUT
191 test $KILLSERVERS != no && kill -HUP $KILLPIDS
195 echo "Testing modrdn: valid local record, no_glue..."
197 $LDAPMODRDN -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
198 $TESTOUT 2>&1 'uid=fred,ou=users,o=translucent' 'uid=someguy'
201 if test $RC != 32 && test $RC,$BACKEND != 0,null ; then
202 echo "ldapmodrdn failed ($RC), expected NO SUCH OBJECT!"
203 grep "$FAILURE" $TESTOUT
204 test $KILLSERVERS != no && kill -HUP $KILLPIDS
208 echo "Dynamically configuring local slapd without translucent_no_glue..."
210 $LDAPMODIFY -D cn=config -H $URI2 -y $CONFIGPWF <<EOF
211 dn: olcOverlay={0}translucent,olcDatabase={$DBIX}$BACKEND,cn=config
213 replace: olcTranslucentNoGlue
214 olcTranslucentNoGlue: FALSE
217 if test $RC != 0 ; then
218 echo "ldapmodify of dynamic config failed ($RC)"
219 test $KILLSERVERS != no && kill -HUP $KILLPIDS
223 echo "Testing add: valid local record..."
225 $LDAPADD -D "$TRANSLUCENTROOT" -H $URI2 \
226 -w $PASSWD < $LDIFTRANSLUCENTADD > $TESTOUT 2>&1
229 if test $RC != 0 ; then
230 echo "ldapadd failed ($RC)!"
231 grep "$FAILURE" $TESTOUT
232 test $KILLSERVERS != no && kill -HUP $KILLPIDS
236 echo "Testing search: data merging..."
238 $LDAPSEARCH -H $URI2 -b "$TRANSLUCENTUSER" "$PERSONAL" > $SEARCHOUT 2>&1
241 if test $RC != 0 ; then
242 echo "ldapsearch failed ($RC)!"
243 test $KILLSERVERS != no && kill -HUP $KILLPIDS
247 $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
248 $LDIFFILTER < $LDIFTRANSLUCENTMERGED > $LDIFFLT
249 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
251 if test $? != 0 ; then
252 echo "Comparison failed -- local data failed to merge with remote!"
253 test $KILLSERVERS != no && kill -HUP $KILLPIDS
257 echo "Testing compare: valid local..."
259 $LDAPCOMPARE -z -H $URI2 -w $TRANSLUCENTPASSWD -D $TRANSLUCENTDN \
260 "uid=danger,ou=users,o=translucent" "carLicense:LIVID"
263 if test $RC != 6 ; then
264 echo "ldapcompare failed ($RC), expected TRUE!"
265 test $KILLSERVERS != no && kill -HUP $KILLPIDS
269 echo "Testing compare: valid remote..."
271 $LDAPCOMPARE -z -x -H $URI2 -w $TRANSLUCENTPASSWD -D $TRANSLUCENTDN \
272 "uid=binder,o=translucent" "businessCategory:binder-test-user"
275 if test $RC != 6 ; then
276 echo "ldapcompare failed ($RC), expected TRUE!"
277 test $KILLSERVERS != no && kill -HUP $KILLPIDS
281 echo "Testing compare: bogus local..."
283 $LDAPCOMPARE -z -x -H $URI2 -w $TRANSLUCENTPASSWD -D $TRANSLUCENTDN \
284 "uid=danger,ou=users,o=translucent" "businessCategory:invalid-test-value"
287 if test $RC != 5 ; then
288 echo "ldapcompare failed ($RC), expected FALSE!"
289 test $KILLSERVERS != no && kill -HUP $KILLPIDS
293 echo "Testing compare: bogus remote..."
295 $LDAPCOMPARE -z -x -H $URI2 -w $TRANSLUCENTPASSWD -D $TRANSLUCENTDN \
296 "uid=binder,o=translucent" "businessCategory:invalid-test-value"
299 if test $RC != 5 ; then
300 echo "ldapcompare failed ($RC), expected FALSE!"
301 test $KILLSERVERS != no && kill -HUP $KILLPIDS
305 echo "Testing modify: nonexistent record..."
307 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
308 $TESTOUT 2>&1 << EOF_MOD
310 dn: uid=bogus,ou=users,o=translucent
317 if test $RC != 32 ; then
318 echo "ldapmodify failed ($RC), expected NO SUCH OBJECT!"
319 grep "$FAILURE" $TESTOUT
320 test $KILLSERVERS != no && kill -HUP $KILLPIDS
324 echo "Testing modify: valid local record, nonexistent attribute..."
326 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
327 $TESTOUT 2>&1 << EOF_MOD1
329 dn: uid=danger,ou=users,o=translucent
336 if test $RC != 0 ; then
337 echo "ldapmodify failed ($RC)!"
338 grep "$FAILURE" $TESTOUT
339 test $KILLSERVERS != no && kill -HUP $KILLPIDS
343 $LDAPSEARCH -H $URI2 -b "uid=danger,ou=users,o=translucent" > $SEARCHOUT 2>&1
346 if test $RC != 0 ; then
347 echo "ldapsearch failed ($RC)!"
348 test $KILLSERVERS != no && kill -HUP $KILLPIDS
352 ATTR=`grep roomNumber $SEARCHOUT` > $NOWHERE 2>&1
353 if test "$ATTR" != "roomNumber: 9N-21" ; then
354 echo "modification failed!"
355 test $KILLSERVERS != no && kill -HUP $KILLPIDS
359 echo "Testing search: specific nonexistent remote attribute..."
361 $LDAPSEARCH -H $URI2 -b "uid=danger,ou=users,o=translucent" roomNumber > $SEARCHOUT 2>&1
364 if test $RC != 0 ; then
365 echo "ldapsearch failed ($RC)!"
366 test $KILLSERVERS != no && kill -HUP $KILLPIDS
370 echo "Testing modify: nonexistent local record, nonexistent attribute..."
372 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
373 $TESTOUT 2>&1 << EOF_MOD2
375 dn: uid=fred,ou=users,o=translucent
382 if test $RC != 0 ; then
383 echo "ldapmodify failed ($RC)!"
384 grep "$FAILURE" $TESTOUT
385 test $KILLSERVERS != no && kill -HUP $KILLPIDS
389 $LDAPSEARCH -H $URI2 -b "uid=fred,ou=users,o=translucent" > $SEARCHOUT 2>&1
392 if test $RC != 0 ; then
393 echo "ldapsearch failed ($RC)!"
394 test $KILLSERVERS != no && kill -HUP $KILLPIDS
398 ATTR=`grep roomNumber $SEARCHOUT` > $NOWHERE 2>&1
399 if test "$ATTR" != "roomNumber: 31J-2112" ; then
400 echo "modification failed!"
401 test $KILLSERVERS != no && kill -HUP $KILLPIDS
405 echo "Testing modify: valid remote record, nonexistent attribute..."
407 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
408 $TESTOUT 2>&1 << EOF_MOD9
410 dn: uid=fred,ou=users,o=translucent
412 delete: preferredLanguage
416 if test $RC != 16 ; then
417 echo "ldapmodify failed ($RC), expected NO SUCH ATTRIBUTE!"
418 grep "$FAILURE" $TESTOUT
419 test $KILLSERVERS != no && kill -HUP $KILLPIDS
423 echo "Testing delete: valid local record, nonexistent attribute..."
425 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
426 $TESTOUT 2>&1 << EOF_MOD4
428 dn: uid=fred,ou=users,o=translucent
434 if test $RC != 0 ; then
435 echo "ldapmodify failed ($RC)!"
436 grep "$FAILURE" $TESTOUT
437 test $KILLSERVERS != no && kill -HUP $KILLPIDS
441 echo "Testing modrdn: prohibited local record..."
443 $LDAPMODRDN -D "$TRANSLUCENTDN" -H $URI2 -w $TRANSLUCENTPASSWD > \
444 $TESTOUT 2>&1 'uid=fred,ou=users,o=translucent' 'uid=someguy'
447 if test $RC != 50 ; then
448 echo "ldapmodrdn failed ($RC), expected INSUFFICIENT ACCESS!"
449 grep "$FAILURE" $TESTOUT
450 test $KILLSERVERS != no && kill -HUP $KILLPIDS
454 echo "Testing modrdn: valid local record..."
456 $LDAPMODRDN -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
457 $TESTOUT 2>&1 'uid=fred,ou=users,o=translucent' 'uid=someguy'
460 if test $RC != 0 ; then
461 echo "ldapmodrdn failed ($RC)!"
462 grep "$FAILURE" $TESTOUT
463 test $KILLSERVERS != no && kill -HUP $KILLPIDS
467 echo "Testing delete: prohibited local record..."
469 $LDAPMODIFY -v -D "$TRANSLUCENTDN" -H $URI2 -w $TRANSLUCENTPASSWD > \
470 $TESTOUT 2>&1 << EOF_DEL2
472 dn: uid=someguy,ou=users,o=translucent
477 if test $RC != 50 ; then
478 echo "ldapadd failed ($RC), expected INSUFFICIENT ACCESS!"
479 grep "$FAILURE" $TESTOUT
480 test $KILLSERVERS != no && kill -HUP $KILLPIDS
484 echo "Testing delete: valid local record..."
486 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
487 $TESTOUT 2>&1 << EOF_DEL3
489 dn: uid=someguy,ou=users,o=translucent
494 if test $RC != 0 ; then
495 echo "ldapmodify failed ($RC)!"
496 grep "$FAILURE" $TESTOUT
497 test $KILLSERVERS != no && kill -HUP $KILLPIDS
501 echo "Testing delete: valid remote record..."
503 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
504 $TESTOUT 2>&1 << EOF_DEL8
506 dn: uid=fred,ou=users,o=translucent
511 if test $RC != 32 ; then
512 echo "ldapmodify failed ($RC), expected NO SUCH OBJECT!"
513 grep "$FAILURE" $TESTOUT
514 test $KILLSERVERS != no && kill -HUP $KILLPIDS
518 echo "Testing delete: nonexistent local record, nonexistent attribute..."
520 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
521 $TESTOUT 2>&1 << EOF_DEL1
523 dn: uid=fred,ou=users,o=translucent
529 if test $RC != 0 ; then
530 echo "ldapmodify failed ($RC)!"
531 grep "$FAILURE" $TESTOUT
532 test $KILLSERVERS != no && kill -HUP $KILLPIDS
536 $LDAPSEARCH -H $URI2 -b "uid=fred,ou=users,o=translucent" > $SEARCHOUT 2>&1
539 if test $RC != 0 ; then
540 echo "ldapsearch failed ($RC)!"
541 test $KILLSERVERS != no && kill -HUP $KILLPIDS
545 echo "Testing delete: valid local record, nonexistent attribute..."
547 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
548 $TESTOUT 2>&1 << EOF_MOD8
550 dn: uid=danger,ou=users,o=translucent
552 delete: preferredLanguage
556 if test $RC != 16 ; then
557 echo "ldapmodify failed ($RC), expected NO SUCH ATTRIBUTE!"
558 grep "$FAILURE" $TESTOUT
559 test $KILLSERVERS != no && kill -HUP $KILLPIDS
563 echo "Testing delete: valid local record, remote attribute..."
565 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
566 $TESTOUT 2>&1 << EOF_MOD8
568 dn: uid=danger,ou=users,o=translucent
574 if test $RC != 0 ; then
575 echo "ldapmodify failed ($RC)"
576 grep "$FAILURE" $TESTOUT
577 test $KILLSERVERS != no && kill -HUP $KILLPIDS
581 echo "Testing modify: valid remote record, combination add-modify-delete..."
583 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
584 $TESTOUT 2>&1 << EOF_MOD6
586 dn: uid=fred,ou=users,o=translucent
590 add: preferredLanguage
591 preferredLanguage: ISO8859-1
593 replace: employeeType
594 employeeType: consultant
598 if test $RC != 0 ; then
599 echo "ldapmodify failed ($RC)!"
600 grep "$FAILURE" $TESTOUT
601 test $KILLSERVERS != no && kill -HUP $KILLPIDS
605 $LDAPSEARCH -H $URI2 -b "uid=fred,ou=users,o=translucent" > $SEARCHOUT 2>&1
608 if test $RC != 0 ; then
609 echo "ldapsearch failed ($RC)!"
610 test $KILLSERVERS != no && kill -HUP $KILLPIDS
614 ATTR=`grep employeeType $SEARCHOUT` > $NOWHERE 2>&1
615 if test "$ATTR" != "employeeType: consultant" ; then
616 echo "modification failed!"
617 test $KILLSERVERS != no && kill -HUP $KILLPIDS
621 ATTR=`grep preferredLanguage $SEARCHOUT` > $NOWHERE 2>&1
622 if test "$ATTR" != "preferredLanguage: ISO8859-1" ; then
623 echo "modification failed!"
624 test $KILLSERVERS != no && kill -HUP $KILLPIDS
628 echo "Dynamically configuring local slapd with translucent_no_glue and translucent_strict..."
630 $LDAPMODIFY -D cn=config -H $URI2 -y $CONFIGPWF <<EOF
631 dn: olcOverlay={0}translucent,olcDatabase={$DBIX}$BACKEND,cn=config
633 replace: olcTranslucentNoGlue
634 olcTranslucentNoGlue: TRUE
636 replace: olcTranslucentStrict
637 olcTranslucentStrict: TRUE
640 if test $RC != 0 ; then
641 echo "ldapmodify of dynamic config failed ($RC)"
642 test $KILLSERVERS != no && kill -HUP $KILLPIDS
646 echo "Testing strict mode delete: nonexistent local attribute..."
648 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
649 $TESTOUT 2>&1 << EOF_MOD5
651 dn: uid=example,ou=users,o=translucent
653 delete: preferredLanguage
657 if test $RC != 19 ; then
658 echo "ldapmodify failed ($RC), expected CONSTRAINT VIOLATION!"
659 grep "$FAILURE" $TESTOUT
660 test $KILLSERVERS != no && kill -HUP $KILLPIDS
664 echo "Testing strict mode delete: nonexistent remote attribute..."
666 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
667 $TESTOUT 2>&1 << EOF_MOD3
669 dn: uid=danger,ou=users,o=translucent
675 if test $RC != 19 ; then
676 echo "ldapmodify failed ($RC), expected CONSTRAINT VIOLATION!"
677 grep "$FAILURE" $TESTOUT
678 test $KILLSERVERS != no && kill -HUP $KILLPIDS
682 echo "Testing strict mode modify: combination add-modify-delete..."
684 $LDAPMODIFY -v -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \
685 $TESTOUT 2>&1 << EOF_MOD6
687 dn: uid=example,ou=users,o=translucent
691 add: preferredLanguage
692 preferredLanguage: ISO8859-1
694 replace: employeeType
695 employeeType: consultant
699 if test $RC != 19 ; then
700 echo "ldapmodify failed ($RC), expected CONSTRAINT VIOLATION!"
701 grep "$FAILURE" $TESTOUT
702 test $KILLSERVERS != no && kill -HUP $KILLPIDS
706 echo "Testing invalid Bind request..."
707 $LDAPWHOAMI -D "$TRANSLUCENTDN" -H $URI2 -w Wrong"$TRANSLUCENTPASSWD" > \
710 if test $RC != 49 ; then
711 echo "ldapwhoami failed ($RC), expected INVALID CREDENTIALS!"
712 grep "$FAILURE" $TESTOUT
713 test $KILLSERVERS != no && kill -HUP $KILLPIDS
717 $LDAPWHOAMI -D "$TRANSLUCENTDN" -H $URI2 -w "$TRANSLUCENTPASSWD" > \
720 if test $RC != 0 ; then
721 echo "ldapwhoami failed ($RC), expected SUCCESS!"
722 grep "$FAILURE" $TESTOUT
723 test $KILLSERVERS != no && kill -HUP $KILLPIDS
727 echo "Testing search: unconfigured local filter..."
728 $LDAPSEARCH -H $URI2 -b "o=translucent" "(employeeType=consultant)" > $SEARCHOUT 2>&1
730 ATTR=`grep dn: $SEARCHOUT` > $NOWHERE 2>&1
731 if test -n "$ATTR" ; then
732 echo "got result $ATTR, should have been no result"
733 test $KILLSERVERS != no && kill -HUP $KILLPIDS
737 echo "Dynamically configuring local slapd with translucent_local..."
739 $LDAPMODIFY -D cn=config -H $URI2 -y $CONFIGPWF <<EOF
740 dn: olcOverlay={0}translucent,olcDatabase={$DBIX}$BACKEND,cn=config
742 add: olcTranslucentLocal
743 olcTranslucentLocal: employeeType
746 if test $RC != 0 ; then
747 echo "ldapmodify of dynamic config failed ($RC)"
748 test $KILLSERVERS != no && kill -HUP $KILLPIDS
752 echo "Testing search: configured local filter..."
753 $LDAPSEARCH -H $URI2 -b "o=translucent" "(employeeType=consultant)" > $SEARCHOUT 2>&1
755 ATTR=`grep dn: $SEARCHOUT` > $NOWHERE 2>&1
756 if test -z "$ATTR" ; then
757 echo "got no result, should have found entry"
758 test $KILLSERVERS != no && kill -HUP $KILLPIDS
762 echo "Testing search: unconfigured remote filter..."
763 $LDAPSEARCH -H $URI2 -b "o=translucent" "(|(employeeType=foo)(carlicense=right))" > $SEARCHOUT 2>&1
765 ATTR=`grep dn: $SEARCHOUT` > $NOWHERE 2>&1
766 if test -n "$ATTR" ; then
767 echo "got result $ATTR, should have been no result"
768 test $KILLSERVERS != no && kill -HUP $KILLPIDS
772 echo "Dynamically configuring local slapd with translucent_remote..."
774 $LDAPMODIFY -D cn=config -H $URI2 -y $CONFIGPWF <<EOF
775 dn: olcOverlay={0}translucent,olcDatabase={$DBIX}$BACKEND,cn=config
777 add: olcTranslucentRemote
778 olcTranslucentRemote: carLicense
781 if test $RC != 0 ; then
782 echo "ldapmodify of dynamic config failed ($RC)"
783 test $KILLSERVERS != no && kill -HUP $KILLPIDS
787 echo "Testing search: configured remote filter..."
788 $LDAPSEARCH -H $URI2 -b "o=translucent" "(|(employeeType=foo)(carlicense=right))" > $SEARCHOUT 2>&1
790 ATTR=`grep dn: $SEARCHOUT` > $NOWHERE 2>&1
791 if test -z "$ATTR" ; then
792 echo "got no result, should have found entry"
793 test $KILLSERVERS != no && kill -HUP $KILLPIDS
797 test $KILLSERVERS != no && kill -HUP $KILLPIDS
799 echo ">>>>> Test succeeded"
801 test $KILLSERVERS != no && wait