]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
update test_hooks system tests
authorColin Vidal <colin@isc.org>
Tue, 22 Jul 2025 12:43:26 +0000 (14:43 +0200)
committerColin Vidal <colin@isc.org>
Mon, 28 Jul 2025 21:08:04 +0000 (23:08 +0200)
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
bin/tests/system/hooks/tests_hooks.py [moved from bin/tests/system/hooks/tests_async_plugin.py with 72% similarity]

index 0cc4387cf1c131b5b4d093ccc8d243c870657bf9..905028ce077febb92e89a4690949c6de46dd2546 100644 (file)
@@ -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";
similarity index 72%
rename from bin/tests/system/hooks/tests_async_plugin.py
rename to bin/tests/system/hooks/tests_hooks.py
index ac89c85ac00d2cd7286ffd0a9274a8b694ee4a25..b5391ee46a155e146a927c2a00acfa17ed3b29e1 100644 (file)
@@ -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()