From 47d64f944f6b51aa290ca470fe7b822ba630dfd3 Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Thu, 23 Jan 2025 15:58:48 +0100 Subject: [PATCH] Rename assert_custom_named_is_alive to named_alive (cherry picked from commit 38e751d9ac937125828c2f04f181ecdbfd83e979) --- bin/tests/system/isctest/check.py | 6 ++++++ bin/tests/system/isctest/run.py | 6 ------ bin/tests/system/shutdown/tests_shutdown.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/tests/system/isctest/check.py b/bin/tests/system/isctest/check.py index cfc8d92cee..0906ad92ff 100644 --- a/bin/tests/system/isctest/check.py +++ b/bin/tests/system/isctest/check.py @@ -102,6 +102,12 @@ def is_executable(cmd: str, errmsg: str) -> None: assert executable is not None, errmsg +def named_alive(named_proc, resolver_ip): + assert named_proc.poll() is None, "named isn't running" + msg = dns.message.make_query("version.bind", "TXT", "CH") + isctest.query.tcp(msg, resolver_ip, expected_rcode=dns_rcode.NOERROR) + + def notauth(message: dns.message.Message) -> None: rcode(message, dns.rcode.NOTAUTH) diff --git a/bin/tests/system/isctest/run.py b/bin/tests/system/isctest/run.py index 49176d7a88..eed356bbb5 100644 --- a/bin/tests/system/isctest/run.py +++ b/bin/tests/system/isctest/run.py @@ -132,9 +132,3 @@ def get_named_cmdline(cfg_dir, cfg_file="named.conf"): named_cmdline = [named, "-c", cfg_file, "-d", "99", "-g"] return named_cmdline - - -def assert_custom_named_is_alive(named_proc, resolver_ip): - assert named_proc.poll() is None, "named isn't running" - msg = dns.message.make_query("version.bind", "TXT", "CH") - isctest.query.tcp(msg, resolver_ip, expected_rcode=dns_rcode.NOERROR) diff --git a/bin/tests/system/shutdown/tests_shutdown.py b/bin/tests/system/shutdown/tests_shutdown.py index 99929be93a..bbfab34cc4 100755 --- a/bin/tests/system/shutdown/tests_shutdown.py +++ b/bin/tests/system/shutdown/tests_shutdown.py @@ -177,7 +177,7 @@ def test_named_shutdown(kill_method): named_cmdline, cwd=cfg_dir, stderr=named_log ) as named_proc: try: - isctest.run.assert_custom_named_is_alive(named_proc, resolver_ip) + isctest.check.named_alive(named_proc, resolver_ip) do_work( named_proc, resolver_ip,