From 9cd9638d89168c0ccd1bda42bacdb982b06846ff Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 15 Dec 2005 19:13:05 +0000 Subject: [PATCH] cleanup SLEEPs --- tests/scripts/test045-syncreplication-proxied | 52 +++++++++++-------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/tests/scripts/test045-syncreplication-proxied b/tests/scripts/test045-syncreplication-proxied index 7e0956838b..5772d2d6ba 100755 --- a/tests/scripts/test045-syncreplication-proxied +++ b/tests/scripts/test045-syncreplication-proxied @@ -172,8 +172,9 @@ if test $RC != 0 ; then exit $RC fi -echo "Waiting 15 seconds for syncrepl to receive changes..." -sleep 15 +SLEEP=15 +echo "Waiting $SLEEP seconds for syncrepl to receive changes..." +sleep $SLEEP # first check #echo "Using ldapsearch to read all the entries from the master..." @@ -212,10 +213,12 @@ if test $? != 0 ; then exit 1 fi -echo "Stopping the provider, sleeping 10 seconds and restarting it..." +SLEEP=10 +echo "Stopping the provider, sleeping $SLEEP seconds and restarting it..." kill -HUP "$MASTERPID" -sleep 10 -echo "RESTART" >> $LOG1 +sleep $SLEEP + +echo "======================= RESTART =======================" >> $LOG1 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING >> $LOG1 2>&1 & MASTERPID=$! if test $WAIT != 0 ; then @@ -331,8 +334,9 @@ if test $RC != 0 ; then exit $RC fi -echo "Waiting 15 seconds for syncrepl to receive changes..." -sleep 15 +SLEEP=15 +echo "Waiting $SLEEP seconds for syncrepl to receive changes..." +sleep $SLEEP # second check #echo "Using ldapsearch to read all the entries from the master..." @@ -371,9 +375,10 @@ if test $? != 0 ; then exit 1 fi -echo "Stopping proxy to test recovery..." +SLEEP=10 +echo "Stopping proxy to test recovery; sleep for $SLEEP seconds..." kill -HUP $PROXYPID -sleep 10 +sleep $SLEEP echo "Modifying more entries on the master..." $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD >> \ @@ -400,7 +405,7 @@ cn: Tiberius J. Hooker EOMODS echo "Restarting proxy..." -echo "RESTART" >> $LOG3 +echo "======================= RESTART =======================" >> $LOG3 $SLAPD -f $CONF3 -h $URI3 -d $LVL $TIMING >> $LOG3 2>&1 & PROXYPID=$! if test $WAIT != 0 ; then @@ -409,8 +414,9 @@ if test $WAIT != 0 ; then fi KILLPIDS="$MASTERPID $SLAVEPID $PROXYPID" -echo "Waiting 25 seconds for syncrepl to receive changes..." -sleep 25 +SLEEP=25 +echo "Waiting $SLEEP seconds for syncrepl to receive changes..." +sleep $SLEEP # third check #echo "Using ldapsearch to read all the entries from the master..." @@ -468,8 +474,9 @@ EOMODS exit $RC fi - echo "Waiting 15 seconds for syncrepl to receive changes..." - sleep 15 + SLEEP=15 + echo "Waiting $SLEEP seconds for syncrepl to receive changes..." + sleep $SLEEP fi # fourth check @@ -509,9 +516,10 @@ if test $? != 0 ; then exit 1 fi -echo "Stopping consumer to test recovery..." +SLEEP=10 +echo "Stopping consumer to test recovery; wait $SLEEP seconds..." kill -HUP $SLAVEPID -sleep 10 +sleep $SLEEP echo "Modifying more entries on the master..." $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD >> \ @@ -524,7 +532,7 @@ drink: Mad Dog 20/20 EOMODS echo "Restarting consumer..." -echo "RESTART" >> $LOG2 +echo "======================= RESTART =======================" >> $LOG2 $SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING >> $LOG2 2>&1 & SLAVEPID=$! if test $WAIT != 0 ; then @@ -533,8 +541,9 @@ if test $WAIT != 0 ; then fi KILLPIDS="$MASTERPID $SLAVEPID $PROXYPID" -echo "Waiting 25 seconds for syncrepl to receive changes..." -sleep 25 +SLEEP=25 +echo "Waiting $SLEEP seconds for syncrepl to receive changes..." +sleep $SLEEP # fifth check #echo "Using ldapsearch to read all the entries from the master..." @@ -600,8 +609,9 @@ if test $RC != 0 ; then exit $RC fi -echo "Waiting 15 seconds for syncrepl to receive changes..." -sleep 15 +SLEEP=15 +echo "Waiting $SLEEP seconds for syncrepl to receive changes..." +sleep $SLEEP # sixth check #echo "Using ldapsearch to read all the entries from the master..." -- 2.39.5