Skip to content
Snippets Groups Projects
Commit 4ccac992 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

test for referral return when updating shadow contexts

parent 8db476e6
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment