if enabled, test the chain overlay with global scope to propagate writes from shadow to master

This commit is contained in:
Pierangelo Masarati 2005-01-19 14:45:35 +00:00
parent 4ccac992ba
commit cd6a5abf22
6 changed files with 83 additions and 12 deletions

View File

@ -27,6 +27,17 @@ argsfile ./testrun/slapd.2.args
#mod#moduleload back_@BACKEND@.la
#monitormod#modulepath ../servers/slapd/back-monitor/
#monitormod#moduleload back_monitor.la
#ldapmod#modulepath ../servers/slapd/back-ldap/
#ldapmod#moduleload back_ldap.la
#ldapyes#overlay chain
#ldapyes#chain-uri @URI1@
#ldapyes#chain-acl-authcDN "cn=Manager,dc=example,dc=com"
#ldapyes#chain-acl-passwd secret
#ldapmod#overlay chain
#ldapmod#chain-uri @URI1@
#ldapmod#chain-acl-authcDN "cn=Manager,dc=example,dc=com"
#ldapmod#chain-acl-passwd secret
#######################################################################
# database definitions

View File

@ -56,6 +56,7 @@ syncrepl rid=1
schemachecking=off
scope=sub
type=refreshAndPersist
updateref @URI1@
overlay syncprov

View File

@ -29,6 +29,17 @@ argsfile ./testrun/slapd.2.args
#monitormod#moduleload back_monitor.la
#syncprovmod#modulepath ../servers/slapd/overlays/
#syncprovmod#moduleload syncprov.la
#ldapmod#modulepath ../servers/slapd/back-ldap/
#ldapmod#moduleload back_ldap.la
#ldapyes#overlay chain
#ldapyes#chain-uri @URI1@
#ldapyes#chain-acl-authcDN "cn=Manager,dc=example,dc=com"
#ldapyes#chain-acl-passwd secret
#ldapmod#overlay chain
#ldapmod#chain-uri @URI1@
#ldapmod#chain-acl-authcDN "cn=Manager,dc=example,dc=com"
#ldapmod#chain-acl-passwd secret
#######################################################################
# consumer database definitions

View File

@ -196,17 +196,31 @@ $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT2 -w $PASSWD > \
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
description: This write must fail because directed to a shadow context,
description: unless the chain overlay is configured appropriately ;)
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
if test $BACKLDAP = "ldapno" ; then
# expect 10 (LDAP_REFERRAL)...
if test $RC != 10 ; then
echo "ldapmodify should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
else
# expect 0 (LDAP_SUCCESS)...
if test $RC != 0 ; then
echo "ldapmodify failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Waiting 5 seconds for slurpd to send changes..."
sleep 5
fi
echo "Using ldapsearch to read all the entries from the master..."

View File

@ -206,17 +206,31 @@ $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT2 -w $PASSWD > \
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
description: This write must fail because directed to a shadow context,
description: unless the chain overlay is configured appropriately ;)
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
if test $BACKLDAP = "ldapno" ; then
# expect 10 (LDAP_REFERRAL)...
if test $RC != 10 ; then
echo "ldapmodify should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
else
# expect 0 (LDAP_SUCCESS)...
if test $RC != 0 ; then
echo "ldapmodify failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Waiting 5 seconds for slurpd to send changes..."
sleep 5
fi
echo "Using ldapsearch to read all the entries from the master..."

View File

@ -242,6 +242,26 @@ KILLPIDS="$PID $SLAVEPID"
echo "Waiting 25 seconds for syncrepl to receive changes..."
sleep 25
echo "Try updating the slave..."
$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT4 -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,
description: unless the chain overlay is configured appropriately ;)
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