#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
schemachecking=off
scope=sub
type=refreshAndPersist
+updateref @URI1@
overlay syncprov
#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
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..."
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..."
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