test for referral return when updating shadow contexts

This commit is contained in:
Pierangelo Masarati 2005-01-19 14:05:35 +00:00
parent 8db476e664
commit 4ccac992ba
4 changed files with 42 additions and 3 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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