2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00
Commit Graph

40757 Commits

Author SHA1 Message Date
Mark Andrews
f894bf661f Test dnssec-policy dnskey-ttl behaviour
If the dnskey-ttl in the dnssec-policy doesn't match the DNSKEY's
ttl then the DNSKEY, CDNSKEY and CDS rrset should be updated by
named to reflect the expressed policy.  Check that named does this
by creating a zone with a TTL that does not match the policy's TTL
and check that it is correctly updated.
2024-01-03 12:09:11 +11:00
Mark Andrews
3fdf35bb2a Merge branch '4513-system-tests-fail-with-net-dns-1-42' into 'main'
Resolve "System tests fail with Net::DNS 1.42"

Closes #4513

See merge request isc-projects/bind9!8615
2024-01-03 00:07:07 +00:00
Mark Andrews
c2c59dea60 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.
2024-01-03 09:21:15 +11:00
Michał Kępień
f0e17a92a3 Merge branch 'michal/silence-a-scan-build-warning-in-dns_rbt_addname' into 'main'
Silence a scan-build warning in dns_rbt_addname()

See merge request isc-projects/bind9!8614
2024-01-02 13:51:18 +00:00
Michał Kępień
9cf1f39b54 Silence a scan-build warning in dns_rbt_addname()
Clang Static Analyzer is unable to grasp that when dns_rbt_addnode()
returns ISC_R_EXISTS, it always sets the pointer passed to it via its
'nodep' parameter to a non-NULL value.  Add an extra safety check in the
conditional expression used in dns_rbt_addname() to silence that
warning.
2023-12-22 19:27:37 +01:00
Michal Nowak
1f78f3a586 Merge branch 'mnowak/pytest_rewrite_spf' into 'main'
Rewrite spf system test to pytest

See merge request isc-projects/bind9!8572
2023-12-22 15:07:13 +00:00
Michal Nowak
e67d770432 Rewrite spf system test to pytest 2023-12-22 15:02:58 +01:00
Michał Kępień
662a88055c Add wait_for_zones_loaded fixture
The wait_for_zones_loaded fixture waits for the "all zones loaded"
message in the named log file before the test function can proceed.
2023-12-22 15:02:58 +01:00
Michał Kępień
1770b37095 Ensure wait_for_line() is not called with timeout=0 2023-12-22 15:02:58 +01:00
Michał Kępień
831c5d34f9 Refactor string matching loop for readability 2023-12-22 15:02:58 +01:00
Tom Krizek
05b0ebac0f Add LogFile helper
LogFile class contains a log path and has means to find a string in the
log file.
2023-12-22 15:02:58 +01:00
Štěpán Balážik
46b7cc2ed2 Merge branch 'stepan/rndc-fixtures-for-pytest' into 'main'
Implement Python helpers for using RNDC in tests

See merge request isc-projects/bind9!8357
2023-12-21 19:33:43 +00:00
Michał Kępień
fdc45c70e8 Add reconfiguration support to NamedInstance
Reconfiguring named using RNDC is a common action in BIND 9 system
tests.  It involves sending the "reconfig" RNDC command to a named
instance and waiting until it is fully processed.  Add a reconfigure()
method to the NamedInstance class in order to simplify and standardize
named reconfiguration using RNDC in Python-based system tests.

TODO:

  - full reconfiguration support (w/templating *.in files)

  - add an "rndc null" before every reconfiguration to show which file
    is used (NamedInstance.add_mark_to_log() as it may be generically
    useful?)
2023-12-21 18:10:15 +00:00
Michał Kępień
989d22473d Run mypy checks on Python helpers in GitLab CI
Ensure the type hints provided in helper code for Python-based system
tests are correct by continuously checking them using mypy in GitLab CI.
Check bin/tests/system/isctest.py exclusively for the time being because
it is the only Python file in the source tree which uses static typing
at the moment and working around the issues reported by mypy for other
(non-statically-typed) Python files present in the source tree would be
cumbersome.
2023-12-21 18:10:15 +00:00
Michał Kępień
aa31a872d0 Clean up the "checkds" system test
The "checkds" system test contains a lot of duplicated code despite
carrying out the same set of actions for every tested scenario
(zone_check() → wait for logs to appear → keystate_check()).  Extract
the parts of the code shared between all tests into a new function,
test_checkds(), and use pytest's test parametrization capabilities to
pass distinct sets of test parameters to this new function, in an
attempt to cleanly separate the fixed parts of this system test from the
variable ones.  Replace format() calls with f-strings.
2023-12-21 18:10:15 +00:00
Michał Kępień
cf338a7ca3 Drop use of dns.resolver.Resolver from "checkds"
The "checkds" system test only uses dns.resolver.Resolver objects to
access their 'nameservers' and 'port' attributes.  Instances of the
NamedInstance class also expose that information via their attributes,
so only pass NamedInstance objects around instead of needlessly
depending on dns.resolver.Resolver.
2023-12-21 18:10:15 +00:00
Michał Kępień
2c35b839a5 Use helper Python classes for watching log files
Make log file watching in Python-based system tests consistent by
employing the helper Python classes designed for that purpose.  Drop the
custom code currently used.
2023-12-21 18:10:15 +00:00
Michał Kępień
bf92f33f94 Add helper Python classes for watching log files
Waiting for a specific log line to appear in a named.run file is a
common action in BIND 9 system tests.  Implement a set of Python classes
which intend to simplify and standardize this task in Python-based
system tests.

Co-authored-by: Štěpán Balážik <stepan@isc.org>
2023-12-21 18:10:15 +00:00
Michał Kępień
00003e497c Simplify use of RNDC in Python-based tests
The "addzone" and "shutdown" system tests currently invoke rndc using
test-specific helper code.  Rework the relevant bits of those tests so
that they use the helper classes from bin/tests/system/isctest.py.
2023-12-21 18:10:15 +00:00
Michał Kępień
c38c29e84d Implement Python helpers for using RNDC in tests
Controlling named instances using RNDC is a common action in BIND 9
system tests.  However, there is currently no standardized way of doing
that from Python-based system tests, which leads to code duplication.
Add a set of Python classes and pytest fixtures which intend to simplify
and standardize use of RNDC in Python-based system tests.

For now, RNDC commands are sent to servers by invoking the rndc binary.
However, a switch to a native Python module able to send RNDC commands
without executing external binaries is expected to happen soon.  Even
when that happens, though, having the capability to invoke the rndc
binary (in order to test it) will remain useful.  Define a common Python
interface that such "RNDC executors" should implement (RNDCExecutor), in
order to make switching between them convenient.

Co-authored-by: Štěpán Balážik <stepan@isc.org>
2023-12-21 18:10:15 +00:00
Evan Hunt
e997a738d6 Merge branch 'each-broken-qpiter' into 'main'
more fix_iterator() bugs

See merge request isc-projects/bind9!8606
2023-12-21 17:57:47 +00:00
Evan Hunt
ea9a8cb392 prevent an infinite loop in fix_iterator()
it was possible for fix_iterator() to get stuck in a loop while
trying to find the predecessor of a missing node. this has been
fixed and a regression test has been added.
2023-12-21 09:18:30 -08:00
Evan Hunt
84f79cd164 fix_iterator() could produce incoherent iterator stacks
the fix_iterator() function moves an iterator so that it points
to the predecessor of the searched-for name when that name doesn't
exist in the database. the tests only checked the correctness of
the top of the stack, however, and missed some cases where interior
branches in the stack could be missing or duplicated. in these
cases, the iterator would produce inconsistent results when walked.

the predecessors test case in qp_test has been updated to walk
each iterator to the end and ensure that the expected number of
nodes are found.
2023-12-21 09:18:30 -08:00
Mark Andrews
93cc89e4d3 Merge branch '4495-conversion-from-nsec3-to-nsec-removes-the-nsec3param-too-early' into 'main'
Resolve "Conversion from NSEC3 to NSEC removes the NSEC3PARAM too early"

Closes #4495 and #1794

See merge request isc-projects/bind9!8578
2023-12-21 10:00:15 +00:00
Mark Andrews
9b5ed853d0 Add CHANGES for [GL #1794] and [GL #4459] 2023-12-21 20:12:51 +11:00
Matthijs Mekking
1d6b892e04 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.
2023-12-21 20:12:09 +11:00
Mark Andrews
7d90c056b0 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.
2023-12-21 20:12:09 +11:00
Mark Andrews
0509351e92 Update the NSEC3PARAM TTL to match the SOA minimum
When building NSEC3 chains update the NSEC3PARAM TTL to match
the SOA minimum.  Delete all records using the old TTL then
re-add them using the new TTL.
2023-12-21 20:12:09 +11:00
Mark Andrews
f3ae88d84e Don't delete the NSEC3PARAM immediately
Wait until the new NSEC or NSEC3 chain is generated then it should
be deleted.
2023-12-21 20:12:09 +11:00
Evan Hunt
b248574f93 Merge branch '4364-compilezone-disable-checks' into 'main'
disable checks by default in named-compilezone

Closes #4364

See merge request isc-projects/bind9!8499
2023-12-21 04:26:07 +00:00
Evan Hunt
0c90d09604 CHANGES and release note for [GL #4364] 2023-12-20 16:57:49 -08:00
Evan Hunt
d9ab5b9ecc disable checks by default in named-compilezone
Zone content integrity checks can significantly slow the conversion
of zones from raw to text. As this is more properly a job for
named-checkzone anyway, we now disable all zone checks by
default in named-compilezone.

Users relying on named-compilezone for integrity checks as
well as format conversion can run named-checkzone separately,
or re-enable the checks in named-compilezone by using:
"named-compilezone -n fail -k fail -r warn -T warn -W warn".
2023-12-20 16:57:19 -08:00
Mark Andrews
ecd1f4a2b8 Merge branch '4488-memory-reference-leak-in-lib-dns-zone-c-zone_sign' into 'main'
Resolve "Memory/reference leak in lib/dns/zone.c:zone_sign"

Closes #4488

See merge request isc-projects/bind9!8570
2023-12-20 23:02:50 +00:00
Mark Andrews
4e4200ee2e Add CHANGES note for [GL #4488] 2023-12-21 09:19:22 +11:00
Mark Andrews
a3d0476d17 Don't look for KSK status here and squash memory leak
Just remove the key from  consideration as it is being removed.

The old code could leak a key reference as dst_free_key was not
called every time we continued. This simplification will address
this as well.
2023-12-21 09:18:45 +11:00
Mark Andrews
31560dce1a Merge branch '4310-require-when-changing-primaries-list' into 'main'
Resolve "REQUIRE when changing primaries list."

Closes #4310

See merge request isc-projects/bind9!8546
2023-12-20 21:50:26 +00:00
Mark Andrews
4714c65a90 Add CHANGES note for [GL #4310] 2023-12-21 08:12:43 +11:00
Mark Andrews
6ccb93884d dns_request_cancel needs to be callable from any thread
Check the tid and cancel the request immediately or pass it to the
appropriate loop for processing.  Call request->cb directly from
req_sendevent as it is now always called with the correct tid.
2023-12-21 08:11:59 +11:00
Tom Krizek
62284b4053 Merge branch 'tkrizek/update-sphinx_rtd_theme' into 'main'
Update sphinx_rtd_theme and docutils

See merge request isc-projects/bind9!8603
2023-12-20 17:01:45 +00:00
Tom Krizek
4156fa09d9 Update sphinx_rtd_theme and docutils 2023-12-20 18:00:58 +01:00
Michał Kępień
c04d87f13c Merge branch '4496-do-not-destroy-ixfr-journal-in-xfrin_end' into 'main'
Do not destroy IXFR journal in xfrin_end()

Closes #4496

See merge request isc-projects/bind9!8602
2023-12-20 16:32:04 +00:00
Michał Kępień
80695e9897 Add CHANGES entry for GL #4496 2023-12-20 17:21:14 +01:00
Michał Kępień
efcba4dd23 Do not destroy IXFR journal in xfrin_end()
The xfrin_end() function is run when a zone transfer is finished or
canceled.  One of the actions it takes for incremental transfers (IXFR)
is calling dns_journal_destroy() on the zone journal structure that is
stored in the relevant zone transfer context (xfr->ixfr.journal).  That
immediately invalidates that structure as it is not reference-counted.
However, since the changes present in the IXFR stream are applied to the
journal asynchronously (via isc_work_enqueue()), it is possible that
some zone changes may still be in the process of being written to the
journal by the time xfrin_end() destroys the relevant structure.  Such a
scenario leads to crashes.

Fix by not destroying the zone journal structure until the entire zone
transfer context is destroyed.  xfrin_destroy() already conditionally
calls dns_journal_destroy() and when the former is called, all
asynchronous work for a given zone transfer process is guaranteed to be
complete.
2023-12-20 17:21:14 +01:00
Tom Krizek
1349733fbc Merge tag 'v9.19.19' 2023-12-20 15:59:22 +01:00
Matthijs Mekking
f249418240 Merge branch '4423-revert' into 'main'
Revert "Remove kasp mutex lock"

See merge request isc-projects/bind9!8597
2023-12-20 08:32:00 +00:00
Matthijs Mekking
6722ae9103 Revert "Add release note and CHANGES for #4423"
This reverts commit 7af2ec7e4f.
2023-12-20 08:30:44 +00:00
Matthijs Mekking
16f2c811e3 Revert "Remove kasp mutex lock"
This reverts commit 634c80ea12.
2023-12-20 08:30:44 +00:00
Mark Andrews
3f35475ab6 Merge branch '4498-gl-4495-followup-regression-test-was-too-strict' into 'main'
Resolve "[GL #4494] followup: regression test was too strict"

Closes #4498

See merge request isc-projects/bind9!8590
2023-12-19 22:48:51 +00:00
Mark Andrews
80a4dff986 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.
2023-12-19 22:05:59 +00:00
Mark Andrews
e1111c5681 Merge branch '4439-add-async-restart-handle' into 'main'
Resolve "segfault in resolver when serving UDP clients"

Closes #4439

See merge request isc-projects/bind9!8594
2023-12-19 16:34:53 +00:00