]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Wait for named to start
authorMark Andrews <marka@isc.org>
Tue, 20 Apr 2021 04:56:07 +0000 (14:56 +1000)
committerMark Andrews <marka@isc.org>
Sat, 24 Apr 2021 01:19:47 +0000 (01:19 +0000)
If we don't wait for named to finish starting, 'rndc stop' may
fail due to the listen limit being reached in named leading
to a false negative test

bin/tests/system/shutdown/tests-shutdown.py

index eaf8d3ab3b0334850d2600fd5d1e2d1478e28e2d..e1ed83f242ad5c8e17ffd978b1bb14dd936447ca 100755 (executable)
@@ -168,7 +168,13 @@ def test_named_shutdown(named_port, control_port):
     # In both methods named should exit gracefully.
     for kill_method in ("rndc", "sigterm"):
         named_proc = launch_named()
-        time.sleep(2)
+        # wait for named to finish loading
+        for _ in range(10):
+            try:
+                resolver.query('version.bind', 'TXT', 'CH')
+                break
+            except (dns.resolver.NoNameservers, dns.exception.Timeout):
+                time.sleep(1)
 
         do_work(named_proc, resolver, rndc_cmd,
                 kill_method, n_workers=12, n_queries=16)