mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-12 09:52:54 -05:00
test for referral return when updating shadow contexts
This commit is contained in:
parent
8db476e664
commit
4ccac992ba
4 changed files with 42 additions and 3 deletions
|
|
@ -39,10 +39,10 @@ directory ./testrun/db.2.a
|
|||
rootdn "cn=Replica,dc=example,dc=com"
|
||||
rootpw secret
|
||||
updatedn "cn=Replica,dc=example,dc=com"
|
||||
updateref "ldap://localhost:9010"
|
||||
updateref @URI1@
|
||||
#ldbm#index objectClass eq
|
||||
#ldbm#index cn,sn,uid pres,eq,sub
|
||||
#bdb#index objectClass eq
|
||||
#bdb#index cn,sn,uid pres,eq,sub
|
||||
|
||||
#monitor#database monitor
|
||||
#monitor#database monitor
|
||||
|
|
|
|||
|
|
@ -59,10 +59,11 @@ syncrepl rid=1
|
|||
scope=sub
|
||||
type=refreshOnly
|
||||
interval=00:00:00:10
|
||||
updateref @URI1@
|
||||
|
||||
overlay syncprov
|
||||
syncprov-sessionlog 100
|
||||
|
||||
|
||||
|
||||
#monitor#database monitor
|
||||
#monitor#database monitor
|
||||
|
|
|
|||
|
|
@ -190,6 +190,25 @@ fi
|
|||
echo "Waiting 15 seconds for slurpd to send changes..."
|
||||
sleep 15
|
||||
|
||||
echo "Try updating the slave..."
|
||||
$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT2 -w $PASSWD > \
|
||||
$TESTOUT 2>&1 << EOMODS
|
||||
dn: cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example, dc=com
|
||||
changetype: modify
|
||||
add: description
|
||||
description: this write must fail because directed to a shadow context
|
||||
|
||||
EOMODS
|
||||
|
||||
RC=$?
|
||||
|
||||
# expect 10 (LDAP_REFERRAL)...
|
||||
if test $RC != 10 ; then
|
||||
echo "ldapmodify should have failed ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the master..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
||||
'objectclass=*' > $MASTEROUT 2>&1
|
||||
|
|
|
|||
|
|
@ -200,6 +200,25 @@ fi
|
|||
echo "Waiting 15 seconds for syncrepl to receive changes..."
|
||||
sleep 15
|
||||
|
||||
echo "Try updating the slave..."
|
||||
$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT2 -w $PASSWD > \
|
||||
$TESTOUT 2>&1 << EOMODS
|
||||
dn: cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example, dc=com
|
||||
changetype: modify
|
||||
add: description
|
||||
description: this write must fail because directed to a shadow context
|
||||
|
||||
EOMODS
|
||||
|
||||
RC=$?
|
||||
|
||||
# expect 10 (LDAP_REFERRAL)...
|
||||
if test $RC != 10 ; then
|
||||
echo "ldapmodify should have failed ($RC)!"
|
||||
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the master..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
||||
'objectclass=*' > $MASTEROUT 2>&1
|
||||
|
|
|
|||
Loading…
Reference in a new issue