From: Howard Chu Date: Sun, 1 Sep 2002 11:39:08 +0000 (+0000) Subject: Fix slapd startup ldapsearch loop X-Git-Tag: NO_SLAP_OP_BLOCKS~1043 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f22855e6be01f70189e3523119790950e320fe2f;p=openldap Fix slapd startup ldapsearch loop --- diff --git a/tests/scripts/test000-rootdse b/tests/scripts/test000-rootdse index b407afb309..1042459e98 100755 --- a/tests/scripts/test000-rootdse +++ b/tests/scripts/test000-rootdse @@ -41,10 +41,11 @@ echo "Using ldapsearch to retrieve the root DSE..." for i in 0 1 2 3 4 5; do $LDAPSEARCH -b "" -s base -h $LOCALHOST -p $PORT 'extensibleObject' > $SEARCHOUT 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done if test $RC = 0 -a $MONITORDB = yes ; then diff --git a/tests/scripts/test001-slapadd b/tests/scripts/test001-slapadd index de2f05a331..1c355a7b59 100755 --- a/tests/scripts/test001-slapadd +++ b/tests/scripts/test001-slapadd @@ -49,10 +49,11 @@ echo "Using ldapsearch to retrieve all the entries..." for i in 0 1 2 3 4 5; do $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT > $SEARCHOUT 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done kill -HUP $PID diff --git a/tests/scripts/test002-populate b/tests/scripts/test002-populate index 3d6fea0806..5f4ba5a436 100755 --- a/tests/scripts/test002-populate +++ b/tests/scripts/test002-populate @@ -39,10 +39,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done echo "Using ldapadd to populate the database..." diff --git a/tests/scripts/test003-search b/tests/scripts/test003-search index 77fb4616dc..cf823b1dc0 100755 --- a/tests/scripts/test003-search +++ b/tests/scripts/test003-search @@ -56,10 +56,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ '(objectclass=*)' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done if test $RC != 0 ; then diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify index fa7d25bbd1..d56a72389d 100755 --- a/tests/scripts/test004-modify +++ b/tests/scripts/test004-modify @@ -50,10 +50,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done if test $RC != 0 ; then diff --git a/tests/scripts/test005-modrdn b/tests/scripts/test005-modrdn index 994cc41191..213a0c9ef0 100755 --- a/tests/scripts/test005-modrdn +++ b/tests/scripts/test005-modrdn @@ -48,10 +48,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ 'objectClass=*' > $INITOUT 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done if test $RC != 0 ; then diff --git a/tests/scripts/test006-acls b/tests/scripts/test006-acls index 91b412fe8b..a1a3bc8a70 100755 --- a/tests/scripts/test006-acls +++ b/tests/scripts/test006-acls @@ -47,10 +47,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done if test $RC != 0 ; then diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index dd828dd386..ee384c2a4b 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -65,21 +65,23 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 - fi done + if test $RC = 0 ; then + break + fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 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 $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done echo "Starting slurpd..." diff --git a/tests/scripts/test008-concurrency b/tests/scripts/test008-concurrency index e646a083cb..c63fafec5a 100755 --- a/tests/scripts/test008-concurrency +++ b/tests/scripts/test008-concurrency @@ -52,10 +52,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done echo "Using tester for concurrent server access..." diff --git a/tests/scripts/test009-referral b/tests/scripts/test009-referral index aab5a45356..504e79f02b 100755 --- a/tests/scripts/test009-referral +++ b/tests/scripts/test009-referral @@ -62,10 +62,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done if test $RC != 0 ; then @@ -79,10 +80,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $SLAVEPORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done cat /dev/null > $SEARCHOUT diff --git a/tests/scripts/test010-passwd b/tests/scripts/test010-passwd index aeafbd1eb6..2a9e27f8f9 100755 --- a/tests/scripts/test010-passwd +++ b/tests/scripts/test010-passwd @@ -39,10 +39,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done echo "Using ldapadd to populate the database..." diff --git a/tests/scripts/test011-subtree-repl b/tests/scripts/test011-subtree-repl index 0f2e688cd8..c98e767f9f 100755 --- a/tests/scripts/test011-subtree-repl +++ b/tests/scripts/test011-subtree-repl @@ -70,10 +70,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done echo "Using ldapsearch to check that slave slapd is running..." @@ -81,10 +82,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done echo "Starting slurpd..." diff --git a/tests/scripts/test012-glue b/tests/scripts/test012-glue index ff5b1ec2f8..a8b93f0698 100755 --- a/tests/scripts/test012-glue +++ b/tests/scripts/test012-glue @@ -49,10 +49,11 @@ cd test-db for i in 0 1 2 3 4 5; do ../$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT > ../$SEARCHOUT 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done cd .. @@ -96,10 +97,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done echo "Using ldapadd to populate the glued database..." diff --git a/tests/scripts/test013-language b/tests/scripts/test013-language index 1deb30164f..c87a91da46 100755 --- a/tests/scripts/test013-language +++ b/tests/scripts/test013-language @@ -39,10 +39,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done echo "Using ldapadd to populate the database..." diff --git a/tests/scripts/test014-whoami b/tests/scripts/test014-whoami index cdedf81b1e..6c42968276 100755 --- a/tests/scripts/test014-whoami +++ b/tests/scripts/test014-whoami @@ -39,10 +39,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done echo "Testing ldapwhoami ..." diff --git a/tests/scripts/test015-xsearch b/tests/scripts/test015-xsearch index 80214e2209..e95a01f2ec 100755 --- a/tests/scripts/test015-xsearch +++ b/tests/scripts/test015-xsearch @@ -56,10 +56,11 @@ for i in 0 1 2 3 4 5; do $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \ 'objectclass=*' > /dev/null 2>&1 RC=$? - if test $RC = 1 ; then - echo "Waiting 5 seconds for slapd to start..." - sleep 5 + if test $RC = 0 ; then + break fi + echo "Waiting 5 seconds for slapd to start..." + sleep 5 done if test $RC != 0 ; then