]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
start.pl - wait for server to say 'running'
authorBrian Conry <bconry@isc.org>
Tue, 27 Nov 2018 23:47:08 +0000 (17:47 -0600)
committerOndřej Surý <ondrej@sury.org>
Mon, 3 Dec 2018 14:23:36 +0000 (15:23 +0100)
bin/tests/system/start.pl

index dc790bc607255901d9edd24fc4036e6f496a3173..8df5ab1b52e4904a54c6af5b13753c00349ddaa9 100755 (executable)
@@ -306,6 +306,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);