X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tests%2Fscripts%2Ftest018-syncreplication-persist;h=65685cb01a447378dbb917ec52ae5065c0c06ab6;hb=5ae3ee1cdeb0a7c388e907b901789c6782329cf5;hp=db2df02054b56cf13ce9ae1517f55a809840ca97;hpb=023d51076653f308fb14f616ee559edc17dd2d3f;p=openldap diff --git a/tests/scripts/test018-syncreplication-persist b/tests/scripts/test018-syncreplication-persist index db2df02054..65685cb01a 100755 --- a/tests/scripts/test018-syncreplication-persist +++ b/tests/scripts/test018-syncreplication-persist @@ -2,7 +2,7 @@ # $OpenLDAP$ ## This work is part of OpenLDAP Software . ## -## 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 \ @@ -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