From: Howard Chu Date: Mon, 13 Oct 2003 10:14:05 +0000 (+0000) Subject: ITS#2747 fix exit conditions X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~580 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2ef88ce50153140ff938369f496ee2bc58b27ee6;p=openldap ITS#2747 fix exit conditions --- diff --git a/tests/scripts/test017-syncreplication-refresh b/tests/scripts/test017-syncreplication-refresh index aed3a98050..1a23bd17b8 100755 --- a/tests/scripts/test017-syncreplication-refresh +++ b/tests/scripts/test017-syncreplication-refresh @@ -44,9 +44,6 @@ if test $WAIT != 0 ; then fi BACKEND=$SAVE -echo "Waiting 5 seconds to wait for master to start..." -sleep 5 - 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 $PORT \ @@ -59,13 +56,19 @@ for i in 0 1 2 3 4 5; do sleep 5 done +if test $RC != 0 ; then + echo "ldapsearch failed ($RC)!" + kill -HUP $PID + exit $RC +fi + echo "Using ldapadd to create the context prefix entry in the master..." $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \ $LDIFORDEREDCP > /dev/null 2>&1 RC=$? if test $RC != 0 ; then echo "ldapadd failed ($RC)!" - kill -HUP $PID $SLAVEPID + kill -HUP $PID exit $RC fi @@ -90,13 +93,19 @@ for i in 0 1 2 3 4 5; do sleep 5 done +if test $RC != 0 ; then + echo "ldapsearch failed ($RC)!" + kill -HUP $PID + exit $RC +fi + echo "Using ldapadd to populate the master directory..." $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \ $LDIFORDEREDNOCP > /dev/null 2>&1 RC=$? if test $RC != 0 ; then echo "ldapadd failed ($RC)!" - kill -HUP $PID $SLAVEPID + kill -HUP $PID $R1SLAVEPID exit $RC fi @@ -192,7 +201,7 @@ RC=$? if test $RC != 0 ; then echo "ldapsearch failed at master ($RC)!" - kill -HUP $PID $SLAVEPID + kill -HUP $PID $R1SLAVEPID exit $RC fi