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

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

parent 4ccac992
Branches
Tags
No related merge requests found
......@@ -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
......
......@@ -56,6 +56,7 @@ syncrepl rid=1
schemachecking=off
scope=sub
type=refreshAndPersist
updateref @URI1@
overlay syncprov
......
......@@ -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
......
......@@ -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..."
......
......@@ -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..."
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment