]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test017-syncreplication-refresh
Sync with HEAD
[openldap] / tests / scripts / test017-syncreplication-refresh
index 73c6474b485cab16bd230912e748688f1efe481a..3b01f1a0bfac9e284b94e656ddd7c2855de2cd55 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2004 The OpenLDAP Foundation.
+## Copyright 1998-2005 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -21,7 +21,7 @@ if test $SYNCPROV = syncprovno; then
        exit 0
 fi 
 
-mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3
+mkdir -p $TESTDIR $DBDIR1 $DBDIR2
 
 #
 # Test replication:
@@ -29,6 +29,7 @@ mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3
 # - start slave
 # - populate over ldap
 # - perform some modifies and deleted
+# - attempt to modify the slave (referral)
 # - retrieve database over ldap and compare against expected results
 #
 
@@ -200,6 +201,26 @@ fi
 echo "Waiting 15 seconds for syncrepl to receive changes..."
 sleep 15
 
+echo "Try updating the slave slapd..."
+$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,
+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