From 604f7fb9dbc3749f44364ca1867d8ee60831a192 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 11 Jan 2006 05:25:09 +0000 Subject: [PATCH] Use shell "wait" instead of fixed 10 second wait-for-things-to-die --- tests/scripts/all | 4 ++-- tests/scripts/test000-rootdse | 2 ++ tests/scripts/test001-slapadd | 3 +++ tests/scripts/test002-populate | 3 +++ tests/scripts/test003-search | 3 +++ tests/scripts/test004-modify | 3 +++ tests/scripts/test005-modrdn | 3 +++ tests/scripts/test006-acls | 3 +++ tests/scripts/test007-replication | 11 +++++++---- tests/scripts/test008-concurrency | 3 +++ tests/scripts/test009-referral | 3 +++ tests/scripts/test010-passwd | 3 +++ tests/scripts/test011-glue-slapadd | 3 +++ tests/scripts/test012-glue-populate | 3 +++ tests/scripts/test013-language | 3 +++ tests/scripts/test014-whoami | 3 +++ tests/scripts/test015-xsearch | 3 +++ tests/scripts/test016-subref | 3 +++ tests/scripts/test017-syncreplication-refresh | 3 +++ tests/scripts/test018-syncreplication-persist | 6 +++++- tests/scripts/test019-syncreplication-cascade | 3 +++ tests/scripts/test020-proxycache | 3 +++ tests/scripts/test021-certificate | 3 +++ tests/scripts/test022-ppolicy | 3 +++ tests/scripts/test023-refint | 3 +++ tests/scripts/test024-unique | 3 +++ tests/scripts/test025-limits | 3 +++ tests/scripts/test026-dn | 3 +++ tests/scripts/test027-emptydn | 5 ++++- tests/scripts/test028-idassert | 4 +++- tests/scripts/test029-ldapglue | 4 +++- tests/scripts/test030-relay | 4 +++- tests/scripts/test031-component-filter | 3 +++ tests/scripts/test032-chain | 4 +++- tests/scripts/test033-glue-syncrepl | 3 +++ tests/scripts/test034-translucent | 7 +++++-- tests/scripts/test035-meta | 4 +++- tests/scripts/test036-meta-concurrency | 3 +++ tests/scripts/test037-manage | 3 +++ tests/scripts/test038-retcode | 3 +++ tests/scripts/test039-glue-ldap-concurrency | 4 +++- tests/scripts/test040-subtree-rename | 3 +++ tests/scripts/test041-aci | 3 +++ tests/scripts/test042-valsort | 3 +++ tests/scripts/test043-delta-syncrepl | 3 +++ tests/scripts/test044-dynlist | 3 +++ tests/scripts/test045-syncreplication-proxied | 3 +++ tests/scripts/test046-dds | 3 +++ 48 files changed, 151 insertions(+), 16 deletions(-) diff --git a/tests/scripts/all b/tests/scripts/all index 111b559685..851c0d20c7 100755 --- a/tests/scripts/all +++ b/tests/scripts/all @@ -38,7 +38,7 @@ for CMD in $SRCDIR/scripts/test*; do exit $RC fi - echo ">>>>> waiting $SLEEPTIME seconds for things to exit" - sleep $SLEEPTIME +# echo ">>>>> waiting $SLEEPTIME seconds for things to exit" +# sleep $SLEEPTIME echo "" done diff --git a/tests/scripts/test000-rootdse b/tests/scripts/test000-rootdse index cc97a1630f..635b9fff6b 100755 --- a/tests/scripts/test000-rootdse +++ b/tests/scripts/test000-rootdse @@ -81,4 +81,6 @@ else fi fi +test $KILLSERVERS != no && wait + exit $RC diff --git a/tests/scripts/test001-slapadd b/tests/scripts/test001-slapadd index 52a4f9df90..3adf5e3fba 100755 --- a/tests/scripts/test001-slapadd +++ b/tests/scripts/test001-slapadd @@ -72,4 +72,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test002-populate b/tests/scripts/test002-populate index 6be0c44413..cc7de3491c 100755 --- a/tests/scripts/test002-populate +++ b/tests/scripts/test002-populate @@ -77,4 +77,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test003-search b/tests/scripts/test003-search index ef7f567402..2da5130f49 100755 --- a/tests/scripts/test003-search +++ b/tests/scripts/test003-search @@ -145,4 +145,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify index ab84f4b087..8e317b5c68 100755 --- a/tests/scripts/test004-modify +++ b/tests/scripts/test004-modify @@ -228,4 +228,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test005-modrdn b/tests/scripts/test005-modrdn index 8395d40b8c..57e6c93660 100755 --- a/tests/scripts/test005-modrdn +++ b/tests/scripts/test005-modrdn @@ -236,4 +236,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test006-acls b/tests/scripts/test006-acls index ea4d274995..23d0fbd5e6 100755 --- a/tests/scripts/test006-acls +++ b/tests/scripts/test006-acls @@ -534,4 +534,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index 41781e536f..85169e1f55 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -197,8 +197,8 @@ echo "Stopping the slave..." kill -HUP $SLAVEPID KILLPIDS="$PID $SLURPPID" -echo "Waiting 5 seconds for slave slapd to die..." -sleep 5 +echo "Waiting for slave slapd to die..." +wait $SLAVEPID echo "Applying more changes to the master slapd..." $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \ @@ -223,8 +223,8 @@ echo "Stopping slurpd..." kill -HUP $SLURPPID KILLPIDS="$PID" -echo "Waiting 5 seconds for slurpd to die..." -sleep 5 +echo "Waiting for slurpd to die..." +wait $SLURPPID echo "Applying more changes to the master slapd..." $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \ @@ -342,4 +342,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test008-concurrency b/tests/scripts/test008-concurrency index e212798a60..d37fcb77c6 100755 --- a/tests/scripts/test008-concurrency +++ b/tests/scripts/test008-concurrency @@ -86,4 +86,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test009-referral b/tests/scripts/test009-referral index ceb34016a4..40118f8fcc 100755 --- a/tests/scripts/test009-referral +++ b/tests/scripts/test009-referral @@ -163,4 +163,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test010-passwd b/tests/scripts/test010-passwd index 01801bf428..a1a3edb1af 100755 --- a/tests/scripts/test010-passwd +++ b/tests/scripts/test010-passwd @@ -183,4 +183,7 @@ $LDAPSEARCH -h $LOCALHOST -p $PORT1 \ test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test011-glue-slapadd b/tests/scripts/test011-glue-slapadd index 05c0926a29..cae730bd3e 100755 --- a/tests/scripts/test011-glue-slapadd +++ b/tests/scripts/test011-glue-slapadd @@ -90,4 +90,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test012-glue-populate b/tests/scripts/test012-glue-populate index 2424932e96..a9124eb604 100755 --- a/tests/scripts/test012-glue-populate +++ b/tests/scripts/test012-glue-populate @@ -77,4 +77,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test013-language b/tests/scripts/test013-language index 451073d611..5a2fe761bf 100755 --- a/tests/scripts/test013-language +++ b/tests/scripts/test013-language @@ -111,4 +111,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test014-whoami b/tests/scripts/test014-whoami index 0428acd412..e9d38994fb 100755 --- a/tests/scripts/test014-whoami +++ b/tests/scripts/test014-whoami @@ -457,6 +457,9 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 ## Note to developers: when SLAPD_DEBUG=-1 the command diff --git a/tests/scripts/test015-xsearch b/tests/scripts/test015-xsearch index d25246d72c..72637ee7bb 100755 --- a/tests/scripts/test015-xsearch +++ b/tests/scripts/test015-xsearch @@ -235,4 +235,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test016-subref b/tests/scripts/test016-subref index c5eb1827c7..04d4f5cb57 100755 --- a/tests/scripts/test016-subref +++ b/tests/scripts/test016-subref @@ -190,4 +190,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test017-syncreplication-refresh b/tests/scripts/test017-syncreplication-refresh index bb5183b623..54fbb11519 100755 --- a/tests/scripts/test017-syncreplication-refresh +++ b/tests/scripts/test017-syncreplication-refresh @@ -263,4 +263,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test018-syncreplication-persist b/tests/scripts/test018-syncreplication-persist index 3b325d53c5..65685cb01a 100755 --- a/tests/scripts/test018-syncreplication-persist +++ b/tests/scripts/test018-syncreplication-persist @@ -123,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 & @@ -244,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 >> \ @@ -340,4 +341,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test019-syncreplication-cascade b/tests/scripts/test019-syncreplication-cascade index 13dbc38998..ff8e541c37 100755 --- a/tests/scripts/test019-syncreplication-cascade +++ b/tests/scripts/test019-syncreplication-cascade @@ -451,4 +451,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test020-proxycache b/tests/scripts/test020-proxycache index 209beb2429..4c9a12fcd5 100755 --- a/tests/scripts/test020-proxycache +++ b/tests/scripts/test020-proxycache @@ -303,4 +303,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test021-certificate b/tests/scripts/test021-certificate index 1984ae95aa..85ac28543d 100755 --- a/tests/scripts/test021-certificate +++ b/tests/scripts/test021-certificate @@ -316,4 +316,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test022-ppolicy b/tests/scripts/test022-ppolicy index 925e925379..7f55cd09bc 100755 --- a/tests/scripts/test022-ppolicy +++ b/tests/scripts/test022-ppolicy @@ -343,4 +343,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test023-refint b/tests/scripts/test023-refint index 2e500d46e2..dddf79fad0 100755 --- a/tests/scripts/test023-refint +++ b/tests/scripts/test023-refint @@ -185,4 +185,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test024-unique b/tests/scripts/test024-unique index 7cfdda002f..dff70391a8 100755 --- a/tests/scripts/test024-unique +++ b/tests/scripts/test024-unique @@ -127,4 +127,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test025-limits b/tests/scripts/test025-limits index 02bf2f0396..b513708006 100755 --- a/tests/scripts/test025-limits +++ b/tests/scripts/test025-limits @@ -1362,4 +1362,7 @@ esac test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test026-dn b/tests/scripts/test026-dn index 9337048cfa..9e25d88ae9 100755 --- a/tests/scripts/test026-dn +++ b/tests/scripts/test026-dn @@ -160,4 +160,7 @@ fi ##### echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test027-emptydn b/tests/scripts/test027-emptydn index 7eaa289c08..9d0e7dfc10 100755 --- a/tests/scripts/test027-emptydn +++ b/tests/scripts/test027-emptydn @@ -75,7 +75,7 @@ if test $RC != 0 ; then exit $RC fi -test $KILLSERVERS != no && kill -HUP $KILLPIDS +kill -HUP $KILLPIDS wait LDIFOUT=$EMPTYDNOUT1 @@ -169,4 +169,7 @@ fi ##### echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test028-idassert b/tests/scripts/test028-idassert index 935f0b7a5a..772f3d5f87 100755 --- a/tests/scripts/test028-idassert +++ b/tests/scripts/test028-idassert @@ -248,5 +248,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" -exit 0 +test $KILLSERVERS != no && wait + +exit 0 diff --git a/tests/scripts/test029-ldapglue b/tests/scripts/test029-ldapglue index 5331cee764..233d1f2eab 100755 --- a/tests/scripts/test029-ldapglue +++ b/tests/scripts/test029-ldapglue @@ -218,5 +218,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" -exit 0 +test $KILLSERVERS != no && wait + +exit 0 diff --git a/tests/scripts/test030-relay b/tests/scripts/test030-relay index 088f059d46..3164dca9e4 100755 --- a/tests/scripts/test030-relay +++ b/tests/scripts/test030-relay @@ -103,5 +103,7 @@ for RELAY in $RELAYS ; do done echo ">>>>> Test succeeded" -exit 0 +test $KILLSERVERS != no && wait + +exit 0 diff --git a/tests/scripts/test031-component-filter b/tests/scripts/test031-component-filter index 194cd88d44..421dce6644 100755 --- a/tests/scripts/test031-component-filter +++ b/tests/scripts/test031-component-filter @@ -324,4 +324,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test032-chain b/tests/scripts/test032-chain index bb76155831..e03d55d1da 100755 --- a/tests/scripts/test032-chain +++ b/tests/scripts/test032-chain @@ -307,5 +307,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" -exit 0 +test $KILLSERVERS != no && wait + +exit 0 diff --git a/tests/scripts/test033-glue-syncrepl b/tests/scripts/test033-glue-syncrepl index 2612b4d27b..8e16fcf674 100755 --- a/tests/scripts/test033-glue-syncrepl +++ b/tests/scripts/test033-glue-syncrepl @@ -161,4 +161,7 @@ done test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test034-translucent b/tests/scripts/test034-translucent index e0a03f9e20..6963a55013 100755 --- a/tests/scripts/test034-translucent +++ b/tests/scripts/test034-translucent @@ -203,7 +203,7 @@ fi echo "Shutting down local slapd..." kill -HUP $LOCALPID -sleep 5 +wait $LOCALPID echo "Configuring local slapd without translucent_no_glue..." . $CONFFILTER $BACKEND $MONITORDB < $TRANSLUCENTLOCALCONF | \ @@ -626,7 +626,7 @@ fi echo "Shutting down local slapd..." kill -HUP $LOCALPID -sleep 5 +wait $LOCALPID echo "Configuring local slapd with translucent_strict..." echo translucent_strict >> $CONF2 @@ -723,4 +723,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test035-meta b/tests/scripts/test035-meta index d7513ebd81..5bdc5ddc57 100755 --- a/tests/scripts/test035-meta +++ b/tests/scripts/test035-meta @@ -720,5 +720,7 @@ esac test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" -exit 0 +test $KILLSERVERS != no && wait + +exit 0 diff --git a/tests/scripts/test036-meta-concurrency b/tests/scripts/test036-meta-concurrency index 72c7f2ed87..bf954435f3 100755 --- a/tests/scripts/test036-meta-concurrency +++ b/tests/scripts/test036-meta-concurrency @@ -224,4 +224,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test037-manage b/tests/scripts/test037-manage index 9f0345f771..f37cb39249 100755 --- a/tests/scripts/test037-manage +++ b/tests/scripts/test037-manage @@ -242,4 +242,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test038-retcode b/tests/scripts/test038-retcode index 6beb1469db..024437fcdf 100755 --- a/tests/scripts/test038-retcode +++ b/tests/scripts/test038-retcode @@ -106,4 +106,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test039-glue-ldap-concurrency b/tests/scripts/test039-glue-ldap-concurrency index 9eee1ab401..1a8f957447 100755 --- a/tests/scripts/test039-glue-ldap-concurrency +++ b/tests/scripts/test039-glue-ldap-concurrency @@ -201,5 +201,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" -exit 0 +test $KILLSERVERS != no && wait + +exit 0 diff --git a/tests/scripts/test040-subtree-rename b/tests/scripts/test040-subtree-rename index bdcbeb206e..cbdb97eb79 100755 --- a/tests/scripts/test040-subtree-rename +++ b/tests/scripts/test040-subtree-rename @@ -206,4 +206,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test041-aci b/tests/scripts/test041-aci index 83fba8c4ba..0d8e27ef48 100755 --- a/tests/scripts/test041-aci +++ b/tests/scripts/test041-aci @@ -255,4 +255,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test042-valsort b/tests/scripts/test042-valsort index ba352e61e3..6e72d0b9a8 100755 --- a/tests/scripts/test042-valsort +++ b/tests/scripts/test042-valsort @@ -218,4 +218,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test043-delta-syncrepl b/tests/scripts/test043-delta-syncrepl index 6ca84555c9..6c0bf33d96 100755 --- a/tests/scripts/test043-delta-syncrepl +++ b/tests/scripts/test043-delta-syncrepl @@ -344,4 +344,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test044-dynlist b/tests/scripts/test044-dynlist index 514069a338..e1a5487f3b 100755 --- a/tests/scripts/test044-dynlist +++ b/tests/scripts/test044-dynlist @@ -448,4 +448,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test045-syncreplication-proxied b/tests/scripts/test045-syncreplication-proxied index 741e30f40a..be4f408d71 100755 --- a/tests/scripts/test045-syncreplication-proxied +++ b/tests/scripts/test045-syncreplication-proxied @@ -697,4 +697,7 @@ fi test $KILLSERVERS != no && kill -HUP $KILLPIDS echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 diff --git a/tests/scripts/test046-dds b/tests/scripts/test046-dds index 7630a33503..c36800090a 100755 --- a/tests/scripts/test046-dds +++ b/tests/scripts/test046-dds @@ -526,4 +526,7 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" + +test $KILLSERVERS != no && wait + exit 0 -- 2.39.5