Commit Graph

5900 Commits

Author SHA1 Message Date
Matthijs Mekking
60bd3bc051 Revert "fix: chg: Improve performance when looking for the closest encloser"
The 9.18 code does not have the rbtdb refactoring. Rather than
backporting from MR !9611, this reverts directly from commit
5d81a258e3.
2024-10-10 14:26:13 +02:00
Michal Nowak
aa7087ca9b Replace dns.query module with isctest.query
(cherry picked from commit dfec69b4a2)
2024-10-01 16:33:42 +02:00
Michal Nowak
a5cc3bfbe3 Add isctest.check.notimp()
(cherry picked from commit a2d2d9c0d3)
2024-10-01 12:06:47 +00:00
Michal Nowak
077b2b56d9 Report expected and last returned rcode on query timeout
Sometimes it's useful to see what was the server returning that did not
match the expected rcode.

(cherry picked from commit 4cb52f072e)
2024-10-01 12:06:47 +00:00
Mark Andrews
1a68cc6cfa Add examples of WALLET records
(cherry picked from commit 9b358e6e8b)
2024-09-25 12:07:57 +00:00
Mark Andrews
314ff56081 Add the new record type WALLET (262)
This provides a mapping from a domain name to a cryptographic
currency wallet and is a clone of TXT.

(cherry picked from commit b919b9b4f3)
2024-09-25 12:07:57 +00:00
Mark Andrews
a0522653ca Check read value in upforwd/ans4
The ans4 server wasn't shutting down cleanly sometimes.  Check that
read returns the expected value for the message length or exit read
loop.

(cherry picked from commit 21baad0a8f)
2024-09-24 09:22:22 +00:00
Michal Nowak
20cab85f41 Print correct udp/tcp function name in generic_query()
(cherry picked from commit 1c637e96d1)
2024-09-23 15:40:44 +00:00
Michal Nowak
86c7bb4a0c Downgrade "timeout" and "attempts" arguments in shutdown
The shutdown system test sends queries when named is shutting down, not
in an attempt to get answers but to destabilize the server into a crash.
With isctest.query.udp() defaulting to try up to ten times with a
ten-second timeout to get a response we don't care about from a likely
terminated server, we make the test run much longer than needed because
of retries and long timeouts.

(cherry picked from commit 463ab2f3f5)
2024-09-23 15:40:44 +00:00
Aram Sargsyan
904940167c Update the resolver system test
The 'bin/tests/system/resolver.c' tool used in the resolver system
test uses the 'dns_client_setservers()' function, which sets up a
resolution in 'forward only' mode. Since a bug was just fixed in
'fctx_getaddresses()', two expected failures in the resolver system
test now fail with a different failure message, because
'fctx_getaddresses()' returns 'ISC_R_FAILURE' instead of
'res->quotaresp[dns_quotatype_server]', which is 'DNS_R_SERVFAIL'
by default. Change the expected failure message.
2024-09-18 01:25:01 +00:00
Aram Sargsyan
8f617d7971 Add a statistics channel check in the forward system test
Check that the fix in the previous commit works and that the
'ServerQuota' counter in the statistics channel is still unset
after a SERVFAIL result in a 'forward only' zone.

(cherry picked from commit 81b3c5d908)
2024-09-18 01:25:01 +00:00
Michal Nowak
6addaef7fc Extract dns.rcode compatibility code to isctest.compat
(cherry picked from commit 8b55d0709d)
2024-09-12 19:48:31 +02:00
Michal Nowak
aa302dfe24 Turn off deadline for wildcard tests
Tests that query BIND need much longer deadline to account for retries,
the default 200ms won't work.

(cherry picked from commit d2e0043ec3)
2024-09-12 19:48:31 +02:00
Michal Nowak
4e3cc58eba Extract "custom" named instances support to isctest.run module
(cherry picked from commit 2cec1de43b)
2024-09-12 19:48:31 +02:00
Michal Nowak
1220435e27 Rework query functions to retry by default
(cherry picked from commit 5929ba0f54)
2024-09-12 18:35:59 +02:00
Michal Nowak
f082e6800b Replace dns.resolver module in system tests
(cherry picked from commit bfe338b965)
2024-09-12 18:35:59 +02:00
Mark Andrews
047fa205d7 Only configure statistics-channels if supported
(cherry picked from commit d0c8c6d7ef)
2024-09-12 13:39:36 +10:00
Mark Andrews
3333f9c94d Properly detect when libxml2 or json-c is not available
(cherry picked from commit 7de939609b)
2024-09-12 09:18:38 +10:00
Nicki Křížek
b42420ab09 Skip some tests on problematic OpenSSL version
The keyfromlabel and enginepkcs11 system tests are affected by a bug in
OpenSSL 3.0.13, currently shipped by debian bookworm.
2024-09-10 15:50:21 +02:00
JINMEI Tatuya
a93b6f2040 allow IXFR-to-AXFR fallback on DNS_R_TOOMANYRECORDS
This change allows fallback from an IXFR failure to AXFR when the
reason is DNS_R_TOOMANYRECORDS. This is because this error condition
could be temporary only in an intermediate version of IXFR
transactions and it's possible that the latest version of the zone
doesn't have that condition. In such a case, the secondary would never
be able to update the zone (even if it could) without this fallback.

This fallback behavior is particularly useful with the recently
introduced max-records-per-type and max-types-per-name options:
the primary may not have these limitations and may temporarily
introduce "too many" records, breaking IXFR. If the primary side
subsequently deletes these records, this fallback will help recover
the zone transfer failure automatically; without it, the secondary
side would first need to increase the limit, which requires more
operational overhead and has its own adverse effect.

This change also fixes a minor glitch that DNS_R_TOOMANYRECORDS wasn't
logged in xfrin_fail.

(cherry picked from commit 7289090683)
2024-09-10 14:54:57 +02:00
Ondřej Surý
441de680c7 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:31:21 +02:00
Ondřej Surý
c8f1fa0e47 Follow the number of CPU set by taskset/cpuset
Administrators may wish to constrain the set of cores that BIND 9 runs
on via the 'taskset', 'cpuset' or 'numactl' programs (or equivalent on
other O/S), for example to achieve higher (or more stable) performance
by more closely associating threads with individual NIC rx queues. If
the admin has used taskset, it follows that BIND ought to
automatically use the given number of CPUs rather than the system wide
count.

Co-Authored-By: Ray Bellis <ray@isc.org>
(cherry picked from commit 5a2df8caf5)
2024-09-03 14:54:40 +02:00
Mark Andrews
5d81a258e3 Return partial match when requested
Return partial match from dns_db_find/dns_db_find when requested
to short circuit the closest encloser discover process.  Most of the
time this will be the actual closest encloser but may not be when
there yet to be committed / cleaned up versions of the zone with
names below the actual closest encloser.

(cherry picked from commit d42ea08f16)
2024-08-29 21:05:54 +00:00
Michal Nowak
5a802a22b5 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.

(cherry picked from commit 8e0244d300)
2024-08-29 14:41:52 +00:00
Nicki Křížek
c75d9734e7 Revert "Mark the keyfromlabel&enginepkcs11 tests as xfail"
This reverts commit ff983ed647.
2024-08-26 10:09:41 +02:00
Matthijs Mekking
9e1bed5bdb Adjust kasp system test to get keys which signed
If there is a keytag conflict between keys with different algorithms,
we need to supply what key algorithm is used so we can get the right
public key.

For clarity, print the algorithm on the found keys after 'check_keys'.

(cherry picked from commit 7bb6d82505)
2024-08-22 10:15:01 +00:00
Nicki Křížek
9a63dd7cb6 Merge tag 'v9.18.29' into bind-9.18 2024-08-21 16:36:08 +02:00
Nicki Křížek
9a154d66ed Allow rerun of unstable statschannel tests under TSAN
The test_traffic_json and test_traffic_xml occasionally fail when
running under TSAN. This happens in CI and is most likely a result of
some instability that doesn't seem to be easily reproduced.

(cherry picked from commit ec2fc7680a)
2024-08-19 17:54:27 +02:00
Nicki Křížek
7f057b379d Use python3 in shebang lines for util scripts
Some distributions (notably, debian bookworm) have deprecated the
`python` interpreter in favor of `python3`. Since our scripts are
python3 anyway, use the proper numbered version in shebang to make
scripts easily executable.

(cherry picked from commit 480dcdef9a)
2024-08-14 15:43:39 +00:00
Aram Sargsyan
565731ceea Test that 'rndc reconfig' reconfigures catz member zones
Catalog zone member zones should be reconfigured as all the other
zones during a reconfiguration. Test it by checking whether the newly
added allow-query setting affects a member zone.

(cherry picked from commit cd04b89dba85781c194f22ce6fe358c972a14758)
2024-08-09 08:52:25 +02:00
Evan Hunt
2e04f0380c 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)
2024-08-07 15:36:16 -07:00
Evan Hunt
a11367ade3 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)
2024-08-07 15:36:15 -07:00
Evan Hunt
dd88a4cdfc 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)
2024-08-07 15:36:14 -07:00
Nicki Křížek
fc87a96e07 Make hypothesis optional for system tests
Ensure that system tests can be executed without Python hypothesis
package.

(cherry picked from commit e6a7695600)
2024-08-07 11:00:24 +00:00
Ondřej Surý
236de53c52 Use EXIT_SUCCESS and EXIT_FAILURE
Instead of randomly using -1 or 1 as a failure status, properly utilize
the EXIT_FAILURE define that's platform specific (as it should be).

(cherry picked from commit76997983fde02d9c32aa23bda30b65f1ebd4178c)
2024-08-06 15:19:06 +02:00
Ondřej Surý
e494854523 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:42:50 +02:00
Štěpán Balážik
4196b92f02 Add a helper for uncompressed length of dnspython's dns.name.Name
This is useful for generating using hypothesis but also for other
cases.

(cherry picked from commit 9584a7bdcd)
2024-08-02 11:22:56 +00:00
Štěpán Balážik
df01e5d788 Move hypothesis strategies to isctest for later reuse
`isctest.hypothesis` seems to be a nice place to have these.

(cherry picked from commit bb1e5cfa09)
2024-08-02 11:22:56 +00:00
Štěpán Balážik
d0288545f3 Disable deadlines for hypothesis tests when running in CI
The times it takes to run tests CI vary significantly enough
that it makes hypothesis test reach their deadlines and fail randomly
marking the tests as flaky.

This commit disables the deadlines when running in CI.

(cherry picked from commit f55cacbbfd)
2024-08-02 11:22:56 +00:00
Štěpán Balážik
2ae0e31138 Test nested wildcard special case in the respective system test
See final remark of RFC 4592 2.2.1. for details.

(cherry picked from commit 9943172566)
2024-08-02 11:22:56 +00:00
Štěpán Balážik
132357101e Expand the wildcard system test with wider use of hypothesis
The queries are now generated more generally (i. e. they have
multiple labels, etc.).

(cherry picked from commit d0cfbd398e)
2024-08-02 11:22:56 +00:00
Štěpán Balážik
f78e41c231 Add hypothesis strategies for generating DNS names and company
The most important being `dns_names` that generates dns.name.Name
objects based on given paramaters.

No guarantees are given when it comes the uniformity of generated
samples, however it plays nicely with the hypothesis' shrinking
algorithm.

Once we use hypothesis more widely (in at least one more test) this file
should be moved for it to be reused easily.

(cherry picked from commit 5d738cd9ed)
2024-08-02 11:22:56 +00:00
Štěpán Balážik
3aac716a46 Extend isctest package with more utility functions
Check for more rcodes and various properties needed in the wildcard
test. Add a `name` module for various dns.name.Name operations (with
`prepend_label` function only now).

Expose `timeout` as a parameter of `query.tcp`/`query.udp`.

(cherry picked from commit e7d46ad8ba)
2024-08-02 11:22:56 +00:00
Mark Andrews
cb180bf4ea Reset 'ret' to zero at start of tests
(cherry picked from commit 2dc2abd00d)
2024-08-02 03:01:48 +00:00
Mark Andrews
80a21e75b8 check 'update-policy 6to4-self' over IPv6
(cherry picked from commit 3b0de4773b)
2024-08-02 00:09:17 +00:00
Mark Andrews
799f677313 check 'update-policy 6to4-self' over IPv4
(cherry picked from commit b28e5ff721)
2024-08-02 00:09:17 +00:00
Mark Andrews
4649e85e3b Test that false positive "success resolving" is not logged
(cherry picked from commit 111e285214)
2024-08-01 15:58:16 +10:00
Mark Andrews
4eb6db47ac Test yaml output with yaml specials
(cherry picked from commit fadf461761)
2024-08-01 03:48:13 +00:00
Mark Andrews
de4a087673 resolver system test didn't record all failures
(cherry picked from commit 5843b29f47)
2024-08-01 12:41:45 +10:00
Mark Andrews
a8d86f0531 Check invalid alpn empty value
(cherry picked from commit fa35c67301)
2024-08-01 01:10:53 +00:00