From: Brian Conry Date: Tue, 27 Nov 2018 23:47:08 +0000 (-0600) Subject: start.pl - wait for server to say 'running' X-Git-Tag: v9.11.6rc1~98^2~8 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=8bb758633d3d7473312af0f30d28963664bfe6ee;p=thirdparty%2Fbind9.git start.pl - wait for server to say 'running' (cherry picked from commit 597049461d9e7b3d43291ee4869aa2f6d47857b6) (cherry picked from commit ee737c8328db58210aa1d57ecc208030247cf29d) --- diff --git a/bin/tests/system/start.pl b/bin/tests/system/start.pl index 3ef49a946cb..8a7a18c576d 100755 --- a/bin/tests/system/start.pl +++ b/bin/tests/system/start.pl @@ -330,6 +330,36 @@ sub verify_server { $tcp = "" if (-e "$testdir/$server/named.notcp"); my $tries = 0; + + my $runfile = "$testdir/$server/named.run"; + + while (1) { + # the shell *ought* to have created the file immediately, but this + # logic allows the creation to be delayed without issues + if (open(my $fh, "<", $runfile)) { + # the two non-whitespace blobs should be the date and time + # but we don't care about them really, only that they are there + if (grep /^\S+ \S+ running$/, <$fh>) { + last; + } + } + + $tries++; + + if ($tries >= 30) { + print "I:server $server seems to have not started\n"; + print "I:failed\n"; + + system("$PERL $topdir/stop.pl $testdir"); + + exit 1; + } + + sleep 2; + } + + $tries = 0; + while (1) { my $return = system("$DIG $tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noedns -p $port version.bind. chaos txt \@10.53.0.$n > dig.out"); last if ($return == 0);