]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test018-syncreplication-persist
add some failed binds (but don't log too much)
[openldap] / tests / scripts / test018-syncreplication-persist
index b08c7facebc5de820a4115030f1b65d8cd2a6302..65685cb01a447378dbb917ec52ae5065c0c06ab6 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
@@ -13,7 +13,7 @@
 ## top-level directory of the distribution or, alternatively, at
 ## <http://www.OpenLDAP.org/license.html>.
 
-if test "$BACKEND" != "bdb" -a "$BACKEND" != "hdb" ; then
+if test "$BACKEND" != "bdb" && test "$BACKEND" != "hdb" ; then
        echo "Test does not support $BACKEND"
        exit 0
 fi
@@ -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 \
@@ -119,6 +123,7 @@ sleep 15
 
 echo "Stopping the provider, sleeping 10 seconds and restarting it..."
 kill -HUP "$PID"
+wait $PID
 sleep 10
 echo "RESTART" >> $LOG1
 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING >> $LOG1 2>&1 &
@@ -129,6 +134,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 \
@@ -238,7 +245,7 @@ sleep 15
 
 echo "Stopping consumer to test recovery..."
 kill -HUP $SLAVEPID
-sleep 10
+wait $SLAVEPID
 
 echo "Modifying more entries on the master..."
 $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD >> \
@@ -273,9 +280,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 +292,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
@@ -344,4 +341,7 @@ if test $? != 0 ; then
 fi
 
 echo ">>>>> Test succeeded"
+
+test $KILLSERVERS != no && wait
+
 exit 0