Commit Graph

11279 Commits

Author SHA1 Message Date
Mark Andrews
1a52dccd32 Handle multiple NSEC3PARAM records in tests
When transitioning from one NSEC3 chain to another it is legal for
there to be multiple complete chains in the zone with multiple
NSEC3PARAM records.  Handle this intermediate state by checking
for the expected length in the loop.
2024-01-03 09:25:43 +11:00
Matthijs Mekking
b9fc29cb95 Regression check for NSEC3 to NSEC3 conversion
When changing the NSEC3 chain, the new NSEC3 chain must be built before
the old NSEC3PARAM is removed.  Check each delta in the conversion to
ensure this ordering is met.

(cherry picked from commit 1d6b892e04)
2024-01-03 09:25:43 +11:00
Mark Andrews
7e24befc2a Regression check for NSEC3 to NSEC conversion
When transitioning from NSEC3 to NSEC the NSEC3 must be built before
the NSEC3PARAM is removed.  Check each delta in the conversion to
ensure this ordering is met.

(cherry picked from commit 7d90c056b0)
2024-01-03 09:25:43 +11:00
Mark Andrews
38babba214 The NSEC3 -> NSEC private record may be added later
Check each delta for the NSEC3 -> NSEC private record addition
as it may be added in the second delta.

(cherry picked from commit 80a4dff986)
2023-12-20 11:11:12 +11:00
Mark Andrews
15601cca43 Regression check for missing RRSIGs
When transitioning from NSEC3 to NSEC the added records where not
being signed because the wrong time was being used to determine if
a key should be used or not.  Check that these records are actually
signed.

(cherry picked from commit bdb42d3838)
2023-12-19 12:44:27 +11:00
Aram Sargsyan
ba923834b2 Fix a statschannel system test zone loadtime issue
The check_loaded() function compares the zone's loadtime value and
an expected loadtime value, which is based on the zone file's mtime
extracted from the filesystem.

For the secondary zones there may be cases, when the zone file isn't
ready yet before the zone transfer is complete and the zone file is
dumped to the disk, so a so zero value mtime is retrieved.

In such cases wait one second and retry until timeout. Also modify
the affected check to allow a possible difference of the same amount
of seconds as the chosen timeout value.

(cherry picked from commit 4e94ff2541)
2023-12-18 09:34:31 +00:00
Mark Andrews
adfb365602 NetBSD has added 'hmac' to libc so rename our uses of hmac
(cherry picked from commit fd077c2661)
2023-12-14 11:14:04 +11:00
Evan Hunt
374b4d6258 deprecate resolver-retry-interval and resolver-nonbackoff-tries
these options control default timing of retries in the resolver
for experimental purposes; they are not known to useful in production
environments.  they will be removed in the future; for now, we
only log a warning if they are used.

(cherry picked from commit 4aaa4f7dca)
2023-12-06 13:41:47 -08:00
Artem Boldariev
96228d9a08 doth test: add a secondary NS instance that reuses a 'tls' entry
This commit extends the 'doth' system tests with additional secondary
NS instance that reuses the same 'tls' entry for connecting the the
primary to download zones. This configurations were known to crash
secondaries in some cases.

(cherry picked from commit 10e626111f)
2023-12-06 17:07:12 +02:00
Tom Krizek
41ce14f389 Refactor statschannel test to use isctest
Use common utility functions in favor of duplicating the code in a
test-specific file.

(cherry picked from commit 5de2b07daa)
2023-12-05 14:27:41 +01:00
Tom Krizek
1fe70c6095 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.

(cherry picked from commit cba5a1d62c)
2023-12-05 14:27:41 +01:00
Tom Krizek
4e74513c1b 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.

(cherry picked from commit f0481c8600)
2023-12-05 14:27:41 +01:00
Tom Krizek
cf81c9e833 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.

(cherry picked from commit a57af8163a)
2023-12-05 14:27:41 +01:00
Tom Krizek
33b61de350 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.

(cherry picked from commit fc295b2b5d)
2023-12-05 14:27:40 +01:00
Tom Krizek
ad133d4c1c 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.

(cherry picked from commit 767f4670c6)
2023-12-05 14:27:37 +01:00
Michał Kępień
a195d9b126 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).

(cherry picked from commit 422286e9c2)
2023-12-04 19:30:03 +01:00
Michal Nowak
3bd3dfd187 Fix process listing string of rpzextra ns3 server
(cherry picked from commit 920af590d1)
2023-12-04 19:28:49 +01:00
Michal Nowak
72760c0c2b Add support for recording named runtime with rr
The traces of the named process are stored in the directory
$system_test/nsX/named-Y/.

(cherry picked from commit e088e8a992)
2023-12-04 19:28:05 +01:00
Ondřej Surý
b83b9dc2c6 Remove support for running system tests under Valgrind
Valgrind support has been scarcely used.

(cherry picked from commit 658d62a6f4)
2023-12-04 19:26:25 +01:00
Aram Sargsyan
4181a187a1 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.

(cherry picked from commit 4d529ee12a)
2023-12-04 10:39:46 +00:00
Matthijs Mekking
cf23303dd9 Add a DNSSEC policy test case for a special zone
Try to create a key for a zone, and then sign it, that has some special
characters in the name.

(cherry picked from commit 6a4f3ec242)
2023-11-20 12:10:30 +01:00
Mark Andrews
734061ac1b Emit "no servers could be reached" for TCP as well as UDP
When all the servers are exhausted for TCP emit "no servers could
be reached" in tcp_connected.  This message is already emitted for
UDP.

(cherry picked from commit 831efa40d6)
2023-11-20 13:40:19 +11:00
Evan Hunt
6b47d98a95 set loadtime during initial transfer of a secondary zone
when transferring in a non-inline-signing secondary for the first time,
we previously never set the value of zone->loadtime, so it remained
zero. this caused a test failure in the statschannel system test,
and that test case was temporarily disabled.  the value is now set
correctly and the test case has been reinstated.

(cherry picked from commit 9643281453)
2023-11-15 18:06:58 -08:00
Mark Andrews
dc0671e724 Adjust message buffer sizes in test code
(cherry picked from commit cbfcdbc199)
2023-11-16 12:22:08 +11:00
Tony Finch
1b138a5883 Fix missing newlines in output of rndc nta -dump
There were no newlines between each view in the list of negative trust
anchors.

(cherry picked from commit 61b245e318)
2023-11-03 08:28:18 +01:00
Mark Andrews
15e13bd523 Update b.root-servers.net IP addresses
This covers both root hints and the default primaries for the root
zone mirror.  The official change date is Nov 27, 2023.

(cherry picked from commit 2ca2f7e985)
2023-11-03 03:43:49 +11:00
Mark Andrews
b4352bbc6f Cleanup dead code in dnstap-read
Remove 'b' from main as it is unused.

(cherry picked from commit 0482451f84)
2023-11-02 10:09:44 +00:00
Tom Krizek
8c8ff7faea Fix pytest junitxml output processing for make check
Not every element tagged `skipped` in the JUnitXML tree has to contain
the `type` attribute. An example of that is a test that results in
xpass.

This has been verified with pytest version 7.4.2 and prior.

(cherry picked from commit ba25ecd2d2)
2023-11-02 10:02:51 +01:00
Matthijs Mekking
784b096098 Test case for issue #4355
Add a test case where serve-stale is enabled on a server that also
servers a local authoritative zone.

The particular case tests a lame delegation and checks if falling
back to serving stale data does not attempt to retrieve the query
by recursing from the root down.

(cherry picked from commit e196ba6168)
2023-10-31 13:52:01 +01:00
Aram Sargsyan
08de15e5f2 Do not warn about lock-file option change when -X is used
When -X is used the 'lock-file' option change detection condition
is invalid, because it compares the 'lock-file' option's value to
the '-X' argument's value instead of the older 'lock-file' option
value (which was ignored because of '-X').

Don't warn about changing 'lock-file' option if '-X' is used.

(cherry picked from commit 41945b32d7)
2023-10-26 13:12:57 +00:00
Aram Sargsyan
4ed32424c8 Fix an invalid condition check when detecting a lock-file change
It is obvious that the '!cfg_obj_asstring(obj)' check should be
'cfg_obj_asstring(obj)' instead, because it is an AND logic chain
which further uses 'obj' as a string.

Fix the error.

(cherry picked from commit bc891e749f)
2023-10-26 13:12:52 +00:00
Aram Sargsyan
1bff704681 Fix assertion failure when using -X none and lock-file in configuration
When 'lock-file <lockfile>' is used in configuration at the same time
as using '-X none' in 'named' invocation, there is an invalid
logic that would lead to a isc_mem_strdup() call on a NULL value.

Also, contradicting to ARM, 'lock-file none' is overriding the '-X'
argument.

Fix the overall logic, and make sure that the '-X' takes precedence to
'lock-file'.

(cherry picked from commit fc2dd09390)
2023-10-26 13:12:47 +00:00
Ondřej Surý
d9fc95f842 Fix assertion failure when using -X and lock-file in configuration
When 'lock-file <lockfile1>' was used in configuration at the same time
as using `-X <lockfile2>` in `named` invocation, there was an invalid
logic that would lead to a double isc_mem_strdup() call on the
<lockfile2> value.

Skip the second allocation if `lock-file` is being used in
configuration, so the <lockfile2> is used only single time.

(cherry picked from commit 4f68def5e9)
2023-10-26 13:59:46 +02:00
Tom Krizek
b8b9b4ac2c Reformat shell scripts with shfmt
All changes in this commit were automated using the command:

shfmt -w -i 2 -ci -bn . $(find . -name "*.sh.in")

By default, only *.sh and files without extension are checked, so
*.sh.in files have to be added additionally. (See mvdan/sh#944)

(manually replayed commit 4cb8b13987)
2023-10-26 13:05:00 +02:00
Mark Andrews
74ab7e4660 Check that the lock file was not removed too early
When named fails to starts due to not being able to obtain
a lock on the lock file that lock file should remain.  Check
that the lock file exists before and after the attempt to
start a second instance of named.

(cherry picked from commit 811c9ee7d1)
2023-10-26 18:05:07 +11:00
Mark Andrews
534cadba3a Only remove the lock file if we managed to lock it
The lock file was being removed when we hadn't successfully locked
it which defeated the purpose of the lockfile.  Adjust cleanup_lockfile
such that it only unlinks the lockfile if we have successfully locked
the lockfile and it is still active (lockfile != NULL).

(cherry picked from commit b9c789b8b3)
2023-10-26 18:05:07 +11:00
Michal Nowak
114551659e Add test for CVE-2023-3341
(cherry picked from commit 7d1834b250)
2023-10-20 16:27:31 +02:00
Michal Nowak
7c6632e174 Update the source code formatting using clang-format-17 2023-10-18 09:02:57 +02:00
Matthijs Mekking
e3f65d465c Two minor fixes in the kasp system test
The 'dynamic-signed-inline-signing.kasp' zone was set up with
the environment variable 'ksktimes', but that should be 'csktimes'
which is set one line above. Since the values are currently the same
the behavior is identical, but of course it should use the correct
variable.

The 'step4.enable-dnssec.autosign' zone was set up twice. This is
unnecessary.

(cherry picked from commit 21d04f556d)
2023-10-16 12:34:52 +02:00
Matthijs Mekking
e9989c541b Add test case for GL #4350
Add a test scenario for a dynamic zone that uses inline-signing which
accidentally has signed the raw version of the zone.

This should not trigger resign scheduling on the raw version of the
zone.

(cherry picked from commit c90b622648)
2023-10-16 10:33:25 +02:00
Mark Andrews
745db8775b Document that reloading happens asynchronously
(cherry picked from commit e33dbd0cbd)
2023-09-26 14:11:30 +10:00
Mark Andrews
de94bee5f3 Wait for the test zone to finish re-loading
'rndc thaw' initiates asynchrous loading of all the zones
similar to 'rndc load'.  Wait for the test zone's load to
complete before testing that it is updatable again.

(cherry picked from commit 5b3238aa85)
2023-09-26 14:11:30 +10:00
Michał Kępień
2f08b622bf Merge tag 'v9.18.19' into bind-9.18 2023-09-20 16:52:16 +02:00
Tom Krizek
2ad197b37d Rename convenience symlink to pytest artifacts
The previous symlink name convention was prone to name collisions If a
system test contained both a shell test and a pytest module of the same
name (e.g. dnstap test has both tests.sh and tests_dnstap.py), then
these would have the same convenience symlink, which could cause test
setup issues as well as confusion when examining test artifacts.

Update the naming convention to include the full pytest module name.
This results in a slightly more verbose names for shell tests (e.g.
dnstap_sh_dnstap instead of the previous dnstap_dnstap), but it removes
the chance of a collision.

(cherry picked from commit fd13dfb097)
2023-09-20 16:04:40 +02:00
Tom Krizek
a5eb779c94 Update system test runner doc with pytest glue files
Document that pytest requires a glue file for each shell tests in order
to detect it.

(cherry picked from commit d050843a30)
2023-09-20 14:51:49 +02:00
Tom Krizek
60c4356554 Use integers for ports fixtures in pytest
Reorganize individual port fixtures and re-use the ports fixture to
obtain their number. Store it as integer and only cast it to string when
setting it as environment variable.

(cherry picked from commit 8deb026748)
2023-09-20 14:51:05 +02:00
Tom Krizek
0ac22ebc95 Reformat conftest.py with black
(cherry picked from commit 197dac55a2)
2023-09-20 14:51:05 +02:00
Tom Krizek
7a28a76885 Remove legacy runner support from conftest.py
Remove code fork for legacy runner, reorganize imports and move a
pylint-silencing snippet to the top of the file. The rest of the code
was just unindented.

(cherry picked from commit d16e5fd5e5)
2023-09-20 14:51:02 +02:00
Tom Krizek
98191e6371 Remove pytest invocation from legacy runner
In order to python system tests, pytest (runner) has to be used
directly. This makes it possible to simplify the pytest runner and make
its behavior simpler and easier to extend.

The legacy runner can still be used to run shell system tests.

(cherry picked from commit 4af9bafb4e)
2023-09-20 14:50:18 +02:00
Tom Krizek
8c1a1b304c Use 0 exit code for skipped tests in legacy runner
Since the legacy runner is no longer used in the automake test suite,
don't use the special GNU exit code indicating a skipped tests. Instead,
use 0 to avoid considering skipped tests as failed when using simpler
mechanism (such as xargs -P) to run the tests with the legacy runner.
2023-09-20 13:45:41 +02:00