Commit Graph

10441 Commits

Author SHA1 Message Date
Michał Kępień
7b0e57095a Merge tag 'v9_16_37' into v9_16
BIND 9.16.37
2023-01-25 21:34:55 +01:00
Ondřej Surý
e241a3f4db Don't use reference counting in isc_timer unit
The reference counting and isc_timer_attach()/isc_timer_detach()
semantic are actually misleading because it cannot be used under normal
conditions.  The usual conditions under which is timer used uses the
object where timer is used as argument to the "timer" itself.  This
means that when the caller is using `isc_timer_detach()` it needs the
timer to stop and the isc_timer_detach() does that only if this would be
the last reference.  Unfortunately, this also means that if the timer is
attached elsewhere and the timer is fired it will most likely be
use-after-free, because the object used in the timer no longer exists.

Remove the reference counting from the isc_timer unit, remove
isc_timer_attach() function and rename isc_timer_detach() to
isc_timer_destroy() to better reflect how the API needs to be used.

The only caveat is that the already executed event must be destroyed
before the isc_timer_destroy() is called because the timer is no longet
attached to .ev_destroy_arg.

(cherry picked from commit ae01ec2823)
2023-01-19 11:28:10 +01:00
Ondřej Surý
235ce6c888 Commit the change of view for view->managed_keys
When we change the view in the view->managed_keys, we never commit the
change, keeping the previous view possibly attached forever.

Call the dns_zone_setviewcommit() immediately after changing the view as
we are detaching the previous view anyway and there's no way to recover
from that.

(cherry picked from commit 7e8b53720d)
2023-01-17 22:48:37 +01:00
Tom Krizek
7139e297b2 Fix feature detection for pytest markers in tests
The condition was accidentally reversed during refactoring in
9730ac4c56 . It would result in skipped
tests on builds with proper support and false negatives on builds
without proper feature support.

Credit for reporting the issue and the fix goes to Stanislav Levin.

(cherry picked from commit 473cb530f4)
2023-01-17 14:49:38 +01:00
Evan Hunt
8c78511e9a test failure conditions
verify that updates are refused when the client is disallowed by
allow-query, and update forwarding is refused when the client is
is disallowed by update-forwarding.

verify that "too many DNS UPDATEs" appears in the log file when too
many simultaneous updates are processing.

(cherry picked from commit b91339b80e)
2023-01-12 12:21:36 +01:00
Evan Hunt
7fe2204a2e add a configuration option for the update quota
add an "update-quota" option to configure the update quota.

(cherry picked from commit f57758a730)
2023-01-12 12:21:36 +01:00
Evan Hunt
35711a29e5 add an update quota
limit the number of simultaneous DNS UPDATE events that can be
processed by adding a quota for update and update forwarding.
this quota currently, arbitrarily, defaults to 100.

also add a statistics counter to record when the update quota
has been exceeded.

(cherry picked from commit 7c47254a14)
2023-01-12 12:21:36 +01:00
Matthijs Mekking
0656395f25 Test deprecate dscp configuration
Add 'dscp' token and 'option' to deprecated.conf. It should trigger warnings
(except when deprecation warnings are being ignored).
2023-01-10 11:16:18 -08:00
Evan Hunt
0b40df8f8a deprecate dscp configuration
This commit deprecates the "dscp" configuration option and "dscp"
parameters to source-address configuration options (query-source,
transfer-source, etc.

(Note that the DSCP feature has not been fully operational since
the network manager was introduced in 9.16.0; outgoing DSCP values
can be configured, but incoming DSCP values are not detected.)
2023-01-10 11:16:18 -08:00
Aram Sargsyan
869abb768b Add serve-stale CNAME check with stale-answer-client-timeout off
Prime the cache with the following records:

    shortttl.cname.example.	1	IN	CNAME	longttl.target.example.
    longttl.target.example.	600	IN	A	10.53.0.2

Wait for the CNAME record to expire, disable the authoritative server,
and query 'shortttl.cname.example' again, expecting a stale answer.

(cherry picked from commit 537187bf2f)
2023-01-09 13:57:43 +01:00
Tony Finch
01788b8852 Don't crash when rndc delzone encounters a catz member
Try to remove the zone from the NZF config only if it was
dynamically added but not by a catalog zone.

(cherry picked from commit 9fa20d6f6c)
2023-01-04 18:04:53 +00:00
Tom Krizek
28b6171424 Don't check algorithm support during configure step
The 9.16 version of ./configure calls bin/tests/system/cleanall.sh
unless --without-make-clean is used. The cleanall.sh script then
includes bin/tests/system/conf.sh, which includes
bin/tests/system/conf.sh.common. At that point, dnssec-keygen which is
used to detect algorithm support isn't compiled, so it can't be used.

More importantly, algorithm selection for system tests during the
./configure phase is irrelevant, so it can be safely skipped.
2022-12-23 12:37:48 +01:00
Tom Krizek
6950dfe003 Disable test algorithm randomization if Python is missing
This change is motivated by the fact that our Windows CI image doesn't
have a Python interpreter.
2022-12-23 12:37:46 +01:00
Tom Krizek
527c69e2c9 Make Perl interpreter required for system tests
This change has no practical impact, as Perl was already required for
all system tests, this check only makes it more explicit.

(cherry picked from commit 084d72d1d5)

conf.sh.win32 was modified in addition of the mentioned commit.
2022-12-22 15:54:19 +01:00
Tom Krizek
2b93b47c32 Ensure test interpreters are defined before common config
Nothing from conf.sh.common is required to set these values. On the
contrary, a Python interpreter needs to be set in order to randomize the
algorithm set (which happens in conf.sh.common).

(cherry picked from commit 492992dca8)

conf.sh.win32 was modified in addition of the above mentioned commit.
2022-12-22 15:54:19 +01:00
Tom Krizek
4b32c5608a Force quiet mode when using testcrypto.sh directly
When testcrypto.sh is used as a standalone script, always use quiet mode
to avoid using undefined commands (such as echo_i) which require
inclusion of the entire conf.sh machinery.

(cherry picked from commit ba35a6df9c)
2022-12-22 15:54:17 +01:00
Tom Krizek
0eb789efba ci: disable algorithm support checking in softhsm
The algorithm support detection script doesn't seem to work when using
the SoftHSM module. For some reason, dnssec-keygen returns 'crypto
failure'. Since the tests themselves pass, this is likely to be some
bug/definiency in the test scripts that check algorithm support that get
confused by SoftHSM.

Since this issue only happens for the system:gcc:softhsm2.6 job in the
9.16 branch, use a workaround to not introduce this new feature for
this particular problematic job.
2022-12-22 15:17:41 +01:00
Tom Krizek
7324a7b5e4 Randomize algorithm selection for mkeys test
Use the ALGORITHM_SET option to use randomly selected default algorithm
in this test. Make sure the test works by using variables instead of
hard-coding values.

(cherry picked from commit f65f276f98)
2022-12-22 15:17:41 +01:00
Tom Krizek
aa5453f5e5 Set algorithms for system tests at runtime
Use the get_algorithms.py script to detect supported algorithms and
select random algorithms to use for the tests.

Make sure to load common.conf.sh after KEYGEN env var is exported.

(cherry picked from commit 69b608ee9f)
2022-12-22 15:17:41 +01:00
Tom Krizek
34497e2350 Script for random algorithm selection in system tests
Multiple algorithm sets can be defined in this script. These can be
selected via the ALGORITHM_SET environment variable. For compatibility
reasons, "stable" set contains the currently used algorithms, since our
system tests need some changes before being compatible with randomly
selected algorithms.

The script operation is similar to the get_ports.py - environment
variables are created and then printed out as `export NAME=VALUE`
commands, to be interpreted by shell. Once we support pytest runner for
system tests, this should be a fixture instead.

(cherry picked from commit 5f480c8485)
2022-12-22 15:17:41 +01:00
Tom Krizek
d45aa7581e Export env variables in system tests
Certain variables have to be exported in order for the system tests to
work. It makes little sense to export the variables in one place/script
while they're defined in another place.

Since it makes no harm, export all the variables to make the behaviour
more predictable and consistent. Previously, some variables were
exported as environment variables, while others were just shell
variables which could be used once the configuration was sourced from
another script. However, they wouldn't be exposed to spawned processes.

For simplicity sake (and for the upcoming effort to run system tests
with pytest), export all variables that are used. TESTS, PARALLEL_UNIX
and SUBDIRS variables are automake-specific, aren't used anywhere else
and thus not exported.

(cherry picked from commit 37d14c69c0)

conf.sh.win32 was modified in addition of the above mentioned commit.
2022-12-22 15:17:41 +01:00
Tom Krizek
4d74430259 Support testcrypto.sh usage without including conf.sh
The only variable really needed for the script to work is the path to
the $KEYGEN binary. Allow setting this via an environment variable to
avoid loading conf.sh (and causing a chicken-egg problem). Also make
testcrypto.sh executable to allow its use from conf.sh.

(cherry picked from commit bb1c6bbdc7)
2022-12-22 15:17:41 +01:00
Tom Krizek
28815949f8 Unify indentation level in testcrypto.sh
(cherry picked from commit 01b293b055)
2022-12-22 15:17:39 +01:00
Tom Krizek
18e2298ed3 Update tests gitignore file
The .mypy_cache was added to the system test dir gitignore, since it
should be ignored.

(cherry picked from commit 4145068bfa)
2022-12-21 13:58:24 +01:00
Tom Krizek
1283d5263b Use common name convention for pytest files
It is better to use consistent file names to avoid issue with sorting
etc.

Using underscore in filenames as opposed to dash was chosen because it
seems more common in pytest/python to use underscore for filenames.

Also rename the bin/tests/system/timeouts/tests-tcp.py file to
bin/tests/system/timeouts/tests_tcp_timeouts.py to avoid pytest name
collision (there can't be two files named tests_tcp.py).

(cherry picked from commit f6409ee6ac)
2022-12-21 13:57:58 +01:00
Tony Finch
2d5160a9b9 A couple of RPZ options were not reconfigured as expected
[bug]	Changes to the RPZ response-policy min-update-interval
	and add-soa options now take effect as expected when
	named is reconfigured. [GL #3740]

(cherry picked from commit d8a3d328db)
2022-12-16 09:54:47 +00:00
Aram Sargsyan
d510221f7e Add big SOA serial logging check into the catz system test
Check that the SOA serial numbers printed when updating a catalog zone
is represented correctly for numbers bigger than 2^31.

(cherry picked from commit de232ab446)
2022-12-15 13:48:30 +00:00
Tony Finch
bdfb06eb5a List supported DNSSEC algorithms at log level NOTICE
NOTICE matches the other startup messages. WARNING weirdly
suggests the list is a problem.

(cherry picked from commit 72f8d03cad)
2022-12-14 11:04:35 +00:00
Mark Andrews
7258465d28 Properly initialise local_ndata in isdotlocal in dig
Remove the trailing '\0' so that the length field of the dns_name_t
structure is correct.  The old data just happens to work with
dns_name_issubdomain but would fail with dns_name_equal.

(cherry picked from commit 8ce163bbc5)
2022-12-14 10:30:51 +11:00
Tom Krizek
da42fa7622 Revert "Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_16' into 'v9_16'"
This reverts commit b2a4447af8, reversing
changes made to 8924f92956.

It also removes release note 6038, since the fix is reverted.
2022-12-08 10:23:40 +01:00
Mark Andrews
4f3327cd41 Extend dns_db_allrdatasets to control interation results
Add an options parameter to control what rdatasets are returned when
iteratating over the node.  Specific modes will be added later.

(cherry picked from commit 7695c36a5d)
2022-12-08 11:20:35 +11:00
Mark Andrews
91504c1f6e Check TTLs of mixed TTL ANY response with expired records
(cherry picked from commit e49f83499a)
2022-12-08 10:46:20 +11:00
Mark Andrews
45b4446ade Add reference to +tcp for +ignore
(cherry picked from commit b5951f0411)
2022-12-08 09:34:35 +11:00
Ondřej Surý
a6847fa678 Fix missing zone_check() call in checkds test
The bad2-dswithdrawn.checkds tests were missing call to the
zone_checks() contributing to intermittent timing failures of the
checkds system test.

(cherry picked from commit 718831bfcc)
2022-12-07 19:32:01 +01:00
Mark Andrews
627a1e1f43 Check that restored catalog zone works
Using a restored catalog zone excercised a use-after-free bug.
The test checks that the use-after-free bug is gone and is just
a reasonable behaviour check in its own right.

(cherry picked from commit bca84c8601)
2022-12-07 12:55:42 +11:00
Aram Sargsyan
8fcb333622 Add serve-stale CNAME check with stale-answer-client-timeout off
Prime the cache with the following records:

    shortttl.cname.example.	1	IN	CNAME	longttl.target.example.
    longttl.target.example.	600	IN	A	10.53.0.2

Wait for the CNAME record to expire, disable the authoritative server,
and query 'shortttl.cname.example' again, expecting a stale answer.

(cherry picked from commit 21faf44ef7)
2022-12-06 13:50:54 +00:00
Tom Krizek
76d88b7f04 Add dnstap prerequisite for dnstap system test
(cherry picked from commit 9846c920c3)
2022-12-02 11:09:28 +01:00
Tom Krizek
7ff5b01d3c Use feature-test feature detection in pytests
Avoid using the environment variables for feature detection and use the
feature-test utility instead.

Remove the obsolete environment variables from conf.sh, since they're no
longer used anywhere.

(cherry picked from commit 9730ac4c56)
2022-12-02 11:05:46 +01:00
Tom Krizek
0b31a7c54c Use feature-test to detect feature support in system tests
Previously, there were two different ways to detect feature support.
Either through an environment variable set by configure in conf.sh, or
using the feature-test utility.

It is more simple and consistent to have only one way of detecting the
feature support. Using the feature-test utility seems superior the the
environment variables set by configure.

(cherry picked from commit d24fb1122e)
2022-12-02 10:56:54 +01:00
Tom Krizek
1054ad0164 Add missing options to feature-test utility
(cherry picked from commit e22d27da71)
2022-12-02 10:54:49 +01:00
Matthijs Mekking
8e629cc169 Update serve-stale test messages to include RRtype
(cherry picked from commit 45f7a15785)
2022-11-30 14:30:58 +01:00
Michal Nowak
771fed4a14 Update sources to Clang 15 formatting 2022-11-29 10:30:34 +01:00
Tom Krizek
172826bfa8 Simplify start/stop helper func in system tests
The system test should never attempt to start or stop any other server
than those that belong to that system test. Therefore, it is not
necessary to specify the system test name in function calls.

Additionally, this makes it possible to run the test inside a
differently named directory, as its name is automatically detected with
the $SYSTESTDIR variable. This enables running the system tests inside a
temporary directory.

Direct use of stop.pl was replaced with a more systematic approach to
use stop_servers helper function.

(cherry picked from commit c100308b7d)
2022-11-25 13:14:45 +01:00
Matthijs Mekking
ed8eba9180 Deprecate auto-dnssec
Deprecate auto-dnssec, add specific log warning to migrate to
dnssec-policy.

Cherry-picking triggered a lot of conflicts, so the changes
were manually picked.

(manually picked from commit f9845dd1)
2022-11-23 13:32:52 +01:00
Matthijs Mekking
4ae380a7f2 Tweak kasp system test script
The retry 3 times when checking signatures did not make sense because
at this point the input file does not change.

Raise the number of retries when checking the apex DNSKEY response to
reduce the number of intermittent failures due to unexpected delays.

(cherry picked from commit 6ef0417274)
2022-11-17 12:32:18 +01:00
Mark Andrews
3dcf1afee2 Address back porting issues
Add and use dig_with_opts, resolve_with_opts and rndccmd.
Use $(()) and $() instead of back ticks.
Add more double quotes around variable.
Add non back ported error corrections from v9_18 and main.
2022-11-17 15:21:58 +11:00
Mark Andrews
9ab162b856 Add system test for dual-stack-servers with possible DNAME response
Create a zone that triggers DNAME owner name checks in a zone that
is only reachable using a dual stack server.  The answer contains
a name that is higher in the tree than the query name.

e.g.
	foo.v4only.net.	CNAME	v4only.net.
	v4only.net.	A	10.0.0.1

ns4 is serving the test zone (ipv4-only)
ns6 is the root server for this test (dual stacked)
ns7 is acting as the dual stack server (dual stacked)
ns9 is the server under test (ipv6-only)

(cherry picked from commit f946133ec9)
2022-11-17 13:08:59 +11:00
Mark Andrews
078efb1526 Support starting and stopping IPv6 only servers
Look for $testdir/$server/named.ipv6-only and use
fd92:7065:b8e:ffff::$n instead of 10.53.0.$n to
communicate with the server.

(cherry picked from commit a35c34e10f)
2022-11-17 13:08:59 +11:00
Mark Andrews
349bd74b63 Check 'named-checkconf -z' and check-wildcard
Add tests to check the behavior of 'named-checkconf -z' and
check-wildcard setting in named.conf.

(cherry picked from commit 708dadac59)
2022-11-17 11:02:18 +11:00
Mark Andrews
8aa7601a42 named-checkzone -z ignored the check-wildcard option
Lookup and set the wildcard option according to the configuration
settings.  The default is on as per bin/named/config.c.

(cherry picked from commit dfc5c1e018)
2022-11-17 11:00:04 +11:00