Commit graph

18 commits

Author SHA1 Message Date
Nicki Křížek
317cd12779 Create common templates for test zones
Add commonly used zone-related data (config snippet and zone file
snippets) as templates which can be reused by filling in different data.

Adjust the isctest.template.Zone to use filepath argument rather than
filename for clarity.
2026-05-27 16:25:44 +02:00
Nicki Křížek
fa3a59e70c Improve isctest.template dataclasses' defaults
Extend the Nameserver to generate the default IPv4/IPv6 values, add NSX
values for the predefined nameservers (there are 11 of them, as per
bin/tests/system/ifconfig.sh.in max value). Add the missing ns11
fixture.

Extend the Zone to derive the zone filename by default, unless
specified.

Adjust the existing uses of these classes to utilize the simplified
defaults.
2026-05-27 14:19:31 +00:00
Štěpán Balážik
790745da18 Built-in types are now subscriptable
Generated with: ruff check --extend-select UP006 --fix
2026-02-20 15:17:32 +01:00
Štěpán Balážik
ef21b77912 Make default_algorithm accessible through a fixture and method
Importing pytest fixture trips up static analysis tools, so move
default_algorithm to conftest.py and use it instead of os.environ
accesses in various system tests.

For use outside test function, use Algorithm.default().
2026-02-20 15:17:32 +01:00
Štěpán Balážik
ffd5b6ac26 Automatically sort imports in Python code
Generated with: ruff check --extend-select I --fix (with the changes to
pyproject.toml applied).
2026-02-20 15:17:32 +01:00
Matthijs Mekking
f6749a432b Add isctest.kasp.SettimeOptions
This Class sets settime parameters and these can be called with key.settime()
that runs dnssec-settime on the given key with the given parameters.
2025-12-22 09:04:46 +00:00
Matthijs Mekking
594ff0816a Drop and replace CmdHelper with EnvCmd
A generic helper that calls environment-specified binaries has been added,
drop and replace the introduced CmdHelper for the more generic method.
2025-12-19 11:49:00 +01:00
Matthijs Mekking
e172b4ff1a rollover-zsk-prepub: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM@ in ns3/kasp.conf.j2 to
ecdsa256 and rename to ns3/kasp.conf.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
da04c75cec rollover-straight2none: From setup.sh to pytest bootstrap
Similar to rollover-going-insecure.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
4ed35f02b1 rollover-ksk-3crowd: From setup.sh to pytest bootstrap
Similar to rollover-ksk-doubleksk.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
08236f4bd6 rollover-ksk-doubleksk: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM@ in ns3/kasp.conf.j2 to
ecdsa256 and rename to ns3/kasp.conf.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
cc4244f384 rollover-going-insecure: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM@ in ns3/kasp.conf.j2 to
ecdsa256 and rename to ns3/kasp.conf.

Now we have to fake different lifetimes, so adjust fake_lifetime
to update a single key.

Note that we have changed the setup slightly: We also sign the
step2 zones, but with post validation disabled. This is more
accurate because we need to test that the public keys and signatures
are being removed from the zone.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
ef2a824df6 rollover-enable-dnssec: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM_NUMBER@ in ns3/kasp.conf.j2 to
13 and rename to ns3/kasp.conf.

This test introduces an unsigned delegation, adjust render_and_sign_zone
and configure_tld accordingly.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
ef7d617e3f rollover-csk-roll2: From setup.sh to pytest bootstrap
Similar to rollover-csk-roll1.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
1635bcf1ef rollover-csk-roll1: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM@ in ns3/kasp.conf.j2 to
ecdsa256 and rename to ns3/kasp.conf.

Write a python method to set the key predecessor/successor relationship
into the key state files.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
72d3551355 rollover-algo-ksk-zsk: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

The RSASHA256 keys are generated with dnssec-keygen, without a policy
provided. Thus we have to fake the lifetime for these keys.

Signing has to be done without the -z option, because the KSK should
not sign all records in case of a KSK/ZSK split. Update the signing
code to allow for extra options when signing with CSK only.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
3a6ed195fa rollover-algo-csk: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM@ in ns3/csk2.conf.j2 to
ecdsa256 and rename to ns3/csk2.conf.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
f31514e658 rollover: From setup.sh to pytest bootstrap
Introduce rollover/setup.py for all setup related test code.

Introduce rollover/ns1 and rollover/ns2 to create a chain of trust to
all rollover related test zones. The tld zones in rollover/ns2 contain
a DSYNC record that at a later time will be used for testing Generalized
DNS Notifications.

Write a python version of private_type_record so we can put such
records in the zone via jinja2 templating.
2025-12-19 11:47:49 +01:00