X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tests%2Fscripts%2Ftest034-translucent;h=a7e47467dab86c6c42087a787e02be16620cc03f;hb=1adc0b9b1c39ac588adf22acf46f30e24b802682;hp=79eb72425db1c2d1a44998908d1758769eabbd53;hpb=94a11462a153f2715e147eb6d46ac52cae39ca4a;p=openldap diff --git a/tests/scripts/test034-translucent b/tests/scripts/test034-translucent index 79eb72425d..a7e47467da 100755 --- a/tests/scripts/test034-translucent +++ b/tests/scripts/test034-translucent @@ -2,7 +2,7 @@ # $OpenLDAP$ ## This work is part of OpenLDAP Software . ## -## Copyright 2004-2007 The OpenLDAP Foundation. +## Copyright 2004-2011 The OpenLDAP Foundation. ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without @@ -36,6 +36,12 @@ mkdir -p $TESTDIR $DBDIR1 $SLAPPASSWD -g -n >$CONFIGPWF echo "rootpw `$SLAPPASSWD -T $CONFIGPWF`" >$TESTDIR/configpw.conf +if test $MONITORDB != no ; then + DBIX=2 +else + DBIX=1 +fi + . $CONFFILTER $BACKEND $MONITORDB < $TRANSLUCENTREMOTECONF > $CONF1 echo "Running slapadd to build remote slapd database..." $SLAPADD -f $CONF1 -l $LDIFTRANSLUCENTCONFIG @@ -150,8 +156,8 @@ if test $RC != 0 ; then exit $RC fi -. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT -. $LDIFFILTER < $LDIFTRANSLUCENTDATA > $LDIFFLT +$LDIFFILTER < $SEARCHOUT > $SEARCHFLT +$LDIFFILTER < $LDIFTRANSLUCENTDATA > $LDIFFLT $CMP $SEARCHFLT $LDIFFLT > $CMPOUT if test $? != 0 ; then @@ -179,7 +185,7 @@ $LDAPADD -v -v -v -D "$TRANSLUCENTROOT" -H $URI2 \ -w $PASSWD < $LDIFTRANSLUCENTADD > $TESTOUT 2>&1 RC=$? -if test $RC != 32 ; then +if test $RC != 32 && test $RC,$BACKEND != 0,null ; then echo "ldapadd failed ($RC), expected NO SUCH OBJECT!" grep "$FAILURE" $TESTOUT test $KILLSERVERS != no && kill -HUP $KILLPIDS @@ -192,7 +198,7 @@ $LDAPMODRDN -D "$TRANSLUCENTROOT" -H $URI2 -w $PASSWD > \ $TESTOUT 2>&1 'uid=fred,ou=users,o=translucent' 'uid=someguy' RC=$? -if test $RC != 32 ; then +if test $RC != 32 && test $RC,$BACKEND != 0,null ; then echo "ldapmodrdn failed ($RC), expected NO SUCH OBJECT!" grep "$FAILURE" $TESTOUT test $KILLSERVERS != no && kill -HUP $KILLPIDS @@ -202,7 +208,7 @@ fi echo "Dynamically configuring local slapd without translucent_no_glue..." $LDAPMODIFY -D cn=config -H $URI2 -y $CONFIGPWF < $SEARCHFLT -$CMP $SEARCHFLT $LDIFTRANSLUCENTMERGED > $CMPOUT +$LDIFFILTER < $SEARCHOUT > $SEARCHFLT +$LDIFFILTER < $LDIFTRANSLUCENTMERGED > $LDIFFLT +$CMP $SEARCHFLT $LDIFFLT > $CMPOUT if test $? != 0 ; then echo "Comparison failed -- local data failed to merge with remote!" @@ -621,7 +628,7 @@ fi echo "Dynamically configuring local slapd with translucent_no_glue and translucent_strict..." $LDAPMODIFY -D cn=config -H $URI2 -y $CONFIGPWF < $SEARCHOUT 2>&1 + +ATTR=`grep dn: $SEARCHOUT` > $NOWHERE 2>&1 +if test -n "$ATTR" ; then + echo "got result $ATTR, should have been no result" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit 1 +fi + +echo "Dynamically configuring local slapd with translucent_local..." + +$LDAPMODIFY -D cn=config -H $URI2 -y $CONFIGPWF < $SEARCHOUT 2>&1 + +ATTR=`grep dn: $SEARCHOUT` > $NOWHERE 2>&1 +if test -z "$ATTR" ; then + echo "got no result, should have found entry" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit 1 +fi + +echo "Testing search: unconfigured remote filter..." +$LDAPSEARCH -H $URI2 -b "o=translucent" "(|(employeeType=foo)(carlicense=right))" > $SEARCHOUT 2>&1 + +ATTR=`grep dn: $SEARCHOUT` > $NOWHERE 2>&1 +if test -n "$ATTR" ; then + echo "got result $ATTR, should have been no result" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit 1 +fi + +echo "Dynamically configuring local slapd with translucent_remote..." + +$LDAPMODIFY -D cn=config -H $URI2 -y $CONFIGPWF < $SEARCHOUT 2>&1 + +ATTR=`grep dn: $SEARCHOUT` > $NOWHERE 2>&1 +if test -z "$ATTR" ; then + echo "got no result, should have found entry" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit 1 +fi + test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded"