2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 22:45:39 +00:00
Commit Graph

6385 Commits

Author SHA1 Message Date
Nicki Křížek
ac7c657d19 Move isctest.var initialization to conftest.py
The environment variable initialization requires logging to be set up
first. Ensure the initialization is delayed until loggers have been set
up.
2024-05-09 17:08:11 +02:00
Tom Krizek
2a09f632ab Use a dedicated file for each autoconf variable
To avoid any escaping issues or messing with a language-specific format
when the variable has to be parsed, create a dedicated file for each
variable that is obtained from autoconf.
2024-05-09 17:08:10 +02:00
Tom Krizek
2d1f348483 Move env var initialization to isctest.vars
Make sure all initialization takes place in isctest.vars.__init__ and
export the initial env vars there. Remove the no longer needed env
fixture and use os.environ instead.
2024-05-09 17:08:10 +02:00
Tom Krizek
1f6f2234d8 Move dir env var handling to isctest.vars.dirs 2024-05-09 17:08:10 +02:00
Tom Krizek
41cb553bdd Move port env vars into isctest.vars.ports module
The fixture for port assignment isn't needed, replace it with the common
way of handling environment variables.
2024-05-09 17:08:10 +02:00
Tom Krizek
cca26efe52 Don't export openssl-related env vars unless set
If OPENSSL_CONF is exported as an empty string, it will cause issues on
rhel9fips. Allow the environment variables to be set and exported, but
make sure to only export them if they have been set by the user.
2024-05-09 17:08:09 +02:00
Tom Krizek
b100ce4c88 Parse openssl-related vars in pytest
The openssl config needs to be parsed for some tests that use SoftHSM2.
Rewrite the parsing to python and ensure the required variables are
properly set test-wide.
2024-05-09 17:08:09 +02:00
Tom Krizek
46433ae17b Coalesce system test variables
Provide a single point of access to all the variables used by tests. Use
a custom dict-like structure to access the underlying data without
making a copy. This allows the individual modules to update the contents
at runtime, which is used for some variables.
2024-05-09 17:08:09 +02:00
Tom Krizek
308a8727e5 Format conf.sh with shfmt
No manual changes in this commit - simply running shfmt for proper shell
code formatting.
2024-05-09 17:08:09 +02:00
Tom Krizek
8c6e6758b5 Load env vars in shell-only processing of conf.sh
While this isn't required for pytest operation and execution of the
system test suite, it can be handy to allow test script development and
debugging. Especially setup scripts often source conf.sh and expect
environment variables to be loaded. If these scripts are executed
stand-alone, the environment variables need to be loaded from the python
package.
2024-05-09 17:08:09 +02:00
Tom Krizek
ab27f504ca Move environment variables from conf.sh to pytest
Remove conf.sh.in and move the environment variables into isctest/vars
python package. This enabled the removal of an ugly pytest hack which
loaded and parsed these variables from the environment.
2024-05-09 17:08:08 +02:00
Tom Krizek
b3caa9226d Remove terminal color support from conf.sh.common
Pytest processes all the output, so the terminal colors are no longer
interpreted. Remove the obsolete code.
2024-05-09 17:08:07 +02:00
Mark Andrews
1482e9bbb9 Address qp/rbtdb backup file style differences
qp and rbtdb produce stylistically different backup files.  This
was causing the xferquota system test to fail.  This has been
addressed by making the test independent of the stylistic differences.
2024-05-09 15:03:45 +02:00
Mark Andrews
e697d20f00 Test including a directory in a zone file 2024-05-07 10:01:12 +10:00
Mark Andrews
32535de856 Test $GENERATE in nibble mode with a negative value
Negative values used to cause $GENERATE to loop forever.
2024-05-07 09:19:43 +10:00
Matthijs Mekking
02f5d82333 Update hours-vs-days test
This test is outdated because it tested the 'sig-validity-interval'
option that has been replaced by dnssec-policy's 'signatures-validity',
'signatures-refresh', and 'signatures-jitter' options.

Nevertheless, it tests if the jitter is spread correctly.

Update the test to make use of 'signatures-jitter', set the value
to 1 day (meaning resign in 499 days since 'signatures-validity' is
set to 500 days).

Note that this previously changed erroneously the refresh value to
449 days (should have been 499 days, but that is not allowed by
checkconf, since it is above 90% of 'signatures-validity').
2024-05-06 14:44:10 +02:00
Matthijs Mekking
a68f8c7cf0 Fix dnssec system test iterations too high
After we have changed the maximum allowed iterations to 51 for signing,
the NSEC3 chain has changed and requires one more NSEC to be returned
in the answer (plus corresponding RRSIG). So the expected number or
records in the authority section is now 8.
2024-05-06 14:44:10 +02:00
Matthijs Mekking
fc5eb493c9 Offline KSK and dnssec-policy not yet supported
If the key is offline and the keymgr runs, it will treat it as a missing key,
and generate a new key (according to the policy). Fix the test by putting
back the KSK temporarily when we run 'rndc loadkeys'.
2024-05-06 14:44:10 +02:00
Matthijs Mekking
ebb90ba77f Fix ZSK rollovers in dnssec system test
1. When generating keys, don't set timing metadata. Otherwise keys
   are considered to be in use and won't be selected when dnssec-policy
   starts a new key rollover.

2. Add an extra check to make sure the new ZSK (zsk2) is prepublished.
   Also add a check to make sure it has become active.

3. When using dnssec-settime, add -s to also write to key state files.
2024-05-06 14:44:10 +02:00
Tom Krizek
2e26eac31c Ensure dnssec test doesn't leak queries to root servers
The config was recently modified to ensure ns4 won't leak any queries to
root servers. However, the test wasn't executed and it turns out the way
this was handled actually broke the test case. Add our custom root hint
to both of the views to ensure the test can still pass without leaking
any queries.
2024-05-06 14:44:09 +02:00
Tom Krizek
672b07a503 Re-enable accidentally disabled dnssec checks
Remove the premature exit statement which made the rest of the checks
unreachable.
2024-05-06 14:44:08 +02:00
Matthijs Mekking
5d7e613e81 RPZ response's SOA record is incorrectly set to 1
An RPZ response's SOA record TTL is set to 1 instead of the SOA TTL,
a boolean value is passed on to query_addsoa, which is supposed to be
a TTL value. I don't see what value is appropriate to be used for
overriding, so we will pass UINT32_MAX.
2024-05-06 11:38:36 +02:00
Matthijs Mekking
6b7bd77596 Don't add KSKs to the KSR
Creating the KSR happens on the "ZSK side". The KSK is offline and while
the public key and state file may be present, draft-icann-dnssec-keymgmt-01.txt
suggest that the KSR only contains ZSKs.

This is also what knot dns does, so it would also be in the spirit of
interoperability.
2024-05-06 10:54:41 +02:00
Matthijs Mekking
0071e6c10a Fix missing version in KSR
The final line in a KSR ";; KeySigningRequest generated at ..." was
missing the version number, that has now been fixed.

Thanks Libor Peltan for reporting.
2024-05-06 09:52:01 +02:00
Ondřej Surý
6c54337f52 avoid a race in the qpzone getsigningtime() implementation
the previous commit introduced a possible race in getsigningtime()
where the rdataset header could change between being found on the
heap and being bound.

getsigningtime() now looks at the first element of the heap, gathers the
locknum, locks the respective lock, and retrieves the header from the
heap again.  If the locknum has changed, it will rinse and repeat.
Theoretically, this could spin forever, but practically, it almost never
will as the heap changes on the zone are very rare.

we simplify matters further by changing the dns_db_getsigningtime()
API call. instead of passing back a bound rdataset, we pass back the
information the caller actually needed: the resigning time, owner name
and type of the rdataset that was first on the heap.
2024-04-25 15:48:43 -07:00
Petr Menšík
2b348a5daa Change exception SPDX to Autoconf-exception-generic
License text is in fact Autoconf generic exception, with already defined
SPDX identificator. Use that instead.

https://spdx.org/licenses/Autoconf-exception-generic.html
2024-04-24 09:46:58 +00:00
Mark Andrews
580c41de0d check behaviour with invalid notify-source-v6 address
This was reported as causing the server to fail to shutdown on
NetBSD.  Look for the expected informational and error messages.
2024-04-24 10:12:42 +10:00
Matthijs Mekking
d9c947c57d Add test cases for CDS/CDNSKEY
Add two more test cases to ensure that a Signed Key Response file
creates signed CDNSKEY and/or CDS RRsets according to the policy.
2024-04-19 13:52:21 +02:00
Matthijs Mekking
cdf0fd2e5e Adjust system test to expect CDS and CDNSKEY
Requires storing the KSK keyfile identifier to calculate the expected
CDS and CDNSKEY.
2024-04-19 13:52:21 +02:00
Matthijs Mekking
46785dc71e sh the fmt up
Apply shfmt patch. Ideally I fixup every commit that changes testing,
but that is just too much at this point.
2024-04-19 13:52:21 +02:00
Matthijs Mekking
695be761b0 Test dnssec-ksr sign
Add test cases for the 'sign' command. Reuse the earlier generated KSR
files.

Also update dnssec-ksr.c to have better cleanup.
2024-04-19 10:41:04 +02:00
Matthijs Mekking
31521fade2 Change ksr format
Make the ksr format compatible with knot.
2024-04-19 10:41:04 +02:00
Matthijs Mekking
852ba174dd Test dnssec-ksr request
Add test cases for the 'request' command. Reuse the earlier
pregenerated ZSKs. We also need to set up some KSK files, that can
be done with 'dnssec-keygen -k <policy> -fK' now.

The 'check_keys()' function is adjusted such that the expected active
time of the successor key is set to the inactive time of the
predecessor. Some additional information is saved to make 'request'
testing easier.
2024-04-19 10:41:04 +02:00
Matthijs Mekking
1cb345fa95 Add ksr system test
Add a system test for testing dnssec-ksr, initally for the keygen
command. This should be able to create or select key files given a
DNSSEC policy and a time window.
2024-04-19 10:41:04 +02:00
Matthijs Mekking
77d4afba1b Introduce new DNSSEC tool dnssec-ksr
Introduce a new DNSSEC tool, dnssec-ksr, for creating signed key
response (SKR) files, given one or more key signing requests (KSRs).

For now it is just a dummy tool, but the future purpose of this utility
is to pregenerate ZSKs and signed RRsets for DNSKEY, CDNSKEY, and CDS
for a given period that a KSK is to be offline.
2024-04-19 10:41:04 +02:00
Matthijs Mekking
c3d8932f79 Add checkconf check for signatures-jitter
Having a value higher than signatures-validity does not make sense
and should be treated as a configuration error.
2024-04-18 09:50:33 +02:00
Matthijs Mekking
50bd729019 Update autosign test to use signatures-jitter
Now that we have an option to configure jitter, use it in system tests
that test jitter.
2024-04-18 09:50:10 +02:00
Matthijs Mekking
2a4daaedca Add signatures-jitter option
Add an option to speficy signatures jitter.
2024-04-18 09:50:10 +02:00
Mark Andrews
7c369ea3d9 Check that notify message was sent over IPv6 2024-04-11 18:05:25 +00:00
Evan Hunt
2c88946590 dns_name_dupwithoffsets() cannot fail
this function now always returns success; change it to void and
clean up its callers.
2024-04-10 22:51:07 -04:00
Ondřej Surý
304b5ec1ad Deprecate fixed value for the rrset-order option
Mark the "fixed" value for the "rrset-order" option deprecated, so we
can remove it in the future.
2024-04-02 15:21:00 +00:00
Ondřej Surý
7c96bf3e71 Deprecate sortlist option
Mark the sortlist option deprecated, so we can remove it in the
future.
2024-04-02 16:26:39 +02:00
Evan Hunt
b4cc46de07 add a test for handling illegal NS below DNAME
an assertion could be triggered in the QPDB cache if an NS
was encountered that pointed to a name below a DNAME.
2024-04-02 10:00:03 +02:00
Mark Andrews
2789906ce4 Checking nxdomain-redirect against built-in RFC-1918 zone
Check that RFC 1918 leak detection does not trigger an assertion
when nxdomain redirection is enabled in the server but not for the
RFC 1918 reverse namespace.
2024-03-28 13:15:45 +01:00
Tom Krizek
d1f1b6a934 Mark the enginepkcs11 test as flaky
There are frequent intermittent failures due to "crypto failure".
2024-03-21 16:25:02 +01:00
Tom Krizek
3712a219cb Re-enable enginepkcs11 system test
The condition in prereq.sh which attempts to match two string uses
integer equality operation. This results in an error, causing the
enginepkcs11 test to always be skipped. Use = operator for the string
comparison instead.
2024-03-21 16:25:00 +01:00
Tom Krizek
a061fd67f6 Mark the autosign system test as flaky
The autosign test uses sleep in many cases to wait for something to
happen. This inevitably leads to an instability that manifests in our
CI. Allow an automatic rerun of the test to improve its stability.
2024-03-21 15:26:28 +01:00
Tom Krizek
86a192cece Export variable in resolver system test
Variable assignment when calling subroutines might not be portable.
Notably, it doesn't work with FreeBSD shell, where the value of HOME
would be ignored in this case.

Since the commands are already executed in a subshell, export the HOME
variable to ensure it is properly handled in all shells.
2024-03-21 13:25:00 +01:00
Mark Andrews
ad083897cc Stop named-checkzone leaking test queries 2024-03-21 01:10:36 +00:00
Mark Andrews
49561277de Add RESOLVER.ARPA to the built in empty zones
RFC 9462 adds RESOLVER.ARPA to the list of built in empty zones.
2024-03-21 07:45:55 +11:00