]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Capture the resolver's startup and shutdown logging
authorMark Andrews <marka@isc.org>
Tue, 6 Feb 2024 04:45:01 +0000 (15:45 +1100)
committerMark Andrews <marka@isc.org>
Wed, 7 Feb 2024 01:20:25 +0000 (12:20 +1100)
Also set the debugging to 99.

(cherry picked from commit 3651c58a6ac59a68351677003ad924795fd64c42)

bin/tests/system/shutdown/tests_shutdown.py

index b6083b77a25b6ffebeea19d6da88c3782869c65b..1eb502890a4bd3a4b8d19b3942bb69fc0352ddad 100755 (executable)
@@ -190,20 +190,23 @@ def test_named_shutdown(named_port, control_port):
     # Method 2: killing with SIGTERM
     # In both methods named should exit gracefully.
     for kill_method in ("rndc", "sigterm"):
-        named_cmdline = [named, "-c", cfg_file, "-f"]
-        with subprocess.Popen(named_cmdline, cwd=cfg_dir) as named_proc:
-            try:
-                assert named_proc.poll() is None, "named isn't running"
-                assert wait_for_named_loaded(resolver)
-                do_work(
-                    named_proc,
-                    resolver,
-                    rndc_cmd,
-                    kill_method,
-                    n_workers=12,
-                    n_queries=16,
-                )
-                assert wait_for_proc_termination(named_proc)
-                assert named_proc.returncode == 0, "named crashed"
-            finally:  # Ensure named is terminated in case of an exception
-                named_proc.kill()
+        named_cmdline = [named, "-c", cfg_file, "-d", "99", "-g"]
+        with open(os.path.join(cfg_dir, "named.run"), "ab") as named_log:
+            with subprocess.Popen(
+                named_cmdline, cwd=cfg_dir, stderr=named_log
+            ) as named_proc:
+                try:
+                    assert named_proc.poll() is None, "named isn't running"
+                    assert wait_for_named_loaded(resolver)
+                    do_work(
+                        named_proc,
+                        resolver,
+                        rndc_cmd,
+                        kill_method,
+                        n_workers=12,
+                        n_queries=16,
+                    )
+                    assert wait_for_proc_termination(named_proc)
+                    assert named_proc.returncode == 0, "named crashed"
+                finally:  # Ensure named is terminated in case of an exception
+                    named_proc.kill()