Commit graph

5571 commits

Author SHA1 Message Date
Colin Vidal
d07deba615 update SERVFAIL cache test
An existing SERVFAIL cache test is updated as it initially checks there
are no EDE (the first SERVFAIL) then immediately re-does the same query,
(still SERVFAIL), and expect the CACHED_ERROR EDE.

However, the configuration used for this test to generate a SERVFAIL is
a broken DNSSEC configuration, where the DNSKEY is not the expected one
(it's a ZSK instead of a KZK). As a result, the first attempt also now
raise an EDE (MISSING_DNSKEY).
2025-12-17 09:43:13 +01:00
Colin Vidal
e856afa3b5 add system tests covering EDE 9
The authoritative server on "missing-dnskey." zone is ns2, the zone is
initially signed normally, but then the DNSKEY are pulled out from the
signed generated zone file. As a consequence, a quering the resolver ns4
returns a SERVFAIL with EDE9 as the chain of trust is broken: the DS is
prsent in the parent zone (the root zone in ns1), but the DNSKEY is
missing from the zone.

A similar is "wrong-dnskey.", but here the zone is signed correctly,
but the DS points to a different DNSKEY. Hence no supported matching
DNSKEY record could be found for the child.
2025-12-17 09:43:13 +01:00
Mark Andrews
96e6a22627 Exclude f.f.f.f.ip6.arpa names from test_sythreverse_refused_v6
f.f.f.f.ip6.arpa is a configured zone so refused responses
are not expected.
2025-12-16 13:15:37 +11:00
Michal Nowak
ce23dd4dd3
Add TSAN report and core file globs to expected artifacts 2025-12-15 19:42:50 +01:00
Evan Hunt
92919609c4 Check delegation response to ANY query
If mandatory glue is present, it should be returned when the query
type is ANY.
2025-12-11 10:41:05 -08:00
Matthijs Mekking
5e704bbb59 Add NSEC3 optout large delegation zone test case
This test signs a large delegation with mostly insecure delegations
with NSEC3 optout. Once the NSEC3PARAM record is published, run
dnssec-verify to ensure the zone is correctly signed.
2025-12-10 14:18:52 +01:00
Nicki Křížek
8f326a7af7 Fix a timing issue in notify test
There are a total of 22 notifies required before the start of the test:
20 for each x1..x20 and two for x21, as it has a couple of servers.
2025-12-09 14:23:17 +01:00
Nicki Křížek
51ab74db10 Remove obsolete copy_setports
This function is no longer needed and jinja2 templates are universally
used instead.
2025-12-09 14:23:17 +01:00
Nicki Křížek
bf694d0628 Use jinja2 templates in kasp test
- ns3 had fips/rsasha1 config variants. These were refactored similarly
  to the way they're handled in nsec3 test.
- ns3 special character zone contains @, which is interpreted by jinja2.
  To avoid, {% raw %} directive was added
- ns6 contained unused policies and named2.conf, these were removed
2025-12-09 14:23:17 +01:00
Nicki Křížek
a8713fdcf8 Use jinja2 templates in serve-stale test
The ns1 named.conf files were sufficiently similar to allow for
de-duplication. No attempt to de-duplicate ns3 was made due to
significant differences among the config files.
2025-12-09 14:23:17 +01:00
Nicki Křížek
6114444007 Use jinja2 templates in catz test
- Use a common ns2/named.conf.j2 template for all the "#TN"
  replacements. Instead of commenting out with sed, render the template
  differently into ns/namedX.conf using variables.
- Keep the final ns2/named7.conf.j2 (formerly ns2/named2.conf.in) as a
  separate template for readability due to significant differences.
2025-12-09 14:23:17 +01:00
Nicki Křížek
c93733263a Use jinja2 templates in rpz test
- The ns3/named.conf.j2 uses has a "#BAD" section that is only included
  after restart. Turn it into ns3/named2.conf.
- Since the original config is then restored, keep a copy of it as
  ns3/named1.conf using a symlink, causing it to be rendered twice.
- Use jinja2 templates for test* files to render the port number instead
  of calling copy_setports in load_db().
2025-12-09 14:23:17 +01:00
Nicki Křížek
efc302b0ad Use jinja2 templates in staticstub test
- Instead of strings to be replaced by sed, use proper jinja templates.
- ns3/named1.conf.j2 is basically a copy of the default config, because
  it needs to be restored later in the test.
2025-12-09 14:23:17 +01:00
Nicki Křížek
c46208ffdb Use jinja2 templates in resolver test
- Move ns1/named.conf.j2 to ns1/named2.conf.j2 and adjust the python
  test to render this template.
- Convert remaining .in files to .j2 and handle the multiple configs.
2025-12-09 14:23:17 +01:00
Nicki Křížek
2592f0d961 Use jinja2 templates in views test
- Rename named.conf.j2 to named3.conf.j2 and adjust the python test to
  render this template.
- Handle the n2 and ns3 multiple configs as in other similar cases
  (ns2/named1.conf.in was moved to ns2/named.conf.j2).
2025-12-09 14:23:17 +01:00
Nicki Křížek
1da733a015 Use jinja2 templates in legacy test
The test uses a second named2.conf template. It only differs by using
dnssec-validation yes. Render both named configs and swap them when
needed.
2025-12-09 14:23:17 +01:00
Nicki Křížek
cb88d1eda6 Use jinja2 templates in statistics test
- Merge ns*/statistics-channels.conf.in config snippets into
  conditionally rendered section in ns*/named.conf.j2 files.
- Turn ns2/named.conf.in into ns2/named1.conf.j2 because it is used
  later in the test to restore the original config.
- Symlink the ns2/named.conf.j2 ns2/named1.conf.j2 to pick a starting
  config.
2025-12-09 14:23:17 +01:00
Nicki Křížek
719c656d2b Use jinja2 templates in synthfromdnssec test
- Merge ns*/statistics-channels.conf.in config snippets into
  conditionally rendered section in ns*/named.conf.j2 files.
2025-12-09 14:23:14 +01:00
Nicki Křížek
8db37ac31c Use jinja2 templates in tsig test
- Rename ns1/named-fips.conf.in to ns1/named.conf.j2.
- Move MD5-specific stuff into ns1/named-md5.conf.j2 and include it
  conditionally.
2025-12-09 14:23:14 +01:00
Nicki Křížek
16e9ac4710 Use jinja2 templates in rpzrecurse test
- Change ns2 header into jinja2 template.
- Keep the various ns2 config files as non-templates, same for the
  named.default.conf to be consistent.
- Symlink the ns2/named.default.conf as a jinja2 template to pick a
  starting config. It is rendered as a template to avoid an error when
  the test would overwrite a git-tracked file.
- Use jinja2 templates for the ns3 files, keep named1.conf around
  because it's needed later in the test to restore the config. Symlink
  it to `ns3/named.conf.j2` to select a default config.
2025-12-09 14:23:14 +01:00
Nicki Křížek
54c95d6966 Use jinja2 templates in nsupdate test
- Merge ns1/tls.options.in into ns1/named.conf.j2 and render it
  conditionally. Also conditionally include the additional
  ns1/tls.conf.j2 which is always rendered.
- Use multiple templates for ns7 and replace the copy_setports.
- Use jinja2 template for verylarge.in as well.
2025-12-09 14:23:14 +01:00
Nicki Křížek
9fc446b6f5 Use jinja2 templates in notify test
- Merge options-tls.conf into named.conf in ns2 and ns4 and render it
  conditionally. Also conditionally include the additional
  named-tls.conf which is always rendered.
2025-12-09 14:23:14 +01:00
Nicki Křížek
8e525f2154 Use jinja2 templates in forward test
- Merge options-tls.conf into named.conf in ns2 and ns4 and render it
  conditionally. Also conditionally include the additional
  named-tls.conf which is always rendered.
- Use multiple templates for ns3 and ns9 and replace the copy_setports.
- In ns3/named2.conf, use "root2.db" directly rather than replacing it
  with "sed" later.
2025-12-09 14:23:14 +01:00
Nicki Křížek
3f953266fb Use jinja2 templates in logfileconf test
- Replace all named*.in files with jinja2 templates.
- Rename the config files to named.*.conf convention.
- Rename named.plain.in to named.plain.conf.j2 and symlink it as te
  default config.
- Rename named.plainconf.in to named.plainlog.conf.j2 (there is a slight
  difference from named.plain, despite the similar name)
2025-12-09 14:23:14 +01:00
Nicki Křížek
7f3b0afb09 Use jinja2 templates in runtime test
- Replace named-altX.conf.in with namedX.conf.j2 to stick with the same
  naming convention across the entire code base. Note than due to
  named1.conf being the first (default) config, the numbers for the altX
  are incremented.
- Turn alt9 into named7 to stick with the same number sequence. Adjust
  the related file names accordingly.
2025-12-09 14:23:14 +01:00
Nicki Křížek
b23301ec55 Use jinja2 templates in checkzone test
Render the bad-tsig.db file using jinja2 template to get rid of
copy_setports.

Since the zone is using @ character, use the raw directive to avoid
interpreting it as a variable start.
2025-12-09 14:23:14 +01:00
Nicki Křížek
13bd0d689a Use jinja2 templates in autosign test
- Include ns3/nsec-only.conf conditionally and always render it.
2025-12-09 14:23:14 +01:00
Nicki Křížek
1aa2f7249a Use jinja2 templates in tsiggss
- The ns1/named.conf.j2 contains "@" which is a special jinja character,
  use the raw directive to escape it.
2025-12-09 14:23:14 +01:00
Nicki Křížek
0f37603b1a Use jinja2 templates in transport-change test
- Replace named*.conf.in files with jinja2 templates.
- When applying the files use plain cp command to copy the rendered
  files.
2025-12-09 14:23:14 +01:00
Nicki Křížek
9d3279a542 Replace .in with .j2 templates for cases with namedX.conf
The following tests use multiple named configs. Previously, these have
been rendered with copy_setports in tests.sh when needed. Transform
these into jinja2 templates and render them during setup. In the tests,
the copy_setports invocations can be then replaced with a simple cp.
2025-12-09 14:23:14 +01:00
Nicki Křížek
fc10cb686d Replace .in with .j2 templates for simple copy_setports cases
Use jinja2 templates instead of *.in templates for named.conf and remove
the copy_setports invocations from setup.sh which are no longer needed.
2025-12-09 14:23:14 +01:00
Nicki Křížek
d6d6db52e3 Allow any named*.conf file as a system test artifact
This allows rendering multiple named*.conf files using the jinja2
template engine at test start and then simply copying the required
config to named.conf as needed.
2025-12-09 14:23:14 +01:00
Michal Nowak
ed33f44829 dns.name module does not have minversion attribute
The dns module does have it.
2025-12-09 11:17:20 +01:00
Aram Sargsyan
2622140482 Add a check to the catz test to confirm that the issue is fixed
Use a member zone with a long list of primaries with long key
names to trigger the issue that was fixed by the previous commit.
2025-12-09 18:09:45 +11:00
Nicki Křížek
19af19b31c Add FEATURE_* environment variables to system tests
The purpose of these variables is to be able to detect feature support
without calling feature-test. This becomes useful when detecting feature
support in jinja2 templates.
2025-12-08 18:07:41 +01:00
Nicki Křížek
2bb840bbc7 Remove unused dlz-filesystem feature check
There isn't any system test that uses this feature check.
2025-12-08 18:07:41 +01:00
Nicki Křížek
789e40bd4c Remove unused ipv6only feature check
There isn't any system test that uses this feature check.
2025-12-08 18:07:41 +01:00
Nicki Křížek
f33e2b6d87 Refactor NamedInstance.rndc() to use EnvCmd() interface
To unify the command handling, utilize EnvCmd() to handle rndc commands:

1. Remove isctest.rndc abstractions. They were intended for an upcoming
   python-only implementation. A couple of years later, it doesn't seem
   to be coming any time soon, so let's stick with the interface that
   makes sense today, i.e. use the same command handling interface
   everywhere.
2. Remove the specialized rndc.log in favor of the generic logging
   already implemented by isctest.run.cmd(). I believe the cause of the
   many rndc(log=False) invocations was that nobody wanted this extra
   file. Yet, logging everything by default makes sense for debugging,
   unless there's a good reason not to. In almost all cases, logging was
   switched to the default (enabled).
3. With the NamedInstance.rndc() call now returning CmdResult rather
   than combined stdout+stderr string, adjust all the invocations to use
   `.out` or `.err` as necessary.
4. Replace some manual rndc invocation and its base argument
   construction with the standardized nsX.rndc() call.
5. In cases where rndc is expected to fail, utilize
   raise_on_exception=False and check the `.rc` from the result, rather
   than handling an exception.
6. In addzone/tests_rndc_deadlock.py, refactor the test slightly to
   avoid using EnvCmd() entirely to avoid spamming the logs. This test
   calls rndc in a loop from multiple threads and such test case is an
   exception which doesn't warrant changing the `isctest.run.cmd()`
   implementation.
2025-12-08 14:57:47 +01:00
Nicki Křížek
ff613a72d7 Add generic isctest.run.EnvCmd helper to pytest
A generic helper that calls the environment-specified binaries in a
developer-friendly manner, i.e. passing arguments as strings rather than
having to split them first.

The isctest.run.cmd() remains as the basis which provides a clean and
robust interface, while the isctest.run.EnvCmd() can be used as a
convenient wrapper for tests, or when there are some shared default
parameters.

The isctest.run.Dig() is superseded with the isctest.run.EnvCmd(). In
the future, we might revisit adding Dig() or command-specific helpers
again, but it probably only makes sense if they offer command-aware
attributes / methods, rather than just being shortcuts to
isctest.run.EnvCmd().
2025-12-08 14:57:47 +01:00
Nicki Křížek
a8bf53411d Add pylint check for re.compile() alias
Ensure that Re() is used consistently across our code base.
2025-12-08 14:57:47 +01:00
Nicki Křížek
9bad9491a1 Improve file handling in ksr test
Refactor the file handling to write to a file directly when calling
isctest.run.cmd().

Refactor the existing code to use CmdResult rather than out and err
separately.
2025-12-08 14:57:47 +01:00
Nicki Křížek
4b6a86b029 Use Text with Grep support in isctest.run.cmd()
When commands are executed using the isctest.run.cmd() command, allow
the output to be Grep-able like logs and text files.
2025-12-08 14:57:47 +01:00
Nicki Křížek
7743bab5fc Refactor LogFile into TextFile with Grep support
Add a new Grep-like interface which can be used for searching for
regular expressions in files. Replace the prior LogFile used for named
logs with the new TextFile interface.
2025-12-08 14:57:47 +01:00
Nicki Křížek
be6bae2a75 Move text-related operations into isctest.text module
Add a new module for working with text and keep the isctest.log.watchlog
module focused on its purpose. Move LogFile and LineReader into the new
module. Add compile_pattern() helper which will be useful in subsequent
commits.
2025-12-08 14:57:47 +01:00
Nicki Křížek
ac7127d620 Use Re() for creating regular expressions
It's a fairly common pattern to use regular expression in our tests.
Instead of using the fairly verbose re.compile(), import that function
as Re() instead to allow for more brevity in the test syntax.
2025-12-08 14:57:47 +01:00
Nicki Křížek
ac998da3f6 Use CmdResult to decode stdout/stderr from isctest.run.cmd()
Avoid repeating the .decode("utf-8") snippet when processing command
output and provide a helper instead, which leads to more concise code.
2025-12-08 14:57:47 +01:00
Nicki Křížek
ac2be27f8f Utilize nsX.rndc() helper
Remove the duplicated code and replace it with nsX.rndc() call.
2025-12-08 13:29:40 +01:00
Colin Vidal
0b9da992a5 add tests for EDE 13 support
Add system test covering EDE 13 being added in the response in case of
SERVFAIL cache hits.
2025-12-05 23:28:29 +01:00
Matthijs Mekking
14a243a81d Fix statschannel system test
The manykeys test case relies on keys being removed. Make sure the
zone is fully signed with the keys that will stay, so the other keys
may be removed safely.

This means the expected number of signatures generated and refreshed
will change. The CDS and CDNSKEY RRset also need to be signed now.

Configure the test case with sig-signing-signatures 100, large enough
that the entire zone is processed in a single step.
2025-12-05 12:14:14 +01:00
Matthijs Mekking
a8339be0f8 Fix nsec3 system test
The nsec3 system test has a couple of cases where the configured policy
changes the algorithm, effectively triggering an algorithm rollover. Fix
those cases to start in a valid DNSSEC state. Then fix the expected key
states, no longer should the old algorithm be removed immediately.
2025-12-05 12:14:14 +01:00