diff --git a/tests/kdc/wait-kdc.sh b/tests/kdc/wait-kdc.sh index dc8262519..c01f4a294 100644 --- a/tests/kdc/wait-kdc.sh +++ b/tests/kdc/wait-kdc.sh @@ -40,18 +40,17 @@ waitsec=35 echo "Waiting for ${name} to start, looking logfile ${log}" +#echo "wait string: $waitfor" + while true ; do - t=`expr ${t} + 2` - sleep 2 - echo "Have waited $t seconds" - if tail -30 ${log} | grep "${waitfor}" > /dev/null; then + if grep "${waitfor}" ${log} > /dev/null; then break fi - if tail -30 ${log} | grep "No sockets" ; then + if grep "No sockets" ${log} ; then echo "The ${name} failed to bind to any sockets, another ${name} running ?" exit 1 fi - if tail -30 ${log} | grep "bind" | grep "Operation not permitted" ; then + if grep "bind" ${log} | grep "Operation not permitted" ; then echo "The ${name} failed to bind to any sockets, another ${name} running ?" exit 1 fi @@ -59,6 +58,10 @@ while true ; do echo "Waited for $waitsec for the ${name} to start, and it didnt happen" exit 2 fi + + t=`expr ${t} + 2` + sleep 2 + echo "Have waited $t seconds" done exit 0 \ No newline at end of file