From: Nicki Křížek Date: Wed, 1 Oct 2025 14:35:45 +0000 (+0200) Subject: Utilize nsX.rndc() helper X-Git-Tag: v9.21.17~53^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac2be27f8f894aad570cc7b1b0e5aa1786f8e6ea;p=thirdparty%2Fbind9.git Utilize nsX.rndc() helper Remove the duplicated code and replace it with nsX.rndc() call. --- diff --git a/bin/tests/system/dnstap/tests_dnstap.py b/bin/tests/system/dnstap/tests_dnstap.py index ba3c39c709e..a8680fed1d1 100644 --- a/bin/tests/system/dnstap/tests_dnstap.py +++ b/bin/tests/system/dnstap/tests_dnstap.py @@ -33,20 +33,7 @@ pytestmark = [ ] -def run_rndc(server, rndc_command): - """ - Send the specified 'rndc_command' to 'server' with a timeout of 10 seconds - """ - rndc = isctest.vars.ALL["RNDC"] - port = isctest.vars.ALL["CONTROLPORT"] - - cmdline = [rndc, "-c", "../_common/rndc.conf", "-p", port, "-s", server] - cmdline.extend(rndc_command) - - isctest.run.cmd(cmdline) - - -def test_dnstap_dispatch_socket_addresses(): +def test_dnstap_dispatch_socket_addresses(ns3): # Send some query to ns3 so that it records something in its dnstap file. msg = isctest.query.create("mail.example.", "A") res = isctest.query.tcp(msg, "10.53.0.2", expected_rcode=dns.rcode.NOERROR) @@ -55,7 +42,7 @@ def test_dnstap_dispatch_socket_addresses(): ] # Before continuing, roll dnstap file to ensure it is flushed to disk. - run_rndc("10.53.0.3", ["dnstap", "-roll", "1"]) + ns3.rndc("dnstap -roll 1") # Move the dnstap file aside so that it is retained for troubleshooting. os.rename(os.path.join("ns3", "dnstap.out.0"), "dnstap.out.resolver_addresses")