Commit graph

269 commits

Author SHA1 Message Date
Evan Hunt
22d688f656 Remove -n option from dnssec-keygen/keyfromlabel
The -n (nametype) option for keys defaults to ZONE for DNSKEY
type keys, and HOST for KEY type keys. There is currently no
practical reason to use any other name type; we can simplify
things by removing the option.
2025-03-25 23:48:23 +00:00
Aram Sargsyan
3482d7e694 Test dig +svcparamkeycompat
This check in the nsupdate system test expects the opaque
representation of the "dohpath" Service Parameter Key. Use
the +svcparamkeycompat dig option to enable it.
2025-02-17 17:33:43 +00:00
Matthijs Mekking
b121f02eac Unify parental-agents, primaries to remote-servers
Having zone statements that are also top blocks is confusing, and if
we want to add more in the future (which I suspect will be for
generalized notifications, multi-signer), we need to duplicate a lot
of code.

Remove top blocks 'parental-agents' and 'primaries' and just have one
top block 'remote-servers' that you can refer to with zone statements.
2024-12-13 08:50:02 +01:00
Matthijs Mekking
3adabb4f89 Add test case for nsupdate hangs on large update
This test case hangs, despite the update being performed on the
name server.
2024-12-05 15:40:48 +01:00
Artem Boldariev
384c92880e Use FIPS compatible DH-param files
When the tests were added, the files were generated without FIPS
compatibility in mind. That made the tests fail on recent OpenSSL
versions in FIPS mode.

So, the files were regenerated on a FIPS compliant system using the
following stanza:

$ openssl dhparam -out <file> 3072

Apparently, the old files are not valid for FIPS starting with OpneSSL
3.1.X release series as "FIPS 140-3 compliance changes" are mentioned
in the changelog:

https://openssl-library.org/news/openssl-3.1-notes/
2024-12-04 18:08:51 +02:00
JINMEI Tatuya
000720fe14 update system tests to confirm new log messages 2024-11-26 16:39:48 +11:00
Nicki Křížek
f2cb2e5723 Remove invocations and mentions of clean.sh 2024-11-08 10:54:24 +01:00
Nicki Křížek
7c259fe254 Replace clean.sh files with extra_artifacts mark
The artifact lists in clean.sh and extra_artifacts might be slightly
different. The list was updated for each test to reflect the current
state.
2024-11-08 10:54:24 +01:00
Mark Andrews
0d65af8bf2 Check update-policy logs 2024-10-23 10:48:43 +11:00
Mark Andrews
3b0de4773b check 'update-policy 6to4-self' over IPv6 2024-08-01 15:17:30 +10:00
Mark Andrews
b28e5ff721 check 'update-policy 6to4-self' over IPv4 2024-08-01 15:17:30 +10:00
Aram Sargsyan
d28fd93a58 Use trust anchors with 'dnssec-validation yes' in system tests
Explicitly use an empty 'trust-anchors' statement in the system
tests where it was used implicitly before.

In resolver/ns5/named.conf.in use the trust anchor in 'trusted.conf',
which was supposed to be used there.
2024-02-02 19:54:09 +00:00
Tom Krizek
8434e5abfc
Blackhole queries to root servers in tests
Some tests don't have a mock root server configured, because they don't
need one. However, these tests might still leak queries to actual name
servers. Add a shared root hints file which can serve as a blackhole for
these queries.
2024-01-18 17:19:39 +01:00
Tom Krizek
f314f1b432
Move custom pytest markers into isctest module
Keep our pytest code more organized by moving the shared code for custom
pytest markers into a dedicated isctest/mark.py module.
2024-01-10 14:57:13 +01:00
Tom Krizek
124882476b
Allow nsupdate test rerun on FreeBSD
The "exceeded time limit waiting for literal 'too many DNS UPDATEs
queued' in ns1/named.run" is prone to fail due to a timing issue.
Despite out efforts to stabilize it, the check still often fails on
FreeBSD in our CI. Allow the test to be re-run on this platform.
2024-01-10 13:18:04 +01:00
Tom Krizek
3c7291248c
Handle dig timing out gracefully in nsupdate 2024-01-08 17:03:35 +01:00
Matthijs Mekking
abdaa77303 Change max NSEC3 iterations in system tests to 50
The dnssec and nsupdate system tests need to be adjusted to accept
a lower maximum value for NSEC3 iterations.
2023-12-05 14:58:58 +00:00
Tom Krizek
1e181cf61d
Remove -U 4 from system tests
This option doesn't appear to be needed for any of the tests, so remove
it to keep things simple.
2023-12-01 14:03:35 +01:00
Ondřej Surý
f8e264ba6d
Remove the lock-file configuration and -X argument to named
The lock-file configuration (both from configuration file and -X
argument to named) has better alternatives nowadays.  Modern process
supervisor should be used to ensure that a single named process is
running on a given configuration.

Alternatively, it's possible to wrap the named with flock(1).
2023-10-26 22:42:37 +02:00
Tom Krizek
4cb8b13987
Reformat shell scripts with shfmt
All changes in this commit were automated using the command:

  shfmt -w -i 2 -ci -bn . $(find . -name "*.sh.in")

By default, only *.sh and files without extension are checked, so
*.sh.in files have to be added additionally. (See mvdan/sh#944)
2023-10-26 10:23:50 +02:00
Tom Krizek
9cc821d42f
Add prereq.sh scripts for system tests requiring perl mod DNS
prereq.sh mechanism for dependency detection is preferred since it works
for both legacy and pytest runner.
2023-09-19 14:47:47 +02:00
Tom Krizek
168dba163c
Rename system test directory with common files to _common
The old name "common" clashes with the convention of system test
directory naming. It appears as a system test directory, but it only
contains helper files.

To reduce confusion and to allow automatic detection of issues with
possibly missing test files, rename the helper directory to "_common".
The leading underscore indicates the directory is different and the its
name can no longer be confused with regular system test directories.
2023-09-19 13:29:27 +02:00
Mark Andrews
2b7192c5be Check that removal of nonexistent PTR and SRV records work
There was a bug in rr_exists that caused it to fail when the
name didn't exist in the zone.
2023-08-30 00:48:50 +10:00
Mark Andrews
6d0f19da7d Correctly grep nextpart output 2023-08-01 23:47:55 +00:00
Matthijs Mekking
bbfdcc36c8 Add inline-signing to dnssec-policy
Add an option to enable/disable inline-signing inside the
dnssec-policy clause. The existing inline-signing option that is
set in the zone clause takes priority, but if it is omitted, then the
value that is set in dnssec-policy is taken.

The built-in policies use inline-signing.

This means that if you want to use the default policy without
inline-signing you either have to set it explicitly in the zone
clause:

    zone "example" {
        ...
        dnssec-policy default;
        inline-signing no;
    };

Or create a new policy, only overriding the inline-signing option:

    dnssec-policy "default-dynamic" {
        inline-signing no;
    };

    zone "example" {
        ...
        dnssec-policy default-dynamic;
    };

This also means that if you are going insecure with a dynamic zone,
the built-in "insecure" policy needs to be accompanied with
"inline-signing no;".
2023-08-01 06:55:48 +00:00
Mark Andrews
3a2a24903c Check GSS-API TKEY against non configured server
Check for the expected error message which includes rcode REFUSED
then reload the server to specify the keytab for the rest of the
GSSAPI tests.
2023-07-28 14:38:20 +10:00
Matthijs Mekking
660d089dca Update nsupdate system test
Remove from the nsupdate system test two test cases that are no longer
supported: We no longer support adding signing keys via dynamic update.
2023-07-20 11:04:23 +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
86765ad1d3
Handle non-zero return codes in nsupdate test 2023-07-14 15:49:16 +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
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
Mark Andrews
e3e20ed76e Emit deprecated warning for K* file pairs
We try reading the same file using different methods so only
emit a warning if we successfully read the file.
2023-06-29 08:28:48 +10:00
Mark Andrews
e1fb17e72c Test support with legacy HMAC K files with nsupdate
tsig-keygen generates key files that are different to those that
where generated by dnssec-keygen.  Check that nsupdate can still
read those old format files.
2023-06-29 08:28:48 +10:00
Evan Hunt
0b09ee8cdc explicitly set dnssec-validation in system tests
the default value of dnssec-validation is 'auto', which causes
a server to send a key refresh query to the root zone when starting
up. this is undesirable behavior in system tests, so this commit
sets dnssec-validation to either 'yes' or 'no' in all tests where
it had not previously been set.

this change had the mostly-harmless side effect of changing the cached
trust level of unvalidated answer data from 'answer' to 'authanswer',
which caused a few test cases in which dumped cache data was examined in
the serve-stale system test to fail. those test cases have now been
updated to expect 'authanswer'.
2023-06-26 13:41:56 -07:00
Matthijs Mekking
5cf91728d1 Add dynamic update prepub and doubleksk test case
Add two test cases for zones that use auto-dnssec, but not
inline-signing, and make sure that the change for find_zone_keys()
do not affect introducing a new key that is intended for signing.

See note https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/7638#note_355944
2023-06-14 09:08:56 +02:00
Tom Krizek
5893debf46
Remove trailing whitespace from all text files
I've used the following command to remove the trailing whitespace for
all tracked text files:

git grep -Il '' | xargs sed -i 's/[ \t]*$//'
2023-06-13 15:05:40 +02:00
Tom Krizek
2f5bf6d971
Add pytest functions for shell system tests
In order to run the shell system tests, the pytest runner has to pick
them up somehow. Adding an extra python file with a single function
for the shell tests for each system test proved to be the most
compatible way of running the shell tests across older pytest/xdist
versions.

Modify the legacy run.sh script to ignore these pytest-runner specific
glue files when executing tests written in pytest.
2023-05-22 14:11:39 +02:00
Aram Sargsyan
5ce2ed0688 Add nsupdate timeout tests
* nsupdate should take 12 seconds (one try and three retries with
  3 second timeout for each), UDP mode
* nsupdate -u 4 -r 1 should take 8 seconds (one try and one retry with
  4 second timeout for each), UDP mode
* nsupdate -u 0 -t 8 -r 1 should also take 8 seconds, UDP mode
* nsupdate -u 4 -t 30 -r 1 should also take 8 seconds, as -u takes
  precedence over -t, UDP mode
* nsupdate -t 8 -v should also take 8 seconds, TCP mode
2023-04-03 15:21:43 +00:00
Mark Andrews
c80ccf5a25 nsupdate: tls does not work in FIPS mode prior to OpenSSL 3.0.0 2023-04-03 12:44:27 +10:00
Mark Andrews
ff7e73db6a nsupdate: use FIPS compatible algorithms
HMACMD5 is not permitted in FIPS mode, use HMACSHA256 instead.
2023-04-03 12:44:27 +10:00
Petr Menšík
6ad794a8cd FIPS tests changes for RHEL
Include MD5 feature detection in featuretest tool and use it in some
places. When RHEL distribution or Fedora ELN is in FIPS mode, then MD5
algorithm is unavailable completely and even hmac-md5 algorithm usage
will always fail. Work that around by checking MD5 works and if not,
skipping its usage.

Those changes were dragged as downstream patch bind-9.11-fips-tests.patch
in Fedora and RHEL.
2023-02-15 15:44:28 +11:00
Mark Andrews
df7f3c47c6 Send grep output to /dev/null in nsupdate test 2023-02-08 22:20:21 +00:00
Evan Hunt
06b1faf068 increase simultaneous updates for quota test
the nsupdate system test was intermittently failing due to the update
quota not being exceeded when it should have been.  this is most likely
a timing issue: the client is sending updates too slowly, or the server
is processing them too quickly, for the quota to fill. this commit
attempts to make that the failure less likely by increasing the number
of update transactions from 10 to 20.
2023-02-07 23:36:02 -08:00
Michał Kępień
4e934bae0b BIND 9.19.9
-----BEGIN PGP SIGNATURE-----
 
 iQJDBAABCgAtFiEENKwGS3ftSQfs1TU17QVz/8hFYQUFAmPAfwYPHG1pY2hhbEBp
 c2Mub3JnAAoJEO0Fc//IRWEFpmAP/23tasuol54W1dxnjGoQ7NYDV89ywQiWplyn
 syPs+iESFb3I9SlAHHhRGM0IREuDxjuexFdrIJOfZqokg36qPj+z81LRlRuRuetc
 HigGzpt2CDP41rVMsxzW3vyh2a3fTrjBKYT4tnDlsdnbwJOfFG4N/hdB7jqDPWut
 u1Itf/lD8iHhsISgFqvtKiQqc6XFwwzVAeSPH6pHnmngt16imVoQiddnw1RYn0vB
 EPcqhVvSeYS1AGWprnHpaWt8bru460iZwet+QKlxNxW6p4mOXGr6jQWqhZ+6ORDr
 Vo/a3+5Di+tNn89GJSbehLi5UQbvrcMR8WiQ54WP/k0PPTgoqMRC4PerLsNU8Vzq
 y1k18n8DMsuro92cNAdJk3gXuXYgGNF2sk9JtqwmiDo1/6G3afKfDiVKjiK1CxK0
 1CMKD+mPHCWB/H5U50oL1z89OCZDVUBUDT0YIrCBBrTIitzyXyAFkh+sjbRbdzww
 kg1GdZ4ODaydcWYH7r3RCHWDX6nkwADqGRk0SYvrJTFL2Hu150mwuxZj/5UZcmsz
 of6qh5b9yZrDrnBHgoqknnepuxiORFF7l3kk63fA13WG6S1m6h2ZONoVLw0J67dx
 mnAo0nlnWKi+TEl/CHiHcMZbeVhE/jrHAMPIcQQphKbCeQT1NPFSU2FQxa+dpix+
 V+y8x6Qb
 =TTpT
 -----END PGP SIGNATURE-----

Merge tag 'v9_19_9'

BIND 9.19.9
2023-01-25 21:16:00 +01:00
Aram Sargsyan
d02be5e693 Fix nsupdate system test CA certificate signing validity days
The validity default days value of 1 was used for debugging and
left as such accidentally.

Use 10950 days, as used elsewhere (for example, in doth test CA).

This does not affect anything, the value will be effective when
generating new test certificates in the future.
2023-01-20 14:45:30 +00:00
Evan Hunt
b91339b80e test failure conditions
verify that updates are refused when the client is disallowed by
allow-query, and update forwarding is refused when the client is
is disallowed by update-forwarding.

verify that "too many DNS UPDATEs" appears in the log file when too
many simultaneous updates are processing.
2023-01-12 11:52:48 +01:00
Evan Hunt
916ea26ead remove nonfunctional DSCP implementation
DSCP has not been fully working since the network manager was
introduced in 9.16, and has been completely broken since 9.18.
This seems to have caused very few difficulties for anyone,
so we have now marked it as obsolete and removed the
implementation.

To ensure that old config files don't fail, the code to parse
dscp key-value pairs is still present, but a warning is logged
that the feature is obsolete and should not be used. Nothing is
done with configured values, and there is no longer any
range checking.
2023-01-09 12:15:21 -08:00
Tom Krizek
c100308b7d
Simplify start/stop helper func in system tests
The system test should never attempt to start or stop any other server
than those that belong to that system test. Therefore, it is not
necessary to specify the system test name in function calls.

Additionally, this makes it possible to run the test inside a
differently named directory, as its name is automatically detected with
the $SYSTESTDIR variable. This enables running the system tests inside a
temporary directory.

Direct use of stop.pl was replaced with a more systematic approach to
use stop_servers helper function.
2022-11-25 09:27:33 +01:00
Matthijs Mekking
cd2f619842 Remove dynamic update key management tests
Remove test cases that rely upon key and denial of existence
management operations triggered by dynamic updates.

The autosign system test needed a bit more care than just removing
because the test cases are dependent on each other, so there are some
additional tweaks such as setting the NSEC3PARAM via rndc signing,
and renaming zone input files. In the process, some additional
debug output files have been added, and a 'ret' fail case overwrite
was fixed.
2022-11-18 11:04:17 +01:00