Commit Graph

11290 Commits

Author SHA1 Message Date
Tom Krizek
c57798d341 Handle dig timing out gracefully in cookie
(cherry picked from commit 343b3f0f84)
2024-01-09 10:17:46 +01:00
Tom Krizek
b1eab3ca7e Handle dig timing out gracefully in autosign
(cherry picked from commit 445ec7cc0f)
2024-01-09 10:17:44 +01:00
Tom Krizek
c84e34dbbc Handle dig timing out gracefully in auth
(cherry picked from commit ddb41798d5)
2024-01-09 10:06:52 +01:00
Tom Krizek
6dc3ebe494 Handle dig timing out gracefully in allow-query
(cherry picked from commit 0d5df1fc02)
2024-01-09 10:06:52 +01:00
Mark Andrews
db00e1e913 Handle dig timing out gracefully in serve-stale
(cherry picked from commit 4351076d48)
2024-01-09 10:06:49 +01:00
Mark Andrews
3b01b47ac3 Handle dig timing out gracefully in rndc
(cherry picked from commit 02d9f2eeb9)
2024-01-09 10:04:46 +01:00
Tom Krizek
863055767d Add missing dnssec-validation to ns4 in xfer test
This file was missing explicit dnssec-validation. Seems like it was
missed in our previous efforts, probably because of the different
filename / extension. Rename it to end with *.in to reflect that it is a
template file used by copy_setports.

(cherry picked from commit 68234372a5)
2024-01-09 10:02:12 +01:00
Tom Krizek
d2c5a11ae8 Turn off dnssec-validation in nsec&tsig system tests
This is a followup for !8063, which backported !7999. The configuration
file layout for these files have changed (main branch has
named-fips.conf), which is probably why these bits were missed during a
backport.
2024-01-08 18:13:47 +01:00
Tom Krizek
ec3a47fc68 Turn off dnssec validation in inline test
DNSSEC validation isn't required by the inline test and would send
queries to root name servers.

(cherry picked from commit 66d6394057)
2024-01-08 17:30:50 +01:00
Mark Andrews
2c1c7ec639 Stop sending queries to the internet's root servers
Disable automatic dnssec validation.

(cherry picked from commit 15a433cb9d)
2024-01-08 17:30:42 +01:00
Mark Andrews
b831223b3e Support Net::DNS::Nameserver 1.42
In Net::DNS 1.42 $ns->main_loop no longer loops.  Use current methods
for starting the server, wait for SIGTERM then cleanup child processes
using $ns->stop_server(), then remove the pid file.

(cherry picked from commit c2c59dea60)
2024-01-03 11:57:59 +11:00
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