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
scope=sub
type=refreshOnly
interval=00:00:00:10
+updateref @URI1@
overlay syncprov
syncprov-sessionlog 100
-#monitor#database monitor
+#monitor#database monitor
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
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