Compare commits

...

54 Commits

Author SHA1 Message Date
Nicki Křížek
82ca097f54 Replace selected setup.sh system test files
These setup.sh scripts only do templating and copying files. Both of
these can be replaced with either jinja templates, or using plain files.
Since each test invocation creates its own temporary directory, copying
files to ensure a "clean" state is no longer necessary.

In cases where named writes some content to the files, a jinja template
can be used instead of a plain file to avoid an artifact check which
would detect a change to a git-tracked file.
2024-10-04 17:43:06 +02:00
Nicki Křížek
e30f0c2b13 TODO can be squashed after !9426 is merged 2024-10-04 17:35:05 +02:00
Nicki Křížek
0e20352b02 Replace the trivial setup.sh system test files
All these setup files only use copy_setports function which can be done
with jinja2 templates instead -- simply by renaming the .in files to
.j2, without any other changes. The pytest runner will render these
templates during test setup without any need for an additional script.
2024-10-04 17:33:53 +02:00
Nicki Křížek
204d70d97e DROP use bind9-staging images with jinja2
This can be dropped once isc-projects/images!343 is merged.
2024-10-04 17:33:53 +02:00
Nicki Křížek
eca952946a DROP Support jinja2 templates in pytest runner
Once https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/9587 is
merged, this commit should be dropped.
2024-10-04 17:33:53 +02:00
Nicki Křížek
3588ac1166 Remove invocations and mentions of clean.sh 2024-10-04 17:25:48 +02:00
Nicki Křížek
68f4792756 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-10-04 17:25:48 +02:00
Nicki Křížek
c4e5f3b5f0 fixup! Add pytest fixture for checking test artifacts 2024-10-04 17:25:48 +02:00
Michał Kępień
7f37e446b8 Add pytest fixture for checking test artifacts
Prior to introducing the pytest runner, clean.sh files were used as a
list of files that the test is expected to leave around as artifacts and
check that no extra files were created.

With the pytest runner, those scripts are no longer used, but the
ability to detect extraneous files is still useful. Add a new
"extra_artifacts" mark which can be used for the same purpose.
2024-10-03 10:29:50 +02:00
Ondřej Surý
27c4d7ef6d fix: dev: Don't enable REUSEADDR on outgoing UDP sockets
The outgoing UDP sockets enabled `SO_REUSEADDR` that allows sharing of the UDP sockets, but with one big caveat - the socket that was opened the last would get all traffic.  The dispatch code would ignore the invalid responses in the dns_dispatch, but this could lead to unexpected results.

Merge branch 'ondrej/fix-outgoing-UDP-port-selection' into 'main'

See merge request isc-projects/bind9!9569
2024-10-02 12:16:03 +00:00
Ondřej Surý
eec30c33c2 Don't enable SO_REUSEADDR on outgoing UDP sockets
Currently, the outgoing UDP sockets have enabled
SO_REUSEADDR (SO_REUSEPORT on BSDs) which allows multiple UDP sockets to
bind to the same address+port.  There's one caveat though - only a
single (the last one) socket is going to receive all the incoming
traffic.  This in turn could lead to incoming DNS message matching to
invalid dns_dispatch and getting dropped.

Disable setting the SO_REUSEADDR on the outgoing UDP sockets.  This
needs to be done explicitly because `uv_udp_open()` silently enables the
option on the socket.
2024-10-02 12:15:53 +00:00
Ondřej Surý
fe305f96c9 fix: usr: Fix assertion failure when receiving DNS responses over TCP
When matching the received Query ID in the TCP connection,
an invalid received Query ID can very rarely cause assertion
failure.

Closes #4952

Merge branch '4952-check-whether-QID-is-not-deleted' into 'main'

See merge request isc-projects/bind9!9580
2024-10-02 10:41:26 +00:00
Ondřej Surý
4ef316e21e Skip TCP dispatch responses that are not ours
When matching the TCP dispatch responses, we should skip the responses
that do not belong to our TCP connection.  This can happen with faulty
upstream server that sends invalid QID back to us.
2024-10-02 10:41:04 +00:00
Arаm Sаrgsyаn
41f4c620c2 fix: dev: Don't ignore the local port number in dns_dispatch_add() for TCP
The dns_dispatch_add() function registers the 'resp' entry in
'disp->mgr->qids' hash table with 'resp->port' being 0, but in
tcp_recv_success(), when looking up an entry in the hash table
after a successfully received data the port is used, so if the
local port was set (i.e. it was not 0) it fails to find the
entry and results in an unexpected error.

Set the 'resp->port' to the given local port value extracted from
'disp->local'.

Closes #4969

Merge branch '4969-dispatch-tcp-source-port-bug-fix' into 'main'

See merge request isc-projects/bind9!9576
2024-10-02 09:51:40 +00:00
Aram Sargsyan
d49a8f518a Don't ignore the local port number in dns_dispatch_add() for TCP
The dns_dispatch_add() function registers the 'resp' entry in
'disp->mgr->qids' hash table with 'resp->port' being 0, but in
tcp_recv_success(), when looking up an entry in the hash table
after a successfully received data the port is used, so if the
local port was set (i.e. it was not 0) it fails to find the
entry and results in an unexpected error.

Set the 'resp->port' to the given local port value extracted from
'disp->local'.
2024-10-02 08:53:44 +00:00
Alessio Podda
e618cdddf8 new: usr: Support ISO timestamps with timezone information
The configuration option `print-time` can now be set to `iso8601-tzinfo` in order to use the ISO 8601 timestamp with timezone information when logging. This is used as a default for `named -g`.

Closes #4963

Merge branch '4963-provide-timezone-information-in-log-timestamps' into 'main'

See merge request isc-projects/bind9!9563
2024-10-02 08:16:17 +00:00
Alessio Podda
cc167266aa Support ISO timestamps with timezone information
This commit adds support for timestamps in iso8601 format with timezone
when logging. This is exposed through the iso8601-tzinfo printtime
suboption.
It also makes the new logging format the default for -g output,
hopefully removing the need for custom timestamp parsing in scripts.
2024-10-01 15:09:43 +00:00
Michal Nowak
1db4ebd983 chg: test: Replace dns.query module with isctest.query
The `dns.query.udp` and `dns.query.tcp` methods are [prone to timeouts](https://gitlab.isc.org/isc-projects/bind9/-/jobs/4785053); their `isctest.query` equivalents should be used in system tests instead.

Merge branch 'mnowak/convert-dns-query-udp-and-tcp-to-isctest-query' into 'main'

See merge request isc-projects/bind9!9560
2024-10-01 12:05:39 +00:00
Michal Nowak
dfec69b4a2 Replace dns.query module with isctest.query 2024-10-01 13:25:56 +02:00
Michal Nowak
a2d2d9c0d3 Add isctest.check.notimp() 2024-10-01 13:25:56 +02:00
Michal Nowak
4cb52f072e Report expected and last returned rcode on query timeout
Sometimes it's useful to see what was the server returning that did not
match the expected rcode.
2024-10-01 13:25:56 +02:00
Alessio Podda
474398a5a9 fix: dev: Null clausedefs for ancient options
This commit nulls all type fields for the clausedef lists that are
declared ancient, and removes the corresponding cfg_type_t and parsing
functions when they are found to be unused after the change.

Among others, it removes some leftovers from #1913.

Closes #4962

Merge branch '4962-null-clausedef-types-for-ancient-options' into 'main'

See merge request isc-projects/bind9!9552
2024-10-01 10:33:56 +00:00
alessio
bc63758d70 Null clausedefs for ancient options
This commit nulls all type fields for the clausedef lists that are
declared ancient, and removes the corresponding cfg_type_t and parsing
functions when they are found to be unused after the change.
2024-10-01 10:17:04 +02:00
Matthijs Mekking
516b098220 fix: doc: Restore text about sig validity and SOA expire
When `sig-validity-interval` was obsoleted, the text that the signature validity interval should be multiples of the SOA expire interval was removed. Restore this text to the description of the `signatures-validity` option.

Closes #4951

Merge branch '4951-document-signatures-validity-soa-expire' into 'main'

See merge request isc-projects/bind9!9566
2024-10-01 06:32:48 +00:00
Matthijs Mekking
8aa94931c3 Update example.com zone SOA expire value
The example.com zone file given in the "Configurations and Zone Files"
chapter has an SOA expire of 3 weeks, which is not a multiple of
the default signatures-validity value. Adjust the SOA expire so that
it is much lower than the signatures-validity default.
2024-10-01 06:32:28 +00:00
Matthijs Mekking
b09230004b Restore text about sig validity and SOA expire
When `sig-validity-interval` was obsoleted, the text that the signature
validity interval should be multiples of the SOA expire interval was
removed. Restore this text to the description of the
`signatures-validity` option.
2024-10-01 06:32:28 +00:00
Mark Andrews
3304e1dc76 fix: usr: Fix a bug in the static-stub implementation
Static-stub addresses and addresses from other sources were being
mixed together, resulting in static-stub queries going to addresses
not specified in the configuration, or alternatively, static-stub
addresses being used instead of the correct server addresses.

Closes #4850

Merge branch '4850-add-an-additional-class-of-names-to-adb' into 'main'

See merge request isc-projects/bind9!9314
2024-10-01 01:26:56 +00:00
Mark Andrews
b3a2c790f3 Store static-stub addresses seperately in the adb
Static-stub address and addresses from other sources where being
mixed together resulting in static-stub queries going to addresses
not specified in the configuration or alternatively static-stub
addresses being used instead of the real addresses.
2024-10-01 00:19:13 +00:00
Petr Špaček
4d759a251b rem: dev: Remove unused function dns_zonemgr_resumexfrs()
Merge branch 'pspacek/zone-xfr-cleanup' into 'main'

See merge request isc-projects/bind9!9565
2024-09-30 12:42:22 +00:00
Petr Špaček
a0f3b0c5de Remove unused function dns_zonemgr_resumexfrs() 2024-09-30 12:42:08 +00:00
Ondřej Surý
b1be0145a5 chg: dev: Use release memory ordering when incrementing reference counter
As the relaxed memory ordering doesn't ensure any memory
synchronization, it is possible that the increment will succeed even
in the case when it should not - there is a race between
atomic_fetch_sub(..., acq_rel) and atomic_fetch_add(..., relaxed).
Only the result is consistent, but the previous value for both calls
could be same when both calls are executed at the same time.

Merge branch 'ondrej/use-release-memory-ordering-for-reference-counting' into 'main'

See merge request isc-projects/bind9!9460
2024-09-30 12:22:05 +00:00
Ondřej Surý
88227ea665 Use release memory ordering when incrementing reference counter
As the relaxed memory ordering doesn't ensure any memory
synchronization, it is possible that the increment will succeed even
in the case when it should not - there is a race between
atomic_fetch_sub(..., acq_rel) and atomic_fetch_add(..., relaxed).
Only the result is consistent, but the previous value for both calls
could be same when both calls are executed at the same time.
2024-09-30 11:03:01 +02:00
Arаm Sаrgsyаn
d7d1804f16 fix: dev: Add a missing rcu_read_unlock() call on exit path
An exit path in the dns_dispatch_add() function fails to get out of
the RCU critical section when returning early. Add the missing
rcu_read_unlock() call.

Merge branch 'aram/add-missing-rcu_read_unlock-in-dns_dispatch_add' into 'main'

See merge request isc-projects/bind9!9561
2024-09-27 13:50:54 +00:00
Aram Sargsyan
4123d59fbc Add a missing rcu_read_unlock() call on exit path
An exit path in the dns_dispatch_add() function fails to get out of
the RCU critical section when returning early. Add the missing
rcu_read_unlock() call.
2024-09-27 13:48:33 +00:00
Ondřej Surý
62c49db973 dev: Add full Alessio's name to .mailmap to fix some of the older commits
Merge branch 'ondrej/add-alessio-to-.mailmap' into 'main'

See merge request isc-projects/bind9!9557
2024-09-26 11:48:16 +00:00
Ondřej Surý
1bc9eb0fc8 Add full Alessio's name to .mailmap to fix some of the older commits 2024-09-26 11:48:02 +00:00
Ondřej Surý
f48b86871f chg: usr: Honour the Control Group memory contraints on Linux
On Linux, the system administrator can use Control Group ``cgroup``
mechanism to limit the amount of available memory to the process.  This
limit will be honoured when calculating the percentage-based values.

Merge branch 'ondrej/use-uv_get_available_memory-doc' into 'main'

See merge request isc-projects/bind9!9556
2024-09-26 11:20:14 +00:00
Ondřej Surý
37552ce9ae Document that we now honour the cgroup memory limit
On Linux, the system administrator can use Control Group ``cgroup``
mechanism to limit the amount of available memory to the process.  This
limit will be honoured when calculating the percentage-based values.
2024-09-26 12:55:11 +02:00
Mark Andrews
d0d4c6dae7 new: usr: Added WALLET type
Add the new record type WALLET (262).  This provides a mapping from a domain name to a cryptographic currency wallet.  Multiple mappings can exist if multiple records exist.

Closes #4947

Merge branch '4947-add-wallet-type-to-named' into 'main'

See merge request isc-projects/bind9!9521
2024-09-25 12:03:45 +00:00
Mark Andrews
9b358e6e8b Add examples of WALLET records 2024-09-25 10:32:38 +00:00
Mark Andrews
b919b9b4f3 Add the new record type WALLET (262)
This provides a mapping from a domain name to a cryptographic
currency wallet and is a clone of TXT.
2024-09-25 10:32:38 +00:00
Arаm Sаrgsyаn
4498c0216f fix: usr: Fix the 'rndc dumpdb' command's error reporting
The 'rndc dumpdb' command wasn't reporting errors which
occurred when starting up the database dump process by named,
like, for example, a permission denied error for the
'dump-file' file. This has been fixed. Note, however, that
'rndc dumpdb' performs asynchronous writes, so errors can
also occur during the dumping process, which will not be
reported back to 'rndc', but which will still be logged by
named.

Closes #4944

Merge branch '4944-rndc-dumpdb-do-not-ignore-errors' into 'main'

See merge request isc-projects/bind9!9547
2024-09-25 09:07:46 +00:00
Aram Sargsyan
63bddd7192 Test 'rndc dumpdb' with an unwritable dump-file
Check that with a preexisting dump file without a write permission
no actual dump happens, and rndc returns an error result.

Also add a couple of missing entries in the cleaning script.
2024-09-25 08:02:17 +00:00
Aram Sargsyan
8b866ba8a0 Do not ignore named_server_dumpdb() result code
The named_server_dumpdb() function, which is called when a 'rndc dumpdb'
command is issued, returns a 'isc_result_t' result code and it has been
always ignored since its introduction in
eb8713ed94, where it was still called
ns_server_dumpdb(). The orignal reasoning is not preserved, but it could
have been also a simple copy-paste mistake, as there are commands, which
return 'void' and require manually setting 'result = ISC_R_SUCCESS;', as
it was done here. Anyway, named will now return the actual result, and
'rndc' will report an error, when the 'dumpdb' command fails.
2024-09-25 08:02:17 +00:00
Nicki Křížek
812f0031bf chg: doc: Track changes in separate files
Keep the changelog for each version in a separate source file to avoid
rebase conflicts when handling the -S version.

---

Related !9528

Closes #4946

Merge branch 'nicki/reorganize-changelog-docfiles-9.21' into 'main'

See merge request isc-projects/bind9!9549
2024-09-24 14:12:29 +00:00
Nicki Křížek
3d49a10d78 Fix changelog entry for [GL #4759] 2024-09-24 16:11:08 +02:00
Nicki Křížek
49128fc173 Generate changelog to stdout
Since the changes aren't tracked in the single changelog.rst file,
generate the changelog to stdout instead, so it can be easily redirected
to the proper file.
2024-09-24 16:11:08 +02:00
Nicki Křížek
f85a3e41aa Track changes in separate files
Keep the changelog for each version in a separate source file to avoid
rebase conflicts when handling the -S version.
2024-09-24 16:11:08 +02:00
Ondřej Surý
aed7f552d5 chg: dev: Use libuv functions to get memory available to BIND 9
This change uses uv_get_available_memory() if available with fallback
to uv_get_constrained_memory() with fallback to uv_get_total_memory().

Merge branch 'ondrej/use-uv_get_available_memory' into 'main'

See merge request isc-projects/bind9!9527
2024-09-24 13:51:55 +00:00
Ondřej Surý
06e5ada4be Use libuv functions to get memory available to BIND 9
This change uses uv_get_total_memory() to get the memory available to
BIND 9 with possible modification by uv_get_constrained_memory() if the
libuv version is recent enough to honour constraints created by
f.e. cgroups.
2024-09-24 15:51:14 +02:00
Nicki Křížek
0d0d61ce3c chg: ci: Increase the load TCP/DoT shotgun perf tests
Due to the recent improvements to the TCP processing, much higher loads
can be handled by BIND9 without causing client timeouts. The updated
parameters give us useful data for both cold and hot cache testing.

Merge branch 'nicki/increase-tcp-dot-shotgun-load' into 'main'

See merge request isc-projects/bind9!9494
2024-09-24 11:15:12 +00:00
Nicki Křížek
e89afd3349 Increase the load TCP/DoT shotgun perf tests
Due to the recent improvements to the TCP processing, much higher loads
can be handled by BIND9 without causing client timeouts. The updated
parameters give us useful data for both cold and hot cache testing.
2024-09-24 09:27:14 +02:00
Mark Andrews
467f9bf5c5 fix: test: Check read value in upforwd/ans4
The ans4 server wasn't shutting down cleanly sometimes.  Check that read returns the
expected value for the message length or exit read loop.

Closes #4301

Merge branch '4301-check-read-value-in-ans4' into 'main'

See merge request isc-projects/bind9!9537
2024-09-24 07:26:27 +00:00
Mark Andrews
21baad0a8f Check read value in upforwd/ans4
The ans4 server wasn't shutting down cleanly sometimes.  Check that
read returns the expected value for the message length or exit read
loop.
2024-09-24 05:33:06 +00:00
472 changed files with 25887 additions and 27169 deletions

View File

@@ -4,7 +4,7 @@ variables:
# Locale settings do not affect the build, but might affect tests.
LC_ALL: C
CI_REGISTRY_IMAGE: registry.gitlab.isc.org/isc-projects/images/bind9
CI_REGISTRY_IMAGE: registry.gitlab.isc.org/isc-projects/images/bind9-staging
CCACHE_DIR: "/ccache"
GIT_DEPTH: 1
@@ -1628,7 +1628,7 @@ shotgun:tcp:
<<: *shotgun_job
variables:
SHOTGUN_SCENARIO: tcp
SHOTGUN_TRAFFIC_MULTIPLIER: 6
SHOTGUN_TRAFFIC_MULTIPLIER: 13
when: delayed
start_in: 5 minutes
@@ -1636,7 +1636,7 @@ shotgun:dot:
<<: *shotgun_job
variables:
SHOTGUN_SCENARIO: dot
SHOTGUN_TRAFFIC_MULTIPLIER: 3
SHOTGUN_TRAFFIC_MULTIPLIER: 6
when: delayed
start_in: 5 minutes

View File

@@ -1,4 +1,5 @@
Alan Clegg <aclegg@isc.org>
Alessio Podda <alessio@isc.org>
Aram Sargsyan <aram@isc.org>
Artem Boldariev <artem@isc.org> <artem@boldariev.com>
Curtis Blackburn <ckb@isc.org> <ckb@freebsd11.local>

View File

@@ -214,8 +214,7 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
{
result = named_server_dnstap(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_DUMPDB)) {
named_server_dumpdb(named_g_server, lex, text);
result = ISC_R_SUCCESS;
result = named_server_dumpdb(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_DUMPSTATS)) {
result = named_server_dumpstats(named_g_server);
} else if (command_compare(command, NAMED_COMMAND_FETCHLIMIT)) {

View File

@@ -111,6 +111,7 @@ EXTERN const char *named_g_chrootdir INIT(NULL);
EXTERN bool named_g_foreground INIT(false);
EXTERN bool named_g_logstderr INIT(false);
EXTERN bool named_g_nosyslog INIT(false);
EXTERN unsigned int named_g_logflags INIT(0);
EXTERN const char *named_g_logfile INIT(NULL);
EXTERN const char *named_g_defaultsessionkeyfile INIT(NAMED_LOCALSTATEDIR

View File

@@ -79,6 +79,16 @@ named_log_setdefaultchannels(isc_logconfig_t *lcfg) {
isc_log_createchannel(lcfg, "default_debug", ISC_LOG_TOFILE,
ISC_LOG_DYNAMIC, &destination,
ISC_LOG_PRINTTIME | ISC_LOG_DEBUGONLY);
} else if (named_g_logstderr && (named_g_logflags != 0)) {
/*
* If the option -g is given, but we also requested iso
* timestamps, we'll still need to override the "default_debug"
* logger with a new one.
*/
isc_log_createchannel(lcfg, "default_debug", ISC_LOG_TOFILEDESC,
ISC_LOG_DYNAMIC,
ISC_LOGDESTINATION_STDERR,
ISC_LOG_PRINTTIME | named_g_logflags);
}
if (named_g_logfile != NULL) {
@@ -118,6 +128,16 @@ named_log_setsafechannels(isc_logconfig_t *lcfg) {
* discarded a bit faster.
*/
isc_log_setdebuglevel(0);
} else if (named_g_logstderr && (named_g_logflags != 0)) {
/*
* If the option -g is given, but we also requested iso
* timestamps, we'll still need to override the "default_debug"
* logger with a new one.
*/
isc_log_createchannel(lcfg, "default_debug", ISC_LOG_TOFILEDESC,
ISC_LOG_DYNAMIC,
ISC_LOGDESTINATION_STDERR,
ISC_LOG_PRINTTIME | named_g_logflags);
} else {
isc_log_setdebuglevel(named_g_debuglevel);
}

View File

@@ -239,6 +239,8 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
flags |= ISC_LOG_ISO8601;
} else if (strcasecmp(s, "iso8601-utc") == 0) {
flags |= ISC_LOG_ISO8601 | ISC_LOG_UTC;
} else if (strcasecmp(s, "iso8601-tzinfo") == 0) {
flags |= ISC_LOG_ISO8601 | ISC_LOG_TZINFO;
}
}
}

View File

@@ -889,6 +889,8 @@ parse_command_line(int argc, char *argv[]) {
case 'g':
named_g_foreground = true;
named_g_logstderr = true;
named_g_logflags = ISC_LOG_PRINTTIME | ISC_LOG_ISO8601 |
ISC_LOG_TZINFO;
break;
case 'L':
named_g_logfile = isc_commandline_argument;

View File

@@ -51,6 +51,7 @@ To run system tests, make sure you have the following dependencies installed:
- perl
- dnspython
- pytest-xdist (for parallel execution)
- python-jinja2 (for tests which use jinja templates)
Individual system tests might also require additional dependencies. If those
are missing, the affected tests will be skipped and should produce a message
@@ -154,9 +155,17 @@ system test directories may contain the following standard files:
- `tests_*.py`: These python files are picked up by pytest as modules. If they
contain any test functions, they're added to the test suite.
- `setup.sh`: This sets up the preconditions for the tests. Although optional,
virtually all tests will require such a file to set up the ports they should
use for the test.
- `*.j2`: These jinja2 templates can be used for configuration files or any
other files which require certain variables filled in, e.g. ports from the
environment variables. During test setup, the pytest runner will automatically
fill those in and strip the filename extension .j2, e.g. `ns1/named.conf.j2`
becomes `ns1/named.conf`. When using advanced templating to conditionally
include/omit entire sections or when filling in custom variables used for the
test, ensure the templates always include the defaults. If you don't need the
file to be auto-templated during test setup, use `.j2.manual` instead and then
no defaults are needed.
- `setup.sh`: This sets up the preconditions for the tests.
- `tests.sh`: Any shell-based tests are located within this file. Runs the
actual tests.

View File

@@ -1,25 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
#
# Clean up after zone transfer tests.
#
rm -f dig.out.*
rm -f ns2/example.db ns2/tsigzone.db ns2/example.db.jnl
rm -f */named.conf
rm -f */named.memstats
rm -f */named.run
rm -f ns*/_default.nzf
rm -f ns*/_default.nzd*
rm -f ns*/managed-keys.bind* ns*/*.mkeys*

View File

@@ -13,7 +13,6 @@
. ../conf.sh
$SHELL clean.sh
$SHELL ${TOP_SRCDIR}/bin/tests/system/genzone.sh 2 3 >ns2/example.db
$SHELL ${TOP_SRCDIR}/bin/tests/system/genzone.sh 2 3 >ns2/tsigzone.db
copy_setports ns2/named1.conf.in ns2/named.conf

View File

@@ -9,6 +9,18 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"ns*/_default.nzf*",
"ns*/_default.nzd*",
"ns2/example.db",
"ns2/tsigzone.db",
"dig.out*",
]
)
def test_acl(run_tests_sh):
run_tests_sh()

View File

@@ -1,22 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
#
# Clean up after tests.
#
rm -f dig.out.*
rm -f */named.memstats
rm -f */named.conf
rm -f */named.run
rm -f ns*/managed-keys.bind*

View File

@@ -13,7 +13,6 @@
. ../conf.sh
$SHELL clean.sh
copy_setports ns1/named1.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf

View File

@@ -9,6 +9,14 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",
]
)
def test_additional(run_tests_sh):
run_tests_sh()

View File

@@ -1,43 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f ./dig.out.*
rm -f ./rndc.out*
rm -f ./showzone.out*
rm -f ./zonestatus.out*
rm -f ./*/named.conf
rm -f ./*/named.memstats
rm -f ./ns1/*.nzf ./ns1/*.nzf~
rm -f ./ns1/*.nzd ./ns1/*.nzd-lock
rm -f ./ns2/*.nzf ./ns2/*.nzf~
rm -f ./ns2/*.nzd ./ns2/*.nzd-lock
rm -f ./ns3/*.nzf ./ns3/*.nzf~
rm -f ./ns3/*.nzd ./ns3/*.nzd-lock
rm -f ./ns2/core*
rm -f ./ns2/inline.db.jbk
rm -f ./ns2/inline.db.signed
rm -f ./ns2/inlinesec.bk*
rm -rf ./ns2/new-zones
rm -f ./ns*/named.run ./ns*/named.run.prev
rm -f ./ns2/nzf-*
rm -f ./ns3/named.conf
rm -f ./ns3/*.nzf ./ns3/*.nzf~
rm -f ./ns3/*.nzd ns3/*.nzd-lock
rm -f ./ns3/inlinesec.db
rm -f ./ns1/redirect.db
rm -f ./ns2/redirect.db
rm -f ./ns2/redirect.bk
rm -f ./ns3/redirect.db
rm -f ./ns*/managed-keys.bind* ns*/*.mkeys*
rm -f ./nzd2nzf.out.*
rm -f ./wait_for_message.*

View File

@@ -12,8 +12,21 @@
import concurrent.futures
import time
import pytest
import isctest
pytestmark = pytest.mark.extra_artifacts(
[
"ns*/*.nzf*",
"ns*/*.nzd*",
"ns1/redirect.db",
"ns2/new-zones",
"ns2/redirect.db",
"ns3/redirect.db",
]
)
def rndc_loop(test_state, domain, ns3):
"""

View File

@@ -9,6 +9,35 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",
"nzd2nzf.out.*",
"rndc.out*",
"showzone.out.*",
"zonestatus.out.*",
"ns*/*.nzd*",
"ns*/*.nzf*",
"ns1/redirect.db",
"ns2/*.nzf~",
"ns2/K*.key",
"ns2/K*.private",
"ns2/K*.state",
"ns2/external.nzd",
"ns2/extra.nzd",
"ns2/inline.db.jbk",
"ns2/inline.db.signed",
"ns2/inline.db.signed.jnl",
"ns2/inlinesec.bk.jbk",
"ns2/new-zones",
"ns2/redirect.bk",
"ns2/redirect.db",
"ns3/redirect.db",
]
)
def test_addzone(run_tests_sh):
run_tests_sh()

View File

@@ -1,23 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
#
# Clean up after allow query tests.
#
rm -f dig.out.*
rm -f ns*/named.conf
rm -f ns2/controls.conf
rm -f */named.memstats
rm -f ns*/named.run ns*/named.run.prev
rm -f ns*/managed-keys.bind* ns*/*.mkeys*

View File

@@ -9,6 +9,15 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",
"ns2/controls.conf",
]
)
def test_allow_query(run_tests_sh):
run_tests_sh()

View File

@@ -1,20 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f */named.memstats
rm -f */named.run
rm -f */named.conf
rm -f dig.out.test*
rm -f ns2/example.com.bk
rm -f ns2/example.net.bk
rm -f ns*/managed-keys.bind* ns*/*mkeys*

View File

@@ -1,17 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf

View File

@@ -9,6 +9,10 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(["ns*/example.*.bk", "dig.out.test*"])
def test_auth(run_tests_sh):
run_tests_sh()

View File

@@ -1,76 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f ./dsset-*
rm -f */K* */dsset-* */*.signed */tmp* */*.jnl */*.bk
rm -f */core
rm -f */example.bk
rm -f */named.conf
rm -f */named.memstats
rm -f */named.run*
rm -f */trusted.conf */private.conf
rm -f dig.out.*
rm -f digcomp.out.test*
rm -f activate-now-publish-1day.key prepub.key
rm -f active.key inact.key del.key delzsk.key unpub.key standby.key rev.key
rm -f delayksk.key delayzsk.key autoksk.key autozsk.key
rm -f noksk-ksk.key nozsk-ksk.key nozsk-zsk.key inaczsk-zsk.key inaczsk-ksk.key
rm -f nopriv.key vanishing.key del1.key del2.key
rm -rf ns*/inactive
rm -f ns*/managed-keys.bind*
rm -f ns1/root.db ns1/root.db.1 ns1/root.db.2 ns1/root.db.3
rm -f ns1/signing.out
rm -f ns2/bar.db
rm -f ns2/child.nsec3.example.db
rm -f ns2/child.optout.example.db
rm -f ns2/example.db
rm -f ns2/insecure.secure.example.db
rm -f ns2/nsec3-with-ent.db
rm -f ns2/private.secure.example.db
rm -f ns2/signing.*
rm -f ns3/*.nzd ns3/*.nzd-lock ns3/*.nzf
rm -f ns3/*.nzf
rm -f ns3/*.jbk
rm -f ns3/autonsec3.example.db
rm -f ns3/delay.example.db ns3/delay.example.1 ns3/delay.example.2
rm -f ns3/delzsk.example.db
rm -f ns3/dname-at-apex-nsec3.example.db
rm -f ns3/inaczsk2.example.db
rm -f ns3/jitter.nsec3.example.db
rm -f ns3/kg.out ns3/s.out ns3/st.out
rm -f ns3/kskonly.example.db
rm -f ns3/named.ns3.prev
rm -f ns3/noksk.example.db
rm -f ns3/nozsk.example.db ns3/inaczsk.example.db
rm -f ns3/nsec-only.example.db
rm -f ns3/nsec3-to-nsec.example.db
rm -f ns3/nsec3.example.db
rm -f ns3/nsec3.nsec3.example.db
rm -f ns3/nsec3.optout.example.db
rm -f ns3/oldsigs.example.db ns3/oldsigs.example.db.bak
rm -f ns3/optout.example.db
rm -f ns3/optout.nsec3.example.db
rm -f ns3/optout.optout.example.db
rm -f ns3/prepub.example.db
rm -f ns3/reconf.example.db
rm -f ns3/rsasha256.example.db ns3/rsasha512.example.db
rm -f ns3/secure.example.db
rm -f ns3/secure.nsec3.example.db
rm -f ns3/secure.optout.example.db
rm -f ns3/settime.out.*
rm -f ns3/sync.example.db
rm -f ns3/ttl*.db
rm -f nsupdate.out.test*
rm -f settime.out.*
rm -f signing.*
rm -f sync.key

View File

@@ -9,9 +9,147 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
import isctest.mark
pytestmark = pytest.mark.extra_artifacts(
[
"activate-now-publish-1day.key",
"active.key",
"autoksk.key",
"autozsk.key",
"del.key",
"delayksk.key",
"delayzsk.key",
"delzsk.key",
"dig.out.*",
"dsset-.",
"dsset-bar.",
"dsset-delay.example.",
"inact.key",
"inaczsk-ksk.key",
"inaczsk-zsk.key",
"noksk-ksk.key",
"nopriv.key",
"nozsk-ksk.key",
"nozsk-zsk.key",
"nsupdate.out.*",
"prepub.key",
"rev.key",
"settime.out.*",
"signing.*out*",
"standby.key",
"sync.key",
"unpub.key",
"vanishing.key",
"*/K*",
"*/dsset-*",
"*/*.signed",
"*/*.jnl",
"*/*.bk",
"ns*/_default.nzf*",
"ns*/_default.nzd*",
"ns1/root.db",
"ns1/root.db.1",
"ns1/root.db.2",
"ns1/root.db.3",
"ns1/signing.out",
"ns1/trusted.conf",
"ns2/bar.db",
"ns2/child.nsec3.example.db",
"ns2/child.optout.example.db",
"ns2/dsset-dname-at-apex-nsec3.example.",
"ns2/dsset-example.",
"ns2/dsset-nsec3-to-nsec.example.",
"ns2/dsset-nsec3.example.",
"ns2/dsset-oldsigs.example.",
"ns2/dsset-optout.example.",
"ns2/dsset-private.secure.example.",
"ns2/dsset-rsasha256.example.",
"ns2/dsset-rsasha512.example.",
"ns2/dsset-secure.example.",
"ns2/example.db",
"ns2/insecure.secure.example.db",
"ns2/nsec3-with-ent.db",
"ns2/private.conf",
"ns2/private.secure.example.db",
"ns2/signing.bar.out",
"ns2/signing.privsec.out",
"ns2/trusted.conf",
"ns3/autonsec3.example.db",
"ns3/delay.example.1",
"ns3/delay.example.2",
"ns3/delay.example.db",
"ns3/delzsk.example.db",
"ns3/dname-at-apex-nsec3.example.db",
"ns3/dsset-autonsec3.example.",
"ns3/dsset-dname-at-apex-nsec3.example.",
"ns3/dsset-inaczsk.example.",
"ns3/dsset-inaczsk2.example.",
"ns3/dsset-kskonly.example.",
"ns3/dsset-noksk.example.",
"ns3/dsset-nozsk.example.",
"ns3/dsset-nsec-only.example.",
"ns3/dsset-nsec3-to-nsec.example.",
"ns3/dsset-nsec3-to-nsec3.example.",
"ns3/dsset-nsec3.example.",
"ns3/dsset-nsec3.nsec3.example.",
"ns3/dsset-nsec3.optout.example.",
"ns3/dsset-oldsigs.example.",
"ns3/dsset-optout.example.",
"ns3/dsset-optout.nsec3.example.",
"ns3/dsset-optout.optout.example.",
"ns3/dsset-prepub.example.",
"ns3/dsset-rsasha256.example.",
"ns3/dsset-rsasha512.example.",
"ns3/dsset-secure.example.",
"ns3/dsset-secure.nsec3.example.",
"ns3/dsset-secure.optout.example.",
"ns3/dsset-sync.example.",
"ns3/inactive",
"ns3/inaczsk.example.db",
"ns3/inaczsk2.example.db",
"ns3/jitter.nsec3.example.db",
"ns3/kg.out",
"ns3/kskonly.example.db",
"ns3/kskonly.example.db.jbk",
"ns3/noksk.example.db",
"ns3/nozsk.example.db",
"ns3/nsec-only.example.db",
"ns3/nsec3-to-nsec.example.db",
"ns3/nsec3-to-nsec3.example.db",
"ns3/nsec3.example.db",
"ns3/nsec3.nsec3.example.db",
"ns3/nsec3.optout.example.db",
"ns3/oldsigs.example.db",
"ns3/oldsigs.example.db.bak",
"ns3/optout.example.db",
"ns3/optout.example.db.jbk",
"ns3/optout.nsec3.example.db",
"ns3/optout.optout.example.db",
"ns3/prepub.example.db",
"ns3/reconf.example.db",
"ns3/reconf.example.db.jbk",
"ns3/rsasha256.example.db",
"ns3/rsasha512.example.db",
"ns3/s.out",
"ns3/secure.example.db",
"ns3/secure.nsec3.example.db",
"ns3/secure.optout.example.db",
"ns3/st.out",
"ns3/sync.example.db",
"ns3/trusted.conf",
"ns3/ttl1.example.db",
"ns3/ttl2.example.db",
"ns3/ttl3.example.db",
"ns3/ttl4.example.db",
"ns4/private.conf",
"ns4/trusted.conf",
"ns5/trusted.conf",
]
)
@isctest.mark.flaky(max_runs=2)
def test_autosign(run_tests_sh):

View File

@@ -1,19 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f ns?/named.run
rm -f ns?/named.memstats
rm -f ns?/named.conf
rm -f rndc.status.ns*
rm -f dig.out.ns*
rm -f ns*/managed-keys.bind*

View File

@@ -1,18 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf

View File

@@ -9,6 +9,15 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",
"rndc.status.ns*",
]
)
def test_builtin(run_tests_sh):
run_tests_sh()

View File

@@ -1,26 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
#
# Clean up after cache cleaner tests.
#
rm -f dig.out.ns2
rm -f dig.out.expire
rm -f rndc.out.*
rm -f sed.out.*
rm -f */named.memstats
rm -f */named.run
rm -f */named.conf
rm -f ns2/named_dump.db.*
rm -f ns*/managed-keys.bind*

View File

@@ -1,17 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf

View File

@@ -101,7 +101,7 @@ digcomp --lc dig.out.ns2 knowngood.dig.out || status=1
n=$((n + 1))
echo_i "only one tcp socket was used ($n)"
tcpclients=$(awk '$3 == "client" && $5 ~ /10.53.0.7#[0-9]*:/ {print $5}' ns2/named.run | sort | uniq -c | wc -l)
tcpclients=$(awk '$2 == "client" && $4 ~ /10.53.0.7#[0-9]*:/ {print $4}' ns2/named.run | sort | uniq -c | wc -l)
test $tcpclients -eq 1 || {
status=1

View File

@@ -9,6 +9,17 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",
"rndc.out.*",
"sed.out.*",
"ns2/named_dump.db.*",
]
)
def test_cacheclean(run_tests_sh):
run_tests_sh()

View File

@@ -1,23 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f dig.ns*.test*
rm -f ns*/named.conf
rm -f ns*/named.memstats
rm -f ns*/named.run
rm -f ns1/dynamic.db
rm -f ns1/dynamic.db.jnl
rm -f ns2/dynamic.bk
rm -f ns2/dynamic.bk.jnl
rm -f ns2/example.bk
rm -f ns*/managed-keys.bind*

View File

@@ -1,18 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ../conf.sh
cp -f ns1/dynamic.db.in ns1/dynamic.db
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf

View File

@@ -9,6 +9,19 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.ns*.test*",
"ns1/dynamic.db",
"ns1/dynamic.db.jnl",
"ns2/dynamic.bk",
"ns2/dynamic.bk.jnl",
"ns2/example.bk",
]
)
def test_case(run_tests_sh):
run_tests_sh()

View File

@@ -1,36 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f dig.out.*
rm -f ns*/*.jnl
rm -f ns*/*.mkeys
rm -f ns*/*.nzd ns*/*.nzd-lock
rm -f ns*/*.nzf
rm -f ns*/managed-keys.bind*
rm -f ns*/named.conf
rm -f ns*/named.memstats
rm -f ns*/named.run
rm -f ns*/named.run.prev
rm -f ns1/*dom*example.db
rm -f ns1/tls1.example.db
rm -f ns2/__catz__*db
rm -f ns2/catalog-bad*.db
rm -f ns2/named.conf.tmp
rm -f ns3/dom2.example.db ns3/dom13.example.db ns3/dom14.example.db ns3/dom17.example.db ns3/dom18.example.db
rm -f ns4/__catz__*db
rm -f ns4/catalog-self.example.db
rm -f ns[123]/catalog[1234].example.db
rm -f ns[14]/catalog-tls.example.db
rm -f nsupdate.out.*
rm -f wait_for_message.*
rm -rf ns2/zonedir

View File

@@ -13,8 +13,6 @@
. ../conf.sh
$SHELL clean.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named1.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf

View File

@@ -9,6 +9,26 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",
"nsupdate.out.*",
"wait_for_message.*",
"ns*/*.jnl",
"ns*/*.nzf*",
"ns*/*.nzd*",
"ns*/catalog*.example.db",
"ns*/*dom*.example.db",
"ns1/tls1.example.db",
"ns2/__catz__*.db",
"ns2/named.conf.tmp",
"ns2/zonedir",
"ns4/__catz__*.db",
]
)
def test_catz(run_tests_sh):
run_tests_sh()

View File

@@ -1,23 +0,0 @@
#!/bin/sh -e
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f CDNSKEY* CDS* DS*
rm -f K*
rm -f UP*
rm -f brk.*
rm -f db.*
rm -f dsset-*
rm -f empty
rm -f sig.*
rm -f vars.sh
rm -f err* out* xerr xout

View File

@@ -9,6 +9,27 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"CDNSKEY.*",
"CDS.*",
"DS.*",
"K*",
"UP.*",
"brk.*",
"db.*",
"empty",
"err.*",
"out.*",
"sig.*",
"vars.sh",
"xerr",
"xout",
]
)
def test_cds(run_tests_sh):
run_tests_sh()

View File

@@ -1,18 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f dig.out.* named*.pid
rm -f ns*/named.conf
rm -f */named.memstats */named.recursing */named.run */ans.run
rm -f ns2/K* ns2/dsset-* ns2/*.db.signed
rm -f ns*/managed-keys.bind*

View File

@@ -9,6 +9,18 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",
"*/ans.run",
"ns2/K*",
"ns2/dsset-*",
"ns2/*.db.signed",
]
)
def test_chain(run_tests_sh):
run_tests_sh()

View File

@@ -1,26 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f bad-kasp-keydir1.conf
rm -f bad-kasp-keydir2.conf
rm -f bad-kasp-keydir3.conf
rm -f bad-kasp-keydir4.conf
rm -f bad-kasp-keydir5.conf
rm -f bad-tsig.conf
rm -f checkconf.out*
rm -f diff.out*
rm -f good-kasp.conf.in
rm -f good-server-christmas-tree.conf
rm -f good.conf good.conf.raw good.conf.out badzero.conf *.out
rm -rf keys
rm -rf test.keydir

View File

@@ -32,4 +32,8 @@ logging {
file "five.out";
print-time iso8601-utc;
};
channel six {
file "six.out";
print-time iso8601-tzinfo;
};
};

View File

@@ -1,22 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ../conf.sh
copy_setports bad-kasp-keydir1.conf.in bad-kasp-keydir1.conf
copy_setports bad-kasp-keydir2.conf.in bad-kasp-keydir2.conf
copy_setports bad-kasp-keydir3.conf.in bad-kasp-keydir3.conf
copy_setports bad-kasp-keydir4.conf.in bad-kasp-keydir4.conf
copy_setports bad-kasp-keydir5.conf.in bad-kasp-keydir5.conf
copy_setports bad-tsig.conf.in bad-tsig.conf
copy_setports good.conf.in good.conf
cp -f good-server-christmas-tree.conf.in good-server-christmas-tree.conf

View File

@@ -9,6 +9,28 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"*.out",
"bad-kasp-keydir1.conf",
"bad-kasp-keydir2.conf",
"bad-kasp-keydir3.conf",
"bad-kasp-keydir4.conf",
"bad-kasp-keydir5.conf",
"bad-tsig.conf",
"badzero.conf",
"checkconf.out*",
"diff.out*",
"good-kasp.conf.in",
"good-server-christmas-tree.conf",
"good.conf",
"good.conf.raw",
"keys",
]
)
def test_checkconf(run_tests_sh):
run_tests_sh()

View File

@@ -1,28 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
set -e
rm -f dig.out*
rm -f ns*/named.conf ns*/named.memstats ns*/named.run*
rm -f ns*/*.jnl ns*/*.jbk
rm -f ns*/K*.private ns*/K*.key ns*/K*.state
rm -f ns*/*.keyname
rm -f ns*/dsset-*
rm -f ns*/*.db ns*/*.jnl ns*/*.jbk ns*/*.db.signed ns*/*.db.infile
rm -f ns*/keygen.out.* ns*/settime.out.* ns*/signer.out.*
rm -f ns*/managed-keys.bind*
rm -f ns*/trusted.conf
rm -f ns*/*.mkeys
rm -f ns*/zones
rm -f ./*.out

View File

@@ -16,8 +16,6 @@
set -e
$SHELL clean.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf

View File

@@ -11,6 +11,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from typing import NamedTuple, Tuple
import os
@@ -24,15 +25,34 @@ pytest.importorskip("dns", minversion="2.0.0")
import dns.exception
import dns.message
import dns.name
import dns.query
import dns.rcode
import dns.rdataclass
import dns.rdatatype
pytestmark = pytest.mark.skipif(
sys.version_info < (3, 7), reason="Python >= 3.7 required [GL #3001]"
)
pytestmark = [
pytest.mark.skipif(
sys.version_info < (3, 7), reason="Python >= 3.7 required [GL #3001]"
),
pytest.mark.extra_artifacts(
[
"*.out",
"ns*/*.db",
"ns*/*.db.infile",
"ns*/*.db.signed",
"ns*/*.jnl",
"ns*/*.jbk",
"ns*/*.keyname",
"ns*/dsset-*",
"ns*/K*",
"ns*/keygen.out*",
"ns*/settime.out*",
"ns*/signer.out*",
"ns*/trusted.conf",
"ns*/zones",
]
),
]
def has_signed_apex_nsec(zone, response):
@@ -61,16 +81,9 @@ def has_signed_apex_nsec(zone, response):
def do_query(server, qname, qtype, tcp=False):
query = dns.message.make_query(qname, qtype, use_edns=True, want_dnssec=True)
try:
if tcp:
response = dns.query.tcp(query, server.ip, timeout=3, port=server.ports.dns)
else:
response = dns.query.udp(query, server.ip, timeout=3, port=server.ports.dns)
except dns.exception.Timeout:
print(f"error: query timeout for query {qname} {qtype} to {server.ip}")
return None
msg = dns.message.make_query(qname, qtype, use_edns=True, want_dnssec=True)
query_func = isctest.query.tcp if tcp else isctest.query.udp
response = query_func(msg, server.ip, expected_rcode=dns.rcode.NOERROR)
return response
@@ -97,38 +110,26 @@ def verify_zone(zone, transfer):
def read_statefile(server, zone):
addr = server.ip
count = 0
keyid = 0
state = {}
response = do_query(server, zone, "DS", tcp=True)
if not isinstance(response, dns.message.Message):
print(f"error: no response for {zone} DS from {addr}")
return {}
# fetch key id from response.
for rr in response.answer:
if rr.match(
dns.name.from_text(zone),
dns.rdataclass.IN,
dns.rdatatype.DS,
dns.rdatatype.NONE,
):
if count == 0:
keyid = list(dict(rr.items).items())[0][0].key_tag
count += 1
if response.rcode() == dns.rcode.NOERROR:
# fetch key id from response.
for rr in response.answer:
if rr.match(
dns.name.from_text(zone),
dns.rdataclass.IN,
dns.rdatatype.DS,
dns.rdatatype.NONE,
):
if count == 0:
keyid = list(dict(rr.items).items())[0][0].key_tag
count += 1
if count != 1:
print(
f"error: expected a single DS in response for {zone} from {addr}, got {count}"
)
return {}
else:
rcode = dns.rcode.to_text(response.rcode())
print(f"error: {rcode} response for {zone} DNSKEY from {addr}")
return {}
assert (
count == 1
), f"expected a single DS in response for {zone} from {server.ip}, got {count}"
filename = f"ns9/K{zone}+013+{keyid:05d}.state"
print(f"read state file {filename}")
@@ -140,7 +141,6 @@ def read_statefile(server, zone):
continue
key, val = line.strip().split(":", 1)
state[key.strip()] = val.strip()
except FileNotFoundError:
# file may not be written just yet.
return {}
@@ -149,40 +149,15 @@ def read_statefile(server, zone):
def zone_check(server, zone):
addr = server.ip
fqdn = f"{zone}."
# wait until zone is fully signed.
signed = False
for _ in range(10):
response = do_query(server, fqdn, "NSEC")
if not isinstance(response, dns.message.Message):
print(f"error: no response for {fqdn} NSEC from {addr}")
elif response.rcode() == dns.rcode.NOERROR:
signed = has_signed_apex_nsec(fqdn, response)
else:
rcode = dns.rcode.to_text(response.rcode())
print(f"error: {rcode} response for {fqdn} NSEC from {addr}")
if signed:
break
time.sleep(1)
assert signed
# check zone is fully signed.
response = do_query(server, fqdn, "NSEC")
assert has_signed_apex_nsec(fqdn, response)
# check if zone if DNSSEC valid.
verified = False
transfer = do_query(server, fqdn, "AXFR", tcp=True)
if not isinstance(transfer, dns.message.Message):
print(f"error: no response for {fqdn} AXFR from {addr}")
elif transfer.rcode() == dns.rcode.NOERROR:
verified = verify_zone(fqdn, transfer)
else:
rcode = dns.rcode.to_text(transfer.rcode())
print(f"error: {rcode} response for {fqdn} AXFR from {addr}")
assert verified
assert verify_zone(fqdn, transfer)
def keystate_check(server, zone, key):

View File

@@ -1,26 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f ns*/named.conf
rm -f dig.out.ns?.test*
rm -f nsupdate.out.test*
rm -f ns1/*.example.db
rm -f ns1/*.update.db
rm -f ns1/*.update.db.jnl
rm -f ns4/*.update.db
rm -f ns4/*.update.db.jnl
rm -f ns5/*.update.db
rm -f ns5/*.update.db.jnl
rm -f */named.memstats
rm -f */named.run
rm -f ns*/managed-keys.bind*

View File

@@ -1,34 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ../conf.sh
$SHELL clean.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf
copy_setports ns4/named.conf.in ns4/named.conf
copy_setports ns5/named.conf.in ns5/named.conf
cp ns1/ignore.example.db.in ns1/ignore.example.db
cp ns1/warn.example.db.in ns1/warn.example.db
cp ns1/fail.example.db.in ns1/fail.example.db
cp ns1/ignore.update.db.in ns1/ignore.update.db
cp ns1/warn.update.db.in ns1/warn.update.db
cp ns1/fail.update.db.in ns1/fail.update.db
cp ns4/primary-ignore.update.db.in ns4/primary-ignore.update.db
cp ns5/master-ignore.update.db.in ns5/master-ignore.update.db

View File

@@ -9,6 +9,22 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.ns*.test*",
"nsupdate.out.*",
"ns1/*.example.db",
"ns1/*.update.db",
"ns1/*.update.db.jnl",
"ns4/*.update.db",
"ns4/*.update.db.jnl",
"ns5/*.update.db",
"ns5/*.update.db.jnl",
]
)
def test_checknames(run_tests_sh):
run_tests_sh()

View File

@@ -1,16 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f test.* good1.db.raw named-compilezone
rm -f zones/bad-tsig.db
rm -f zones/zone1_*.txt

View File

@@ -9,6 +9,18 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"good1.db.raw",
"named-compilezone",
"test.*",
"zones/bad-tsig.db",
"zones/zone1_*.txt",
]
)
def test_checkzone(run_tests_sh):
run_tests_sh()

View File

@@ -1,26 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
#
# Clean up after zone transfer tests.
#
rm -f ./*/named.conf
rm -f ./*/named.memstats
rm -f ./*/named.run
rm -f ./*/named.run.prev
rm -f ./dig.out.*
rm -f ./gnutls-cli.*
rm -f ./sslyze.log.*
rm -f ./*/example*.db
rm -rf ./headers.*

View File

@@ -9,6 +9,15 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",
"ns*/example*.db",
]
)
def test_cipher_suites(run_tests_sh):
run_tests_sh()

View File

@@ -232,8 +232,7 @@ private_type_record() {
# has been appended since the last time we read it.
#
# Calling some of these functions causes temporary *.prev files to be
# created that need to be cleaned up manually (usually by a given system
# test's clean.sh script).
# created.
#
# Note that unlike other nextpart*() functions, nextpartread() is not
# meant to be directly used in system tests; its sole purpose is to

View File

@@ -10,6 +10,7 @@
# information regarding copyright ownership.
from functools import partial
import filecmp
import os
from pathlib import Path
import re
@@ -296,9 +297,30 @@ def logger(request, system_test_name):
isctest.log.deinit_test_logger()
@pytest.fixture(scope="module")
def expected_artifacts(request):
common_artifacts = [
"ns*/named.run",
"ns*/named.run.prev",
"ns*/named.conf",
"ns*/named.memstats",
"pytest.log.txt",
]
try:
test_specific_artifacts = request.node.get_closest_marker("extra_artifacts")
except AttributeError:
return None
if test_specific_artifacts:
return common_artifacts + test_specific_artifacts.args[0]
return common_artifacts
@pytest.fixture(scope="module")
def system_test_dir(
request, system_test_name
request, system_test_name, expected_artifacts
): # pylint: disable=too-many-statements,too-many-locals
"""
Temporary directory for executing the test.
@@ -306,8 +328,6 @@ def system_test_dir(
This fixture is responsible for creating (and potentially removing) a
copy of the system test directory which is used as a temporary
directory for the test execution.
FUTURE: This removes the need to have clean.sh scripts.
"""
def get_test_result():
@@ -347,6 +367,38 @@ def system_test_dir(
except FileNotFoundError:
pass
def check_artifacts(source_dir, run_dir):
def check_artifacts_recursive(dcmp):
def artifact_expected(path, expected):
for glob in expected:
if path.match(glob):
return True
return False
# test must not remove any Git-tracked file, ignore libtool and gcov artifacts
for name in dcmp.left_only:
assert name.startswith("lt-") or name.endswith(".gcda")
assert not dcmp.diff_files, "test must not modify any Git-tracked file"
dir_path = Path(dcmp.left).relative_to(source_dir)
for name in dcmp.right_only:
file = dir_path / Path(name)
if not artifact_expected(file, expected_artifacts):
unexpected_files.append(str(file))
for subdir in dcmp.subdirs.values():
check_artifacts_recursive(subdir)
if expected_artifacts is None: # skip the check if artifact list is unavailable
return
unexpected_files = []
dcmp = filecmp.dircmp(source_dir, run_dir)
check_artifacts_recursive(dcmp)
assert (
not unexpected_files
), f"Unexpected files found in test directory: {unexpected_files}"
# Create a temporary directory with a copy of the original system test dir contents
system_test_root = Path(os.environ["builddir"])
testdir = Path(
@@ -376,6 +428,9 @@ def system_test_dir(
result = get_test_result()
if result == "passed":
check_artifacts(system_test_root / system_test_name, testdir)
# Clean temporary dir unless it should be kept
keep = False
if request.config.getoption("--noclean"):
@@ -408,6 +463,11 @@ def system_test_dir(
unlink(symlink_dst)
@pytest.fixture(scope="module")
def templates(system_test_dir: Path):
return isctest.template.TemplateEngine(system_test_dir)
def _run_script( # pylint: disable=too-many-arguments
system_test_dir: Path,
interpreter: str,
@@ -474,6 +534,7 @@ def run_tests_sh(system_test_dir, shell):
def system_test( # pylint: disable=too-many-arguments,too-many-statements
request,
system_test_dir,
templates,
shell,
perl,
):
@@ -515,6 +576,7 @@ def system_test( # pylint: disable=too-many-arguments,too-many-statements
pytest.skip("Prerequisites missing.")
def setup_test():
templates.render_auto()
try:
shell(f"{system_test_dir}/setup.sh")
except FileNotFoundError:

View File

@@ -1,23 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f ns*/named.conf
rm -f dig.out.*
rm -f named.run.*
rm -f rndc.out.*
rm -f ns1/named_dump.db*
rm -f ns*/named.memstats
rm -f ns*/named.run
rm -f ns*/managed-keys.bind*
rm -f ns*/named.run.prev
rm -f ans*/ans.run ans*/ans.log

View File

@@ -1,23 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf
copy_setports ns4/named.conf.in ns4/named.conf
copy_setports ns5/named.conf.in ns5/named.conf
copy_setports ns6/named.conf.in ns6/named.conf
copy_setports ns7/named.conf.in ns7/named.conf
copy_setports ns8/named.conf.in ns8/named.conf

View File

@@ -9,6 +9,19 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out.*",
"named.run.*",
"rndc.out.*",
"ans*/ans.run",
"ans*/query.log",
"ns1/named_dump.db*",
]
)
def test_cookie(run_tests_sh):
run_tests_sh()

View File

@@ -1,16 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
set -e
rm -f ./named.run.*

Some files were not shown because too many files have changed in this diff Show More