]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test017-syncreplication-refresh
cleanup
[openldap] / tests / scripts / test017-syncreplication-refresh
index 3b7eecf0b2e904a8219571f352092368b80665f3..54fbb115191e27c42e6b0cbdb1a0bbbdce407945 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2005 The OpenLDAP Foundation.
+## Copyright 1998-2006 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -29,6 +29,7 @@ mkdir -p $TESTDIR $DBDIR1 $DBDIR2
 # - 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
 #
 
@@ -42,6 +43,8 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$PID"
 
+sleep 1
+
 echo "Using ldapsearch to check that master slapd is running..."
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
@@ -80,6 +83,8 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$KILLPIDS $SLAVEPID"
 
+sleep 1
+
 echo "Using ldapsearch to check that slave slapd is running..."
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
@@ -200,7 +205,7 @@ fi
 echo "Waiting 15 seconds for syncrepl to receive changes..."
 sleep 15
 
-echo "Try updating the slave..."
+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
@@ -213,24 +218,11 @@ EOMODS
 
 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
+# 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..."
@@ -271,4 +263,7 @@ if test $? != 0 ; then
 fi
 
 echo ">>>>> Test succeeded"
+
+test $KILLSERVERS != no && wait
+
 exit 0