Commit Graph
11485 Commits
Author SHA1 Message Date
Matthijs Mekking 33db82cf20 Remove auto-dnssec checkconf tests
Any checkconf tests related to auto-dnssec can be removed, as this
option will be removed too.
2023-07-20 11:04:23 +02:00
Aram Sargsyan aa7538fd38 Fix a bug in an utility script for the statschannel system test
Because of a typo, the fetch.pl script tries to extract the server
address from the input parameter 'a' instead of 's'. Fix the typo.
2023-07-19 13:23:40 +00:00
Tom Krizek 5b5d5f9f22 Merge tag 'v9.19.15' 2023-07-19 14:16:32 +02:00
Michal Nowak ad3efede4d Remove remnants of Windows support in system test
The "uname -o" command is harmful on OpenBSD because this platform does
not know about the "-o" option. It is a permanent failure since system
tests are started with "set -e".
2023-07-18 16:39:21 +02:00
Matthijs Mekking 2152d06c8e Don't add signing records for dyn update DNSKEY
We removed DNSSEC management via dynamic update (see issue #3686),
this means we also should no longer add signing records (of private
type) for DNSKEY records added via dynamic update.
2023-07-18 15:38:53 +02:00
Mark Andrews 3f7723cdff Use absolute path to locate run.gdb 2023-07-18 00:01:46 +00:00
Tom Krizek cf3e9f8399 Handle curl without HTTP/2 support in doth test 2023-07-17 16:46:06 +02:00
Evan HuntandOndřej Surý 4db150437e clean up unused dns_db methods
to reduce the amount of common code that will need to be shared
between the separated cache and zone database implementations,
clean up unused portions of dns_db.

the methods dns_db_dump(), dns_db_isdnssec(), dns_db_printnode(),
dns_db_resigned(), dns_db_expirenode() and dns_db_overmem() were
either never called or were only implemented as nonoperational stub
functions: they have now been removed.

dns_db_nodefullname() was only used in one place, which turned out
to be unnecessary, so it has also been removed.

dns_db_ispersistent() and dns_db_transfernode() are used, but only
the default implementation in db.c was ever actually called. since
they were never overridden by database methods, there's no need to
retain methods for them.

in rbtdb.c, beginload() and endload() methods are no longer defined for
the cache database, because that was never used (except in a few unit
tests which can easily be modified to use the zone implementation
instead).  issecure() is also no longer defined for the cache database,
as the cache is always insecure and the default implementation of
dns_db_issecure() returns false.

for similar reasons, hashsize() is no longer defined for zone databases.

implementation functions that are shared between zone and cache are now
prepended with 'dns__rbtdb_' so they can become nonstatic.

serve_stale_ttl is now a common member of dns_db.
2023-07-17 14:50:25 +02:00
Tony FinchandOndřej Surý 856a6e4afb Give the rdataset->privateN fields more helpful names
BIND's rdataset structure is a view of some DNS records. It is
polymorphic, so the details of how the records are stored can vary.
For instance, the records can be held in an rdatalist, or in an
rdataslab in the rbtdb.

The dns_rdataset structure previously had a number of fields called
`private1` up to `private7`, which were used by the various rdataset
implementations. It was not at all clear what these fields were for,
without reading the code and working it out from context.

This change makes the rdataset inheritance hierarchy more clear. The
polymorphic part of a `struct dns_rdataset` is now a union of structs,
each of which is named for the class of implementation using it. The
fields of these structs replace the old `privateN` fields. (Note: the
term "inheritance hierarchy" refers to the fact that the builtin and
SDLZ implementations are based on and inherit from the rdatalist
implementation, which in turn inherits from the generic rdataset.

Most of this change is mechanical, but there are a few extras.

In keynode.c there were a number of REQUIRE()ments that were not
necessary: they had already been checked by the rdataset method
dispatch code. On the other hand, In ncache.c there was a public
function which needed to REQUIRE() that an rdataset was valid.

I have removed lots of "reset iterator state" comments, because it
should now be clear from `target->iter = NULL` where before
`target->private5 = NULL` could have been doing anything.

Initialization is a bit neater in a few places, using C structure
literals where appropriate.

The pointer arithmetic for translating between an rdataslab header and
its raw contents is now fractionally safer.
2023-07-17 14:50:25 +02:00
Tom Krizek 87e95b2348 Remove tkey test remnants
The tkey test was removed in bd4576b3ce
and the prereq.sh bit was accidentally added in
175d0c6d85
2023-07-17 10:40:07 +02:00
Tom Krizek e5f2addcaa Check return codes from commands in inline test
To improve the compatibility of the inline test with the `set -e`
option, ensure all commands which are expected to pass are explicitly
checked for return code and non-zero return codes are handled.
2023-07-14 17:10:58 +02:00
Tom Krizek 05baf7206b Use $(...) notation for subshells in system tests
The changes were mostly done with sed:

find . -name '*.sh' | xargs sed -i 's/`\([^`]*\)`/$(\1)/g'

There have been a few manual changes where the regex wasn't sufficient
(e.g. backslashes inside the `...`) or wrong (`...` referring to docs or
in comments).
2023-07-14 15:49:18 +02:00
Tom Krizek d203681a75 Handle non-zero return codes in rootkeysentinel tests 2023-07-14 15:49:18 +02:00
Tom Krizek 2b8e5e1155 Handle non-zero return codes in resolver test 2023-07-14 15:49:17 +02:00
Tom Krizek cde02fdb6a Handle non-zero return codes in statschannel test 2023-07-14 15:49:17 +02:00
Tom Krizek 4a87b44196 Handle non-zero return codes in checkconf test 2023-07-14 15:49:17 +02:00
Tom Krizek 9d383dce40 Handle non-zero return codes in dnstap test 2023-07-14 15:49:17 +02:00
Tom Krizek ede8ea889b Handle non-zero return codes in kasp test 2023-07-14 15:49:17 +02:00
Tom Krizek 4e8802a22d Handle non-zero return codes in serve-stale test 2023-07-14 15:49:17 +02:00
Tom Krizek fae6808b9c Handle non-zero return codes in doth test 2023-07-14 15:49:17 +02:00
Tom Krizek 1e64749ed3 Handle non-zero return codes in acl test 2023-07-14 15:49:17 +02:00
Tom Krizek 3a36ff506d Handle non-zero return codes in statistics test 2023-07-14 15:49:16 +02:00
Tom Krizek 9fdf537f52 Handle non-zero return codes in rrsetorder test 2023-07-14 15:49:16 +02:00
Tom Krizek 45fc4cc465 Handle non-zero return codes in redirect test 2023-07-14 15:49:16 +02:00
Tom Krizek c50a9e158d Handle non-zero return codes in rndc test 2023-07-14 15:49:16 +02:00
Tom Krizek 36d74bd2e3 Handle non-zero return codes in inline test 2023-07-14 15:49:16 +02:00
Tom Krizek f3310e1731 Handle non-zero return codes unknown test 2023-07-14 15:49:16 +02:00
Tom Krizek 86765ad1d3 Handle non-zero return codes in nsupdate test 2023-07-14 15:49:16 +02:00
Tom Krizek e5933f65d6 Handle non-zero return codes in zonechecks test 2023-07-14 15:49:16 +02:00
Tom Krizek e8c61f8da4 Handle non-zero return codes in wildcard test 2023-07-14 15:49:16 +02:00
Tom Krizek 69e8876966 Handle non-zero return codes in zero test 2023-07-14 15:49:15 +02:00
Tom Krizek 3ce200ead8 Handle non-zero return codes in legacy test 2023-07-14 15:49:15 +02:00
Tom Krizek 2823d0b469 Handle non-zero return codes in forward test 2023-07-14 15:49:15 +02:00
Tom Krizek 855f5b143a Handle non-zero return codes in upforwd test 2023-07-14 15:49:15 +02:00
Tom Krizek 146cb978c5 Handle non-zero return codes in addzone test 2023-07-14 15:49:15 +02:00
Tom Krizek 247b608f62 Handle non-zero return codes in rpzrecurse test 2023-07-14 15:49:15 +02:00
Tom Krizek 1d5caafa9e Handle non-zero return codes in rpz test 2023-07-14 15:49:15 +02:00
Tom Krizek 837c190d9e Make $? compatible with set -e in system tests
Ensure handling of return code from previous command doesn't cause the
script to halt if that code is non-zero when running with `set -e`.
2023-07-14 15:49:15 +02:00
Tom Krizek 1436025e20 Use arithmetic expansion in system tests (followup)
These are manual edits in addition of the automated changes from the
previous commit.
2023-07-14 15:49:15 +02:00
Tom Krizek 4d42bdc245 Use arithmetic expansion in system tests
Change the way arithmetic operations are performed in system test shell
scripts from using `expr` to `$(())`. This ensures that updating the
variable won't end up with a non-zero exit code, which would case the
script to exit prematurely when `set -e` is in effect.

The following replacements were performed using sed in all text files
(git grep -Il '' | xargs sed -i):

s/status=`expr $status + $ret`/status=$((status + ret))/g
s/n=`expr $n + 1`/n=$((n + 1))/g
s/t=`expr $t + 1`/t=$((t + 1))/g
s/status=`expr $status + 1`/status=$((status + 1))/g
s/try=`expr $try + 1`/try=$((try + 1))/g
2023-07-14 15:49:13 +02:00
Tom Krizek 01bc805f89 Run system tests with set -e
Ensure all shell system tests are executed with the errexit option set.
This prevents unchecked return codes from commands in the test from
interfering with the tests, since any failures need to be handled
explicitly.
2023-07-14 15:07:25 +02:00
Michal Nowak 89c77daddb Detect core dumps after BIND failed to stop cleanly
With the pytest runner, when BIND crashed during test runtime, the
get_core_dumps.sh script hasn't been run, and core dumps were not
detected.
2023-07-13 15:09:55 +02:00
Mark Andrews 189ca00a6e Check that BADCOOKIE is returned for a bad server COOKIE
Send a well formed, all zeros, DNS COOKIE option to a named instance
running with default cookie settings and check that BADCOOKIE is
returned.
2023-07-13 01:58:53 +00:00
Michał Kępień 2b0bade81c Fix typo in tests_shutdown.py 2023-07-06 15:38:48 +02:00
Matthijs Mekking 9c40cf0566 Add test for "three is a crowd" bug (GL #2375)
Add this test scenario for a bug fixed a while ago. When a third key is
introduced while the previous rollover hasn't finished yet, the keymgr
could decide to remove the first two keys, because it was not checking
for an indirect dependency on the keys.

In other words, the previous bug behavior was that the first two keys
were removed from the zone too soon.

This test case checks that all three keys stay in the zone, and no keys
are removed premature after another new key has been introduced.
2023-07-06 09:27:29 +02:00
Matthijs Mekking 674249f66a Check all keys despite early failure
In the kasp script, if one expected key is not found, continue checking
the other key ids, even if there is no match for the first one.  This
provides a bit more information which keys mismatch and makes for
easier debugging test failures.
2023-07-06 09:27:29 +02:00
Tom Krizek 5f85f63bf1 Mark the test_named_shutdown[rndc] test as xfail
It is currently affected by #4060, making the unstable as it
occassionally fails.
2023-07-04 12:58:16 +02:00
Tom Krizek ceed694659 Use timeout for rndc status in shutdown test
Pass 5 second timeout to the rndc status command(s) to avoid hitting the
hard 10 second timeout from subprocess.call, which would result in an
unwanted exception that would only mask the real issue: if the rndc
status times out in this test, it is likely due to the server not
stopping as it should.
2023-07-04 12:58:16 +02:00
Tom Krizek 603c58ee28 Split shutdown test into separate test cases
The shutdown test attempts to shut down the server using two different
methods - rndc and sigterm. Use pytest.mark.parametrize to run these as
separate test cases for easier identification of failures.
2023-07-04 12:58:14 +02:00
Tom Krizek 76d9873ef6 Check for unset variables only after conf.sh is loaded
Make the cds/setup.sh compatible with the workaround which relies on
testing the TSAN_OPTIONS variable which may not be set.
2023-06-29 10:35:47 +02:00