]> 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 16:25:18 +0000 (17:25 +0100)
(cherry picked from commit 597049461d9e7b3d43291ee4869aa2f6d47857b6)
(cherry picked from commit ee737c8328db58210aa1d57ecc208030247cf29d)

bin/tests/system/start.pl

index 3ef49a946cb5333704b1fc2cd28d0d01f1744a18..8a7a18c576de994654805b11edaf82f31d6e3384 100755 (executable)
@@ -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);