Commit Graph
10602 Commits
Author SHA1 Message Date
Aram Sargsyan 7010948de9 Test -T cookiealwaysvalid
Add a check in the "cookie" system test to make sure that the new
'-T cookiealwaysvalid' option works.

(cherry picked from commit 4e75a20b6a)
2025-03-17 12:15:24 +00:00
Aram Sargsyan 3aa51f574e Implement -T cookiealwaysvalid
When -T cookiealwaysvalid is passed to named, DNS cookie checks for
the incoming queries always pass, given they are structurally correct.

(cherry picked from commit 807ef8545d)
2025-03-17 12:05:50 +00:00
Ondřej SurýandNicki Křížek 9dc22c65e8 Limit the additional processing for large RDATA sets
When answering queries, don't add data to the additional section if
the answer has more than 13 names in the RDATA.  This limits the
number of lookups into the database(s) during a single client query,
reducing query processing load.

Also, don't append any additional data to type=ANY queries. The
answer to ANY is already big enough.

(cherry picked from commit a1982cf1bb)
2025-01-20 17:05:38 +01:00
Ondřej SurýandNicki Křížek da68396086 Isolate using the -T noaa flag only for part of the resolver test
Instead of running the whole resolver/ns4 server with -T noaa flag,
use it only for the part where it is actually needed.  The -T noaa
could interfere with other parts of the test because the answers don't
have the authoritative-answer bit set, and we could have false
positives (or false negatives) in the test because the authoritative
server doesn't follow the DNS protocol for all the tests in the resolver
system test.

(cherry picked from commit e51d4d3b88)
2025-01-20 17:05:38 +01:00
Nicki KřížekandMichal Nowak d4fb094ee8 Disable too-many/too-few pylint checks
Enforcing pylint standards and default for our test code seems
counter-productive. Since most of the newly added code are tests or is
test-related, encountering these checks rarely make us refactor the code
in other ways and we just disable these checks individually. Code that
is too complex or convoluted will be pointed out in reviews anyways.

(cherry picked from commit 7639c58c48)
2024-12-03 10:42:58 +01:00
Nicki KřížekandMichal Nowak 11beae640e Support dnspython 2.7.0
CookieOption with new .server/.client attributes (rather than .data) was
added to dnspython. Adjust the code to use the new attributes if
available and fall back to the old code for dnspython<2.7.0
compatibility.

(cherry picked from commit 0d90b13646)
2024-10-22 08:31:07 +02:00
Ondřej SurýandMichal Nowak 6d5e81c096 Be more patient when stopping servers in the system tests
When the TCP test is run on the busy server, the server might take a
while to wind the server down because it might still be processing all
that 300k invalid XFR requests.

Increate the rncd wait time to 120 seconds, the SIGTERM time to 300
seconds, and reduce the time to wait for ans servers from 1200 second
to just 120 seconds.

(cherry picked from commit d971472321)
2024-09-10 12:50:20 +02:00
Michal Nowak 0c17917a40 Bump max-recursion-queries to 100 in resolver system test
With max-recursion-queries set to 50 the resolver system test was
unstable in the "checking query resolution for a domain with a valid
glueless delegation chain" check as ns1 replied with SERVFAIL.
2024-08-26 18:00:52 +02:00
Evan HuntandOndřej Surý 3e0643a6dc implement 'max-query-restarts'
implement, document, and test the 'max-query-restarts' option
which specifies the query restart limit - the number of times
we can follow CNAMEs before terminating resolution.

(cherry picked from commit 104f3b82fb)
(cherry picked from commit 2e04f0380c)
2024-08-20 17:35:07 +00:00
Evan HuntandOndřej Surý a7a479c258 reduce the max-recursion-queries default to 32
the number of iterative queries that can be sent to resolve a
name now defaults to 32 rather than 100.

(cherry picked from commit 7e3b425dc2)
(cherry picked from commit a11367ade3)
2024-08-20 17:35:07 +00:00
Evan HuntandOndřej Surý 95376b45f5 make "max_restarts" a configurable value
MAX_RESTARTS is no longer hard-coded; ns_server_setmaxrestarts()
and dns_client_setmaxrestarts() can now be used to modify the
max-restarts value at runtime. in both cases, the default is 11.

(cherry picked from commit c5588babaf)
(cherry picked from commit bfbc6a6c84)
2024-08-20 17:35:07 +00:00
Evan HuntandOndřej Surý d1797c9151 reduce MAX_RESTARTS to 11
the number of steps that can be followed in a CNAME chain
before terminating the lookup has been reduced from 16 to 11.
(this is a hard-coded value, but will be made configurable later.)

(cherry picked from commit 05d78671bb)
(cherry picked from commit dd88a4cdfc)
2024-08-20 17:35:07 +00:00
Ondřej Surý 8fca60cbb9 Use LC_ALL to override all system locales
The system tests were overriding the local locale by setting LANG to C.
This does not override the locale in case there are individual LC_<*>
variables like LC_CTYPE explicitly set.

Use LC_ALL=C instead which is the proper way of overriding all currently
set locales.
2024-08-05 09:41:57 +02:00
Ondřej Surý d3ca4be21c Add more tests for adding many RR types to the database
More reclimit tests that test various scenarios adding combinations of
priority and non-priority RR types into the database.
2024-07-29 12:27:25 +02:00
Petr ŠpačekandOndřej Surý e08f268387 Remove duplicated empty zone files
(cherry picked from commit 1456b4fc7778b851256107dbc79fb67d45f752f5)
2024-07-29 12:27:25 +02:00
Petr ŠpačekandOndřej Surý da5bac8104 masterformat: rename zone names to reflect intended meaning
(cherry picked from commit d34bfb1eeaa2f8faab80b1620b992b5495e6f88c)
2024-07-29 12:27:25 +02:00
Petr ŠpačekandOndřej Surý eb4355c9f3 Test owner name rename: a b c d e -> <number>-txt
(cherry picked from commit 6ce03f75d1935c2e1991e9c0a01c49b0099a58cb)
2024-07-29 12:27:25 +02:00
Petr ŠpačekandOndřej Surý 6516c92c07 Test variable rename i->_attempt
(cherry picked from commit 13417eb277cc8a30ee4ddbb6fc02442b0d8e6d3c)
2024-07-29 12:27:25 +02:00
Petr ŠpačekandOndřej Surý 747da63896 Test variable rename a->rrcount
(cherry picked from commit 338b45ae713cded921fd3e5494ca38bd59ff9ee8)
2024-07-29 12:27:25 +02:00
Ondřej Surý b6f6e12bbf Add test for not-loading many RRsets per name on a secondary
This tests makes sure the zone with many RRsets per name is not loaded
via XFR on the secondary server.

(cherry picked from commit 4cfeed912a5e7440f04cb088a461ff47305da2e7)
2024-07-29 12:27:25 +02:00
Ondřej Surý a36ab2eb36 Add a test for not caching large number of RRsets
Send a recursive query for a large number of RRsets, which should
fail when using the default max-types-per-name setting of 100, but
succeed when the cap is disabled.

(cherry picked from commit 7e4530f847c8dc541c5e5bf9f790deed520aaa16)
2024-07-29 12:27:25 +02:00
Ondřej Surý 89f1779bc2 Add a limit to the number of RR types for single name
Previously, the number of RR types for a single owner name was limited
only by the maximum number of the types (64k).  As the data structure
that holds the RR types for the database node is just a linked list, and
there are places where we just walk through the whole list (again and
again), adding a large number of RR types for a single owner named with
would slow down processing of such name (database node).

Add a configurable limit to cap the number of the RR types for a single
owner.  This is enforced at the database (rbtdb, qpzone, qpcache) level
and configured with new max-types-per-name configuration option that
can be configured globally, per-view and per-zone.

(cherry picked from commit 00d16211d6368b99f070c1182d8c76b3798ca1db)
2024-07-29 12:27:25 +02:00
Evan HuntandOndřej Surý 4a0fe202a9 Add a test for not caching large RRset
Send a recursive query for a large (2500 record) RRset, which should
fail when using the default max-records-per-type setting of 100, but
succeed when the cap is disabled.

(cherry picked from commit 8e3efb4e06ba68cc3f9bc5be2bacb2596bd74cb3)
2024-07-29 11:27:54 +02:00
Ondřej Surý bf0df5322c Add test for not-loading and not-transfering huge RRSets
Add two new masterformat tests - the 'huge' zone fits within the ns1
limit and loads on the primary ns1 server, but must not transfer to the
ns2 secondary, and the 'uber' zone should not even load on the primary
ns1 server.

(cherry picked from commit cee9ad81db6e5a1167b311e5c2f42cf65ba457cd)
2024-07-29 11:27:54 +02:00
Ondřej Surý f63d72fb7e Add a limit to the number of RRs in RRSets
Previously, the number of RRs in the RRSets were internally unlimited.
As the data structure that holds the RRs is just a linked list, and
there are places where we just walk through all of the RRs, adding an
RRSet with huge number of RRs inside would slow down processing of said
RRSets.

Add a configurable limit to cap the number of the RRs in a single RRSet.
This is enforced at the database (rbtdb, qpzone, qpcache) level and
configured with new max-records-per-type configuration option that can
be configured globally, per-view and per-zone.

(cherry picked from commit 3fbd21f69a1bcbd26c4c00920e7b0a419e8762fc)
2024-07-28 16:55:28 +02:00
Aram SargsyanandNicki Křížek fbbb9f2f6e Adapt the upforwd test to the SIG(0) removal
Change the check so that update with SIG(0) is expected to fail.

(cherry picked from commit 5f7558f6dbb0527c08caf281299245ab8de268cd)
2024-07-24 13:15:29 +02:00
Petr ŠpačekandNicki Křížek c448b8be0d Adapt the tsiggss test to the SIG(0) removal
Test that SIG(0) signer is NOT sent to the external socket for
authorization. It MUST NOT be considered a valid signature by
any chance.

Also check that the signer's name does not appear in authsock.pl
output.

(cherry picked from commit cf8838085905171fbc00747eb210e8b8284ca0e1)
2024-07-24 13:15:29 +02:00
Aram SargsyanandNicki Křížek c21a152445 Enable stdout autoflush in authsock.pl
With enabled buffering the output gets lost when the process
receives a TERM signal. Disable the buffering.

(cherry picked from commit a0311dfb6e2a51f89dfa8b200b96a0f4675fb654)
2024-07-24 13:15:29 +02:00
Ondřej SurýandNicki Křížek c5ebda6deb Make the resolver qtype ANY test order agnostic
Instead of relying on a specific order of the RR types in the databases
pick the first RR type as returned from the cache.

(cherry picked from commit 58f660cf2b)
2024-07-24 12:12:03 +02:00
Michal Nowak 99eb2ebaa9 Update sources to Clang 18 formatting
(cherry picked from commit f454fa6dea)
2024-04-23 16:59:58 +02:00
Michał Kępień 82cc9e88d3 Fix check interaction in the "serve-stale" test
Commit f351c21034 modified the
"serve-stale" system test by adding the ns3/named9.conf.in configuration
file and making the ns3 named instance load that file near the end of
the test.  However, ns3/named9.conf.in changes the
stale-answer-client-timeout setting to a very low value, which affects
all subsequent checks in tests.sh (rather than just the check that needs
the low value to be set) and may cause false positives.  Fix by
reloading configuration from ns3/named8.conf.in as soon as the check
using a very low stale-answer-client-timeout value is finished.

(cherry picked from commit cd64a3747b)
2024-03-28 18:56:35 +01:00
Mark AndrewsandMichał Kępień f351c21034 Check dns64 + server-stale short timeout
Check that named correctly returns a synthesized DNS64 answer when the
server stale timer triggers for the A lookup.  Use a small value for
stale-answer-client-timeout (2ms) and delay the A response by 1 second.

(cherry picked from commit 2eee1e1761)
2024-03-28 15:28:55 +01:00
Mark AndrewsandMichał Kępień adad957108 Checking nxdomain-redirect against built-in RFC-1918 zone
Check that RFC 1918 leak detection does not trigger an assertion
when nxdomain redirection is enabled in the server but not for the
RFC 1918 reverse namespace.

(cherry picked from commit 2789906ce4)
2024-03-28 13:15:45 +01:00
Mark AndrewsandMichal Nowak 0f4cdcde03 IO::Socket::INET6 has been replaced by IO::Socket::IP
IO::Socket::INET6 is no longer being maintained and its functionality
has been replaced by IO::Socket::IP.

(cherry picked from commit d1983adc22)
(cherry picked from commit fff8de8430)
2024-03-26 13:43:37 +01:00
Tom Krizek 0c50eb1ac3 Export variable in resolver system test
Variable assignment when calling subroutines might not be portable.
Notably, it doesn't work with FreeBSD shell, where the value of HOME
would be ignored in this case.

Since the commands are already executed in a subshell, export the HOME
variable to ensure it is properly handled in all shells.

(cherry picked from commit 86a192cece)
2024-03-21 14:16:16 +01:00
Mark Andrews 32d295e1dd Add RESOLVER.ARPA to the built in empty zones
RFC 9462 adds RESOLVER.ARPA to the list of built in empty zones.

(cherry picked from commit 49561277de)
2024-03-21 11:23:05 +11:00
Matthijs Mekking 0040947ae7 Test secure chain that includes inactive KSK
Add a regression test case for the scenario where a secure chain of
trust includes an inactive KSK, that is a KSK that is not signing the
DNSKEY RRset.

(cherry picked from commit f0bfd276e0)
2024-03-12 11:50:08 +01:00
Michał Kępień 52fe0b6be7 Account for changes to struct dns_rbtnode
Commit 540a5b5a2c modified the definition
of struct dns_rbtnode.  Doing that changes the layout of map-format zone
files.  Bump MAPAPI and update the offsets used in map-format zone file
checks in the "masterformat" system test, as these changes were
inadvertently omitted from the aforementioned change.
2024-03-07 09:42:38 +01:00
Ondřej SurýandMichał Kępień 540a5b5a2c Create a second pruning task for rbtdb with unlimited quantum
Previously, rbtdb->task had quantum of 1 because it was originally used
just for freeing RBTDB contents, which can happen on a "best effort"
basis (does not need to be prioritized).  However, when tree pruning was
implemented, it also started sending events to that task, enabling the
latter to become clogged up with a significant event backlog because it
only pruned a single RBTDB node per event.

To prioritize tree pruning (as it is necessary for enforcing the
configured memory use limit for the cache memory context), create a
second task with a virtually unlimited quantum (UINT_MAX) and send the
tree-pruning events to this new task, to ensure that all nodes scheduled
for pruning will be processed before further nodes are queued in a
similar fashion.

This change enables dropping the prunenodes list and restoring the
originally-used logic that allocates and sends a separate event for each
node to prune.

(cherry picked from commit 231b2375e5)
2024-03-06 18:43:49 +01:00
Evan Hunt 0a019e8f9e move RRL broken-config check to checkconf
the RRL test included a test case that tried to start named with
a broken configuration.  the same error could be found with
named-checkconf, so it should have been tested in the checkconf
system test.

(cherry picked from commit 05398c1488)
(cherry picked from commit 046b62bf02)
2024-03-01 16:36:51 -08:00
Mark Andrews 32b1d00afb Split the first masterfile test into 3
Additionally read the correct zone for BIND 8 ttl checks

(cherry picked from commit e02b73c7a4)
2024-02-28 12:26:31 +11:00
Michał Kępień b56c18b477 Merge tag 'v9.16.48' into bind-9.16
BIND 9.16.48
2024-02-14 13:41:33 +01:00
Ondřej SurýandMichał Kępień b9c10a194d Add a system test for mixed-case data for the same owner
We were missing a test where a single owner name would have multiple
types with a different case.  The generated RRSIGs and NSEC records will
then have different case than the signed records and message parser have
to cope with that and treat everything as the same owner.

(cherry picked from commit a114042059)
2024-02-11 11:57:58 +01:00
Tom Krizek be735330bb Use a single local port for ditch.pl
The ditch.pl script is used to generate burst traffic without waiting
for the responses. When running other tests in parallel, this can result
in a ephemeral port clash, since the ditch.pl process closes the socket
immediately. In rare occasions when the message ID also clashes with
other tests' queries, it might result in an UnexpectedSource error from
dnspython.

Use a dedicated port EXTRAPORT8 which is reserved for each test as a
source port for the burst traffic.

(cherry picked from commit 339fa5690a)
2024-02-08 13:46:52 +01:00
Ondřej Surý f654ed7a05 Optimize cname_and_other_data to stop as earliest as possible
Stop the cname_and_other_data processing if we already know that the
result is true.  Also, we know that CNAME will be placed in the priority
headers, so we can stop looking for CNAME if we haven't found CNAME and
we are past the priority headers.

(cherry picked from commit 3f774c2a8a)
2024-02-08 09:42:52 +01:00
Mark Andrews aa8f3363d4 Capture the resolver's startup and shutdown logging
Also set the debugging to 99.

(cherry picked from commit 3651c58a6a)
2024-02-07 12:20:25 +11:00
Tom Krizek 1878a91a30 Handle dig timing out gracefully in upforwd
(cherry picked from commit 7b77574b6d)
2024-01-09 13:43:27 +01:00
Tom Krizek 43f9261157 Handle dig timing out gracefully in staticstub
(cherry picked from commit cc7c4760aa)
2024-01-09 13:43:26 +01:00
Tom Krizek 758f03f4f8 Handle dig timing out gracefully in sortlist
(cherry picked from commit 2341934f7d)
2024-01-09 13:43:26 +01:00
Tom Krizek 80a2e890ad Handle dig timing out gracefully in rpz
(cherry picked from commit 99799fba60)
2024-01-09 13:43:26 +01:00