2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

40278 Commits

Author SHA1 Message Date
Artem Boldariev
2020dce326 Extend TLS Stream unit suite with PROXYv2 related tests
This commit adds a set of tests which help to verify that TLS Stream
works as expected on top of PROXY Stream.
2023-12-06 15:15:24 +02:00
Artem Boldariev
4437096ba0 Make it possible to use TLS Stream on top of PROXY Stream
This commit modifies TLS Stream to make it possible to use over PROXY
Stream. That is required to add PROVYv2 support into TLS-based
transports (DNS over HTTP, DNS over TLS).
2023-12-06 15:15:24 +02:00
Artem Boldariev
4330014fce PROXY Stream: add unit test suite
This commit adds a specialised test suite for the PROXY Stream
transport by reusing most of the testing code from other unit tests
for other stream-based transports.
2023-12-06 15:15:24 +02:00
Artem Boldariev
d119d666b3 PROXY Stream transport
This commit adds a new stream-based transport with an interface
compatible with TCP. The transport is built on top of TCP transport
and the new PROXYv2 handling code. Despite being built on top of TCP,
it can be easily extended to work on top of any TCP-like stream-based
transport. The intention of having this transport is to add PROXYv2
support into all existing stream-based DNS transport (DNS over TCP,
DNS over TLS, DNS over HTTP) by making the work on top of this new
transport.

The idea behind the transport is simple after accepting the connection
or connecting to a remote server it enters PROXYv2 handling mode: that
is, it either attempts to read (when accepting the connection) or send
(when establishing a connection) a PROXYv2 header. After that it works
like a mere wrapper on top of the underlying stream-based
transport (TCP).
2023-12-06 15:15:24 +02:00
Artem Boldariev
7d9a8ddc00 Add PROXY header handling unit test suite
The commit adds a fairly comprehensive unit test suite for our new
PROXYv2 handling code. The unit tests suite ensures both the
correctness of the code and ensures that the part responsible for
handling incoming headers is very strict regarding what to accept as
valid.
2023-12-06 15:15:24 +02:00
Artem Boldariev
2c76717881 Add PROXYv2 header utilities
This commit adds a set of utilities for dealing with PROXYv2 headers,
both parsing and generating them. The code has no dependencies from
the networking code and is (for the most part) a "separate library".

The part responsible for handling incoming PROXYv2 headers is
structured as a state machine which accepts data as input and calls a
callback to notify the upper-level code about the data processing
status.

Such a design, among other things, makes it easy to write a thorough
unit test suite for that, as there are fewer dependencies as well as
will not stand in the way of any changes in the networking code.
2023-12-06 15:15:24 +02:00
Matthijs Mekking
2653e668e3 Merge branch '4476-fix-cid-469729' into 'main'
CID 469729: Remove leftover return call

Closes #4476

See merge request isc-projects/bind9!8547
2023-12-06 12:51:24 +00:00
Matthijs Mekking
d08f293f11 CID 469729: Remove leftover return call
This 'return (ret);' call can never be reached and should have been
removed as part of commit 75e0d394dd2147a0b07524521c084a71801e4eee.
2023-12-06 10:51:15 +01:00
Michal Nowak
c4fcdbefc5 Merge branch 'mnowak/drop-openbsd-system-test-job' into 'main'
Drop OpenBSD system test CI job

See merge request isc-projects/bind9!8535
2023-12-05 15:21:57 +00:00
Michal Nowak
27d51d6ab6
Run "make check" in system:gcc:sid:amd64
Following the discontinuation of the OpenBSD system test in CI, transfer
the execution of the system test using the "make check" method to the
Debian "sid" system test CI job.
2023-12-05 16:14:31 +01:00
Michal Nowak
2ab292c169
Drop OpenBSD system test CI job
The system tests on OpenBSD consistently exhibit lower stability
compared to our other CI platforms. Some of these challenges are
intrinsic to the system test itself and require attention. However,
there are OpenBSD issues, which seem to be more widespread on this
platform than others. In our daily CI pipelines, OpenBSD system tests
often bear the brunt of all failed CI jobs.

It's possible that our OpenBSD CI image could be optimized, but we
currently lack the domain-specific knowledge needed to make
improvements.
2023-12-05 16:14:31 +01:00
Matthijs Mekking
e67bbe5c9a Merge branch '4363-lower-max-nsec3-iterations' into 'main'
Lower NSEC3 iteration limit to 50

Closes #4363

See merge request isc-projects/bind9!8515
2023-12-05 14:59:48 +00:00
Matthijs Mekking
a759f7f33c Change max NSEC3 iterations in unit tests to 50
The nsec3 unit test needs to be adjusted to accept a lower maximum value
for NSEC3 iterations.
2023-12-05 14:58:58 +00:00
Matthijs Mekking
294943ba7c Add release note and CHANGES for #4363
This protocol change is definitely worth mentioning.
2023-12-05 14:58:58 +00:00
Matthijs Mekking
abdaa77303 Change max NSEC3 iterations in system tests to 50
The dnssec and nsupdate system tests need to be adjusted to accept
a lower maximum value for NSEC3 iterations.
2023-12-05 14:58:58 +00:00
Matthijs Mekking
ff4201e388 Lower the maximum allowed NSEC3 iterations to 50
BIND 9 will now treat the response as insecure when processing NSEC3
records with iterations larger than 50.

Earlier, we limited the number of iterations to 150 (in #2445).

RFC 9276 says: Because there has been a large growth of open (public)
DNSSEC validating resolvers that are subject to compute resource
constraints when handling requests from anonymous clients, this
document recommends that validating resolvers reduce their iteration
count limits over time. Specifically, validating resolver operators and
validating resolver software implementers are encouraged to continue
evaluating NSEC3 iteration count deployment trends and lower their
acceptable iteration limits over time.

After evaluation, we decided that the next major BIND release should
lower the maximum allowed NSEC3 iterations to 50, which should be
fine for 99,87% of the domain names.
2023-12-05 14:58:58 +00:00
Matthijs Mekking
3c08fbc79f Change NSEC3 iterations to 0 in system tests
The system tests need to be updated because non-zero iterations are no
longer accepted.

The autosign system test changes its iterations from 1 to 0 in one
test case. This requires the hash to be updated.

The checkconf system test needs to change the iterations in the good
configuration files to 0, and in the bad ones to 1 (any non-zero value
would suffice, but we test the corner case here). Also, the expected
failure message is change, so needs to be adjusted.

The nsec3 system test also needs iteration configuration adjustments.
In addition, the test script no longer needs the ITERATIONS environment
variable.

In the process of updating the system tests, I noticed an error
in the dnssec-policy "nsec3-other", where the salt length in one
configuration file is different than in the other (they need to be
the same). Furthermore, the 'rndc signing -nsec3param' test case
is operated on the zone 'nsec-change.kasp', so is moved so that the
tests on the same zone are grouped together.
2023-12-05 14:58:58 +00:00
Matthijs Mekking
75e0d394dd dnssec-policy: refuse to load non-zero iterations
According to RFC 9276, if NSEC3 must be used, then an iterations count
of 0 MUST be used to alleviate computational burdens.
2023-12-05 14:58:58 +00:00
Tom Krizek
336d99f121 Merge branch '4452-pytest-improve-assert-messages' into 'main'
Improve assert messages in pytests

Closes #4452

See merge request isc-projects/bind9!8518
2023-12-05 13:00:07 +00:00
Tom Krizek
5de2b07daa
Refactor statschannel test to use isctest
Use common utility functions in favor of duplicating the code in a
test-specific file.
2023-12-05 13:26:49 +01:00
Tom Krizek
cba5a1d62c
Add system test utility package isctest
Create a utility package for code shared by the python tests. The
utility functions should use reasonable defaults and be split up into
modules according to their functionality.

Ensure assert rewriting is enabled for the modules to get the most
useful output from pytest.
2023-12-05 13:26:49 +01:00
Tom Krizek
f0481c8600
Simplify statsport fixture in statschannel test
The ports fixture provides the required port numbers already and there's
no need to get the port number from environment.
2023-12-05 13:26:49 +01:00
Tom Krizek
a57af8163a
Allow assertion message rewrite in statschannel test
By default, the useful assertion message rewrite is used by pytest for
test modules only. Since another module is imported with shared
functionality, ensure it has pytest's assertion message rewriting
enabled to obtain more debug information in case it fails.
2023-12-05 13:26:49 +01:00
Tom Krizek
fc295b2b5d
Move helper functions in statchannel into single file
Since dnspython is now a required dependency, there's no need to keep
these two helper files separate.
2023-12-05 13:26:49 +01:00
Tom Krizek
767f4670c6
Add assert message to test doth/stress_http_quota.py
This file is executed outside of pytest with pure python, which doesn't
do any AssertionError message rewriting like pytest. Ensure the assert
messages in this file provide a useful debug message.
2023-12-05 13:26:43 +01:00
Mark Andrews
64ef6968f3 Merge branch '4462-crash-on-shutdown-when-dnssec-validation-is-running-ensure-isc_mempool_getallocated-namepoolp' into 'main'
Resolve "Crash on shutdown when DNSSEC validation is running: ENSURE(isc_mempool_getallocated(*namepoolp) == 0) failed"

Closes #4462 and #4384

See merge request isc-projects/bind9!8526
2023-12-04 22:55:50 +00:00
Mark Andrews
7ee20d7d10 Destroy the message before detaching the view
With shared name memory pools (f5af981831ea8a707090c1b09a47c25b75d86b5a)
the message needs to be destroyed before the view is detached which
in turn detaches the resolver which checks that all resources have
been returned.
2023-12-04 22:00:25 +00:00
Mark Andrews
f491845f5a Merge branch '4457-dig-crashes-after-sigint-if-there-are-multiple-queries' into 'main'
Resolve "dig crashes after SIGINT if there are multiple queries"

Closes #4457

See merge request isc-projects/bind9!8527
2023-12-04 21:10:00 +00:00
Mark Andrews
da8a269daf Add CHANGES note for [GL #4457] 2023-12-05 07:31:19 +11:00
Mark Andrews
69f7048c89 Handle ISC_R_SHUTTINGDOWN in dighost.c:recv_done
When dighost.c:recv_done is called with ISC_R_SHUTTINGDOWN cancel
all outstanding lookups as this indicates SIGTERM was recieved.
2023-12-05 07:30:52 +11:00
Michal Nowak
c21fbed5d4 Merge branch '3198-add-rr-record' into 'main'
Add support for recording named with rr

Closes #3198

See merge request isc-projects/bind9!8479
2023-12-04 18:53:07 +00:00
Michał Kępień
422286e9c2
Do not daemonize named instances with custom args
This enables the "logfileconfig" and "rpzextra" system tests to pass
when named is started under the supervision of rr (USE_RR=1).
2023-12-04 18:40:52 +01:00
Michal Nowak
920af590d1
Fix process listing string of rpzextra ns3 server 2023-12-04 18:39:28 +01:00
Michal Nowak
e088e8a992
Add support for recording named runtime with rr
The traces of the named process are stored in the directory
$system_test/nsX/named-Y/.
2023-12-04 18:38:29 +01:00
Ondřej Surý
658d62a6f4
Remove support for running system tests under Valgrind
Valgrind support has been scarcely used.
2023-12-04 18:27:51 +01:00
Michal Nowak
d05c2e7ff4 Merge branch 'mnowak/freebsd-14.0' into 'main'
Add FreeBSD 14.0

See merge request isc-projects/bind9!8520
2023-12-04 15:26:56 +00:00
Michal Nowak
9152fc40a8
Add FreeBSD 14.0 2023-12-04 15:42:24 +01:00
Arаm Sаrgsyаn
acf55e125e Merge branch '1229-dig-no-yaml-output-when-host-is-unreachable' into 'main'
Resolve "No YAML output in dig when host is unreachable"

Closes #1229

See merge request isc-projects/bind9!8501
2023-12-04 10:38:46 +00:00
Aram Sargsyan
ed879c41f2 Add a CHANGES note for [GL #1229] 2023-12-04 10:38:16 +00:00
Aram Sargsyan
4d529ee12a Emit "no servers could be reached" also for UDP setup failure
When all the servers are exhausted for UDP setup emit "no servers
could be reached" in udp_ready(). This message can also be emitted
for a recv_done() error and for TCP connection failure similarly.
2023-12-04 10:38:16 +00:00
Petr Špaček
2a14fa0a65 Merge branch '4417-stale-hyperlinks-in-the-arm' into 'main'
Fix stale hyperlinks in the ARM

Closes #4417

See merge request isc-projects/bind9!8525
2023-12-04 10:00:57 +00:00
Suzanne Goldlust
15eea792b9 Fix broken link to TLD DNSSEC stats 2023-12-04 10:00:30 +00:00
Suzanne Goldlust
1482f5b1ed Fix broken link to OMB memo 2023-12-04 10:00:30 +00:00
Tom Krizek
ae349ef2e8 Merge branch '4251-remove-legacy-test-runner' into 'main'
Remove legacy system test runner

Closes #4251

See merge request isc-projects/bind9!8514
2023-12-01 14:21:34 +00:00
Tom Krizek
1e181cf61d
Remove -U 4 from system tests
This option doesn't appear to be needed for any of the tests, so remove
it to keep things simple.
2023-12-01 14:03:35 +01:00
Tom Krizek
519e77d067
Add CHANGES note for [GL #4251] 2023-12-01 14:03:34 +01:00
Tom Krizek
fba295600b
Update system test documentation
Rewrite and reorganize the test documentation to focus on the pytest
runner, omit any mentions of the legacy runner which are no longer
relevant, and mention a few pytest tricks.
2023-12-01 14:03:33 +01:00
Tom Krizek
3e26d99c3c
Remove obsolete system test lists
These were used by deleted legacy runner utility scripts.
2023-12-01 13:47:29 +01:00
Tom Krizek
910440d9b6
Remove legacy runner control scripts
These scripts have been used exclusively by the legacy test runner and
they're no longer needed.
2023-12-01 13:47:27 +01:00
Ondřej Surý
235659b95a Merge branch '4451-use-only-single-method-for-overmem-condition' into 'main'
Refactor the handling of isc_mem overmem condition

Closes #4451

See merge request isc-projects/bind9!8523
2023-11-29 13:21:09 +00:00