From: Pierangelo Masarati Date: Wed, 19 Jan 2005 14:45:35 +0000 (+0000) Subject: if enabled, test the chain overlay with global scope to propagate writes from shadow... X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~332 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd6a5abf2288792f157d82a3fd9a83058d3a0237;p=openldap if enabled, test the chain overlay with global scope to propagate writes from shadow to master --- diff --git a/tests/data/slapd-repl-slave.conf b/tests/data/slapd-repl-slave.conf index d4d69e19c4..90be98119b 100644 --- a/tests/data/slapd-repl-slave.conf +++ b/tests/data/slapd-repl-slave.conf @@ -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 diff --git a/tests/data/slapd-syncrepl-slave-persist1.conf b/tests/data/slapd-syncrepl-slave-persist1.conf index 239b489060..bc015aa368 100644 --- a/tests/data/slapd-syncrepl-slave-persist1.conf +++ b/tests/data/slapd-syncrepl-slave-persist1.conf @@ -56,6 +56,7 @@ syncrepl rid=1 schemachecking=off scope=sub type=refreshAndPersist +updateref @URI1@ overlay syncprov diff --git a/tests/data/slapd-syncrepl-slave-refresh1.conf b/tests/data/slapd-syncrepl-slave-refresh1.conf index ddf424dfb3..8cb862d314 100644 --- a/tests/data/slapd-syncrepl-slave-refresh1.conf +++ b/tests/data/slapd-syncrepl-slave-refresh1.conf @@ -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 diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index 18e455f804..2ea9ecd0f2 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -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..." diff --git a/tests/scripts/test017-syncreplication-refresh b/tests/scripts/test017-syncreplication-refresh index eff66046b2..3b7eecf0b2 100755 --- a/tests/scripts/test017-syncreplication-refresh +++ b/tests/scripts/test017-syncreplication-refresh @@ -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..." diff --git a/tests/scripts/test018-syncreplication-persist b/tests/scripts/test018-syncreplication-persist index dcea9dc735..ec9cc06090 100755 --- a/tests/scripts/test018-syncreplication-persist +++ b/tests/scripts/test018-syncreplication-persist @@ -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