Commit Graph

10952 Commits

Author SHA1 Message Date
Artem Boldariev
bccbf28249 tlsctx_client_session_cache_new() -> tlsctx_client_session_create()
Additionally to renaming, it changes the function definition so that
it accepts a pointer to pointer instead of returning a pointer to the
new object.

It is mostly done to make it in line with other functions in the
module.

(cherry picked from commit 7962e7f575)
2022-12-23 13:58:14 +02:00
Artem Boldariev
b05b05cb48 Rename isc_tlsctx_cache_new() -> isc_tlsctx_cache_create()
Additionally to renaming, it changes the function definition so that
it accepts a pointer to pointer instead of returning a pointer to the
new object.

It is mostly done to make it in line with other functions in the
module.

(cherry picked from commit f102df96b8)
2022-12-23 13:58:14 +02:00
Aram Sargsyan
5e57ffbd51 Fix DiG "timed out" message check in "legacy" system test
The test expects a "connection timed out" message from DiG when it
experiences a timeout, while the current version of DiG prints just
a "timed out" message, like below:

    ;; communications error to 10.53.0.1#11314: timed out
    ;; communications error to 10.53.0.1#11314: timed out
    ;; communications error to 10.53.0.1#11314: timed out

    ; <<>> DiG 9.19.9-dev <<>> -p 11314 +tries +time +tcp +tries +time @10.53.0.1 dropedns. TXT
    ; (1 server found)
    ;; global options: +cmd
    ;; no servers could be reached

Change the expected string to match the current DiG output.

Use the '-F' switch for "grep" for matching a fixed string.

(cherry picked from commit 35988748f3)
2022-12-21 14:32:18 +00:00
Tom Krizek
3c29317ad3 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 14:02:47 +01:00
Tom Krizek
873feb0c53 Rename engine_pkcs11 system test
In order to have a common naming convention for system tests, rename the
only outlier "engine_pkcs11" to "enginepkcs11", which was the only
system test using an underscore in its name.

The only allowed word separators for system test names are either dash
or no separator.

(cherry picked from commit 62eea511db)
2022-12-21 14:02:47 +01:00
Tom Krizek
4652da6caf 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 14:02:45 +01:00
Tom Krizek
45b003316f Make Python interpreter required for system tests
This introduces a Python dependency for running system tests. It is
needed in order to:
  - write new test control scripts in Python
  - gradually rewrite old Perl scripts into Python if needed
  - eventually introduce pytest as the new test runner framework

This commit is not intended to be backported to 9.16.

(cherry picked from commit 56416ebd65)
2022-12-21 10:49:33 +01:00
Tom Krizek
efa09a37f3 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)
2022-12-21 10:49:33 +01:00
Tom Krizek
0079745f97 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)
2022-12-21 10:49:33 +01:00
Tom Krizek
54a877ef47 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-21 10:42:10 +01:00
Ondřej Surý
2cb6001a2e Add comment why statistics/ns3 has misconfigure root.hints
To count pending queries in the statistics, we need the ns3 to be
misconfigured.  Document the fact in the statistics/ns3/root.hints.

(cherry picked from commit 32c2acf6fc)
2022-12-16 18:37:22 +01:00
Ondřej Surý
9e8c23be7e Revert the statistics system test change after we fixed the resolver
When the resolver was refactored, the statistics system test had to be
adjusted in c6b4d82557.  Unfortunately,
this change had to be done because of an error in the resolver
refactoring where timeout would not retry next server, but keep trying
the same server.  As we have now fixed this bug, revert the change to
the test back to the previous state.

(cherry picked from commit b679640950)
2022-12-16 18:37:22 +01:00
Tony Finch
08d0d24d3b 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:53:01 +00:00
Aram Sargsyan
eae5c06e57 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:31:04 +00:00
Artem Boldariev
e903ce1f3e Extend the 'doth' system test with a Mutual TLS resumption check
This commit adds a simple check to the 'doth' system test which
ensures that session resumption when Mutual TLS is used works as
expected.

(cherry picked from commit d5d31c6ba1)
2022-12-14 18:32:32 +02:00
Tony Finch
24d02d0986 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:03:48 +00:00
Mark Andrews
d2aa4ad87c 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:16 +11:00
Tom Krizek
f4d0b2dca9 Revert "Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_18' into 'v9_18'"
This reverts commit 81b6f17e7c, reversing
changes made to ea47a9c100.

It also removes release note 6038, since the fix is reverted.
2022-12-08 10:22:33 +01:00
Mark Andrews
6f998bbe51 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-07 23:59:36 +00:00
Mark Andrews
52a9db2180 Check TTLs of mixed TTL ANY response with expired records
(cherry picked from commit e49f83499a)
2022-12-07 23:59:36 +00:00
Mark Andrews
f8ce443684 Add reference to +tcp for +ignore
(cherry picked from commit b5951f0411)
2022-12-08 09:29:35 +11:00
Ondřej Surý
5164ba8d71 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:34:42 +01:00
Evan Hunt
2b78a2f9fa don't keep stale NXDOMAIN cache entries
when serve-stale is enabled, NXDOMAIN cache entries are no longer
preserved after the normal negative cache TTL, in order to reduce
unnecessary cache memory consumption.

(cherry picked from commit f1485ca145)
2022-12-07 17:21:00 +01:00
Mark Andrews
814ae11d19 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 09:44:35 +11:00
Aram Sargsyan
4ae4f1fd48 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:46:55 +00:00
Mark Andrews
0569fa0d25 Remember that the port was set in host and nslookup
Set 'port_set = true;' so that the TCP/DOT/DOH code doesn't reset
the port when making connections.

(cherry picked from commit 8caa94bdf1)
2022-12-06 09:21:43 +11:00
Mark Andrews
e1234f66c6 Add checks for 'host'
(cherry picked from commit e9c4192ee5)
2022-12-06 09:21:43 +11:00
Mark Andrews
375918493e Check ANY lookup using nslookup
(cherry picked from commit c367dd1b0b)
2022-12-06 09:21:43 +11:00
Tom Krizek
ca4ebedf02 Add dnstap prerequisite for dnstap system test
(cherry picked from commit 9846c920c3)
2022-12-02 10:45:21 +01:00
Tom Krizek
5a0d5c6e6f Add libnghttp2 prerequisite for doth system test
While some of these tests are for DoT which doesn't require nghttp2,
the server configs won't allow the server to start without nghttp2
support during compile time.

It might be possible to split these tests into DoT and DoH and only
require nghttp2 for DoH tests, but since almost all of our CI jobs are
compiled with nghttp2, we wouldn't gain a lot of coverage, so it's
probably not worth the effort.

(cherry picked from commit f514604613)
2022-12-02 10:45:21 +01:00
Tom Krizek
184f6d25e5 Add lmdb prerequisite for nzd2nzf system test
(cherry picked from commit b1e011e158)
2022-12-02 10:45:21 +01:00
Tom Krizek
8339c60346 Check for pkcs11-tool in keyfromlabel system test
pkcs11-tool which is typically part of the opensc package is required
for the keyfromlabel test.

(cherry picked from commit e9d9f11539)
2022-12-02 10:45:21 +01:00
Tom Krizek
e8f1c7e1fb 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 10:45:21 +01:00
Tom Krizek
a97a72fb8b 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:45:20 +01:00
Tom Krizek
418f7bb0ae Add missing options to feature-test utility
(cherry picked from commit e22d27da71)
2022-12-02 10:45:18 +01:00
Matthijs Mekking
fe910b2cc0 Update serve-stale test messages to include RRtype
(cherry picked from commit 45f7a15785)
2022-11-30 14:29:30 +01:00
Michal Nowak
1d7d504338 Update sources to Clang 15 formatting 2022-11-29 09:14:07 +01:00
Mark Andrews
acdf043360 Fix typo in dig man page '+qr' should be '+noqr'
Reported by Fabian P. Schmidt

(cherry picked from commit 3769266318)
2022-11-29 09:45:36 +11:00
Tony Finch
303cdf8e27 Deduplicate time unit conversion factors
The various factors like NS_PER_MS are now defined in a single place
and the names are no longer inconsistent. I chose the _PER_SEC names
rather than _PER_S because it is slightly more clear in isolation;
but the smaller units are always NS, US, and MS.

(cherry picked from commit 00307fe318)
2022-11-25 14:16:09 +00:00
Tom Krizek
34eda91697 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 12:57:46 +01:00
Mark Andrews
f21c770733 Back port @DEFAULT_HMAC@ changes for tsig_key in catz 2022-11-25 10:42:53 +11:00
Mark Andrews
55bcdcf943 Add catalog zone that requires TLS for all transfers
Both the catalog zone (catalog-tls.example) the zone managed using
the catalog zone (tls1.example) require TLS and a TSIG for zone
transfers.

(cherry picked from commit bb66ef2a47)
2022-11-25 09:57:30 +11:00
Matthijs Mekking
556acc0b85 Deprecate auto-dnssec
Deprecate auto-dnssec, add specific log warning to migrate to
dnssec-policy.

(cherry picked from commit f9845dd128)
2022-11-23 11:19:40 +01:00
Ondřej Surý
0d1c3ef7c2 Deprecate setting operating system limits from named.conf
It was possible to set operating system limits (RLIMIT_DATA,
RLIMIT_STACK, RLIMIT_CORE and RLIMIT_NOFILE) from named.conf.  It's
better to leave these untouched as setting these is responsibility of
the operating system and/or supervisor.

Deprecate the configuration options and remove them in future BIND 9
release.

(cherry picked from commit 379929e052)
2022-11-21 15:57:09 +01:00
Matthijs Mekking
ba2ef65483 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:31:48 +01:00
Mark Andrews
726aa21913 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:05:12 +11:00
Mark Andrews
c77af4be6f 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:05:12 +11:00
Mark Andrews
4906ae9fe0 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 10:58:54 +11:00
Mark Andrews
27250ec8d2 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 10:54:36 +11:00
Michal Nowak
e30f71f6f1 Replace "sha1sum" with "openssl sha1 -r"
"sha1sum" is part of GNU Coreutils, neither BIND 9 dependency nor POSIX.
Replace it with "openssl sha1 -r" as OpenSSL is BIND 9 dependency.

(cherry picked from commit d34c7ae227)
2022-11-14 21:03:01 +01:00