Commit b18f505f2a for bind
commit b18f505f2abbc583269b5625af0f6a3ed00b5d35
Author: Nicki Křížek <nicki@isc.org>
Date: Wed Nov 11 10:29:39 2026 +0000
Make the nsprocessinglimit test independent of the network
The test counted the queries sent to the delegated servers on
127.0.0.1-23 and so needed each of them to fail at once. That holds
where all of 127/8 is local, as on Linux. On macOS only 127.0.0.1 is,
the queries time out instead, and the fetch gives up before it has
tried all the servers.
Mark the delegated servers bogus and count the addresses the resolver
selects and then skips, which max-delegation-servers caps just the
same. The skips are only logged in a query trace build, so the checks
that count them are skipped without one.
Assisted-by: Claude:claude-mythos-5-2
diff --git a/bin/tests/system/isctest/mark.py b/bin/tests/system/isctest/mark.py
index d96966875a..64a6aac29f 100644
--- a/bin/tests/system/isctest/mark.py
+++ b/bin/tests/system/isctest/mark.py
@@ -87,6 +87,12 @@ with_dnstap = pytest.mark.skipif(
)
+with_querytrace = pytest.mark.skipif(
+ os.getenv("FEATURE_QUERYTRACE") != "1",
+ reason="query trace logging disabled in the build",
+)
+
+
without_fips = pytest.mark.skipif(
os.getenv("FEATURE_FIPS_MODE") == "1", reason="FIPS support enabled in the build"
)
diff --git a/bin/tests/system/nsprocessinglimit/ns4/named.conf.j2 b/bin/tests/system/nsprocessinglimit/ns4/named.conf.j2
index 770e7ba659..5acf94e514 100644
--- a/bin/tests/system/nsprocessinglimit/ns4/named.conf.j2
+++ b/bin/tests/system/nsprocessinglimit/ns4/named.conf.j2
@@ -10,6 +10,12 @@ options {
{% endif %}
};
+/*
+ * The sub.example.tld servers: skipped once selected, so that the test
+ * does not depend on how fast the OS fails a query to them.
+ */
+server 127.0.0.0/8 { bogus yes; };
+
{% include "_common/root.hint.conf" %}
{% include "_common/controls.conf.j2" %}
diff --git a/bin/tests/system/nsprocessinglimit/tests_nsprocessinglimit.py b/bin/tests/system/nsprocessinglimit/tests_nsprocessinglimit.py
index d7de34e2e5..fcfd36a6a3 100644
--- a/bin/tests/system/nsprocessinglimit/tests_nsprocessinglimit.py
+++ b/bin/tests/system/nsprocessinglimit/tests_nsprocessinglimit.py
@@ -37,14 +37,6 @@ def extract_dnstap(ns, expectedlen):
return map(line_to_ips_and_queries, lines)
-def expect_query(expected_query, expected_query_count, ips_and_queries):
- count = 0
- for _, query in ips_and_queries:
- if query == expected_query:
- count += 1
- assert count == expected_query_count
-
-
def expect_next_ip_and_query(expected_ips_and_queries, ips_and_queries):
for expected_ip, expected_query in expected_ips_and_queries:
ip, query = next(ips_and_queries)
@@ -52,16 +44,15 @@ def expect_next_ip_and_query(expected_ips_and_queries, ips_and_queries):
assert query == expected_query
-def check_nsprocessinglimit(ns, queries_count):
- msg = isctest.query.create("a.sub.example.tld.", "A")
+def check_nsprocessinglimit(ns, label, servers_count):
+ # A name of its own per check tells the fetches apart in the log.
+ qname = f"{label}.sub.example.tld"
+ msg = isctest.query.create(qname, "A")
res = isctest.query.tcp(msg, ns.ip)
isctest.check.servfail(res)
- # The 4 formers lines are request to find sub.example.tld NSs.
- # The latest are queries to sub.example.tld NSs.
- ips_and_queries = extract_dnstap(ns, queries_count)
-
- # Checking the begining of the resulution
+ # The only queries sent are those finding the sub.example.tld NSs.
+ ips_and_queries = extract_dnstap(ns, 4)
expect_next_ip_and_query(
[
("10.53.0.1", "./IN/NS"),
@@ -71,11 +62,16 @@ def check_nsprocessinglimit(ns, queries_count):
],
ips_and_queries,
)
- expect_query("a.sub.example.tld/IN/A", queries_count - 4, ips_and_queries)
+
+ # The sub.example.tld NSs are bogus: each one selected for the fetch is
+ # logged (in a query trace build) and skipped instead of being queried.
+ skipped = ns.log.grep(f"({qname}/A): ignoring blackholed / bogus server")
+ assert len(skipped) == servers_count
+@isctest.mark.with_querytrace
def test_nsprocessinglimit_default(ns4):
- check_nsprocessinglimit(ns4, 17)
+ check_nsprocessinglimit(ns4, "default", 13)
def reconfig_maxdelegationservers(ns, templates, count):
@@ -99,19 +95,22 @@ def reconfig_maxdelegationservers_failure(ns, templates, count):
watcher.wait_for_line("reloading configuration failed: out of range")
+@isctest.mark.with_querytrace
def test_nsprocessinglimit_13ns(ns4, templates):
reconfig_maxdelegationservers(ns4, templates, 13)
- check_nsprocessinglimit(ns4, 17)
+ check_nsprocessinglimit(ns4, "limit13", 13)
+@isctest.mark.with_querytrace
def test_nsprocessinglimit_5ns(ns4, templates):
reconfig_maxdelegationservers(ns4, templates, 5)
- check_nsprocessinglimit(ns4, 9)
+ check_nsprocessinglimit(ns4, "limit5", 5)
+@isctest.mark.with_querytrace
def test_nsprocessinglimit_20ns(ns4, templates):
reconfig_maxdelegationservers(ns4, templates, 20)
- check_nsprocessinglimit(ns4, 24)
+ check_nsprocessinglimit(ns4, "limit20", 20)
def test_nsprocessinglimit_lower(ns4, templates):