From b0061843b77f7cd96022bd9531853b54fd933dc3 Mon Sep 17 00:00:00 2001 From: Colin Vidal Date: Tue, 22 Jul 2025 14:43:26 +0200 Subject: [PATCH] update test_hooks system tests Add the case where the plugin name is provided without the extension in the test_hooks system tests. --- bin/tests/system/hooks/ns1/named.conf.j2 | 6 +++++- .../hooks/{tests_async_plugin.py => tests_hooks.py} | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) rename bin/tests/system/hooks/{tests_async_plugin.py => tests_hooks.py} (72%) diff --git a/bin/tests/system/hooks/ns1/named.conf.j2 b/bin/tests/system/hooks/ns1/named.conf.j2 index 0cc4387cf1..905028ce07 100644 --- a/bin/tests/system/hooks/ns1/named.conf.j2 +++ b/bin/tests/system/hooks/ns1/named.conf.j2 @@ -10,6 +10,7 @@ * See the COPYRIGHT file distributed with this work for additional * information regarding copyright ownership. */ +{% set noextension = noextension | default(False) %} options { query-source address 10.53.0.1; @@ -24,8 +25,11 @@ options { minimal-responses no; }; - +{% if noextension %} +plugin query "@TOP_BUILDDIR@/testlib-driver-async"; +{% else %} plugin query "@TOP_BUILDDIR@/testlib-driver-async.@DYLIB@"; +{% endif %} key rndc_key { secret "1234abcd8765"; diff --git a/bin/tests/system/hooks/tests_async_plugin.py b/bin/tests/system/hooks/tests_hooks.py similarity index 72% rename from bin/tests/system/hooks/tests_async_plugin.py rename to bin/tests/system/hooks/tests_hooks.py index ac89c85ac0..b5391ee46a 100644 --- a/bin/tests/system/hooks/tests_async_plugin.py +++ b/bin/tests/system/hooks/tests_hooks.py @@ -16,8 +16,16 @@ pytest.importorskip("dns") import dns.message -def test_async_hook(): +def test_hooks(): msg = dns.message.make_query("example.com.", "A") res = isctest.query.udp(msg, "10.53.0.1") # the test-async plugin changes the status of any positive answer to NOTIMP isctest.check.notimp(res) + + +def test_hooks_noextension(ns1, templates): + templates.render("ns1/named.conf", {"noextension": True}) + with ns1.watch_log_from_here() as watcher: + ns1.rndc("reload") + watcher.wait_for_line("all zones loaded") + test_hooks()