]> 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>
Sun, 25 Apr 2021 22:57:22 +0000 (08:57 +1000)
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

(cherry picked from commit 8d5870f9df858fb9cea24474aca30f3f1f35078c)

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

index eb205cfa86f4cfb755d43c6063b7808b335ab4ea..280ed3ee50ec7b58fcad39e47c2304b33a7d47b7 100755 (executable)
@@ -171,7 +171,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)