mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
Add tests for ITS#5283
This commit is contained in:
parent
3a7830ff01
commit
ebc16e5e66
1 changed files with 70 additions and 0 deletions
|
|
@ -723,6 +723,76 @@ if test $RC != 0 ; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo "Testing search: unconfigured local filter..."
|
||||
$LDAPSEARCH -H $URI2 -b "o=translucent" "(employeeType=consultant)" > $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 <<EOF
|
||||
dn: olcOverlay={0}translucent,olcDatabase={$DBIX}$BACKEND,cn=config
|
||||
changetype: modify
|
||||
add: olcTranslucentLocal
|
||||
olcTranslucentLocal: employeeType
|
||||
EOF
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapmodify of dynamic config failed ($RC)"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Testing search: configured local filter..."
|
||||
$LDAPSEARCH -H $URI2 -b "o=translucent" "(employeeType=consultant)" > $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 <<EOF
|
||||
dn: olcOverlay={0}translucent,olcDatabase={$DBIX}$BACKEND,cn=config
|
||||
changetype: modify
|
||||
add: olcTranslucentRemote
|
||||
olcTranslucentRemote: carLicense
|
||||
EOF
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapmodify of dynamic config failed ($RC)"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Testing search: configured remote filter..."
|
||||
$LDAPSEARCH -H $URI2 -b "o=translucent" "(|(employeeType=foo)(carlicense=right))" > $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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue