]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test018-syncreplication-persist
From HEAD
[openldap] / tests / scripts / test018-syncreplication-persist
index db2df02054b56cf13ce9ae1517f55a809840ca97..3b325d53c5a2b953b0257be58917738b5dcfd277 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
@@ -48,6 +48,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 \
@@ -86,6 +88,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 $PORT4 \
@@ -129,6 +133,8 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$PID $SLAVEPID"
 
+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 \
@@ -273,9 +279,10 @@ KILLPIDS="$PID $SLAVEPID"
 echo "Waiting 25 seconds for syncrepl to receive changes..."
 sleep 25
 
-echo "Try updating the slave slapd..."
-$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT4 -w $PASSWD > \
-       $TESTOUT 2>&1 << EOMODS
+if test ! $BACKLDAP = "ldapno" ; then
+       echo "Try updating the slave slapd..."
+       $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
@@ -284,18 +291,7 @@ description: unless the chain overlay is configured appropriately ;)
 
 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)...
+       RC=$?
        if test $RC != 0 ; then
                echo "ldapmodify failed ($RC)!"
                test $KILLSERVERS != no && kill -HUP $KILLPIDS