From: Pierangelo Masarati Date: Wed, 19 Jan 2005 14:05:35 +0000 (+0000) Subject: test for referral return when updating shadow contexts X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~333 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4ccac992ba93df47c2dc80d1b2c06c7b96bf518a;p=openldap test for referral return when updating shadow contexts --- diff --git a/tests/data/slapd-repl-slave.conf b/tests/data/slapd-repl-slave.conf index c8016ab651..d4d69e19c4 100644 --- a/tests/data/slapd-repl-slave.conf +++ b/tests/data/slapd-repl-slave.conf @@ -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 diff --git a/tests/data/slapd-syncrepl-slave-refresh1.conf b/tests/data/slapd-syncrepl-slave-refresh1.conf index b5873c5bd2..ddf424dfb3 100644 --- a/tests/data/slapd-syncrepl-slave-refresh1.conf +++ b/tests/data/slapd-syncrepl-slave-refresh1.conf @@ -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 diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index f924d35227..18e455f804 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -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 diff --git a/tests/scripts/test017-syncreplication-refresh b/tests/scripts/test017-syncreplication-refresh index b4f024bd96..eff66046b2 100755 --- a/tests/scripts/test017-syncreplication-refresh +++ b/tests/scripts/test017-syncreplication-refresh @@ -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