Commit graph

4459 commits

Author SHA1 Message Date
Evan Hunt
a81ae32d8a add a system test to check that delv loads trust anchors correctly 2020-03-04 08:59:29 -08:00
Michal Nowak
85cb3a214f Fix "pkcs11" system test
- Define the SLOT environment variable before starting the test.  This
    variable defaults to 0 and that does not work with SoftHSM 2.

  - The system test expects the PIN environment variable to be set to
    "1234" while bin/tests/prepare-softhsm2.sh sets it to "0000".
    Update bin/tests/prepare-softhsm2.sh so that it sets the PIN to
    "1234".

  - Move contents of bin/tests/system/pkcs11/prereq.sh to
    bin/tests/system/pkcs11/setup.sh as the former was creating a file
    called "supported" that was getting removed by the latter before
    bin/tests/system/pkcs11/tests.sh could access it.

  - Fix typo in "have_ecx".
2020-03-04 16:06:31 +00:00
Evan Hunt
7a3fa9f593 list "validate-except" entries in "rndc nta -d" and "rndc secroots"
- no longer exclude these entries when dumping the NTA table
- indicate "validate-except" entries with the keyword "permanent" in
  place of an expiry date
- add a test for this feature, and update other tests to account for
  the presence of extra lines in some rndc outputs
- incidentally removed the unused function dns_ntatable_dump()
- CHANGES, release note
2020-03-04 00:44:32 -08:00
Mark Andrews
0abcface49 properly wait for zone to be loaded 2020-03-04 15:39:08 +11:00
Mark Andrews
50e079d6c3 Check inline master zones that are touched reload correctly. 2020-03-04 08:45:34 +11:00
Michał Kępień
fc967ba092 Add ZLIB_LIBS to ISCLIBS
When --with-zlib is passed to ./configure (or when the latter
autodetects zlib's presence), libisc uses certain zlib functions and
thus libisc's users should be linked against zlib in that case.  Adjust
Makefile variables appropriately to prevent shared build failures caused
by underlinking.
2020-02-28 15:22:29 +01:00
Mark Andrews
88c828cb9f capture named-journalprint output 2020-02-27 22:30:14 +00:00
Mark Andrews
a24fd55836 sort RRSIG(SOA) to be last of RRSIGs with a common re-resign time 2020-02-27 22:30:14 +00:00
Evan Hunt
195d25b222 send bursts of queries in parallel to reduce test runtime
sending each group of queries simultaneously, and then checking the
output after the last one finishes, reduces the runtime of the
serve-stale test by about six minutes.
2020-02-26 22:28:33 -08:00
Evan Hunt
027601cd3e stop testing 'serve-stale yes' and 'serve-fail no' alternate syntax
"yes" and "no" are permissible synonyms for "on" and "off", which
use exactly the same code paths. making sure they work isn't a good
use of 80 seconds of test time.
2020-02-26 22:28:33 -08:00
Matthijs Mekking
44caa64f39 Add test for checkconf glob include 2020-02-24 13:48:48 -03:00
Diego Fronza
f97ba7a7c2 Added test to verify that both include glob-expression and include
non-glob-expression works.
2020-02-24 13:37:55 -03:00
Diego dos Santos Fronza
a50ab3df86 Added tests for include directive + glob expressions. 2020-02-24 13:37:51 -03:00
Evan Hunt
a2aa29ed4f some Fossies-reported spelling errors were accidentally left unfixed 2020-02-21 14:12:42 -08:00
Evan Hunt
ba0313e649 fix spelling errors reported by Fossies. 2020-02-21 15:05:08 +11:00
Diego Fronza
a3453c257b Added system test
Added a system test which ensures that named-checkzone works when
taking input data from stdin.
2020-02-20 11:19:13 -03:00
Ondřej Surý
5777c44ad0 Reformat using the new rules 2020-02-14 09:31:05 +01:00
Evan Hunt
e851ed0bb5 apply the modified style 2020-02-13 15:05:06 -08:00
Ondřej Surý
056e133c4c Use clang-tidy to add curly braces around one-line statements
The command used to reformat the files in this commit was:

./util/run-clang-tidy \
	-clang-tidy-binary clang-tidy-11
	-clang-apply-replacements-binary clang-apply-replacements-11 \
	-checks=-*,readability-braces-around-statements \
	-j 9 \
	-fix \
	-format \
	-style=file \
	-quiet
clang-format -i --style=format $(git ls-files '*.c' '*.h')
uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h')
clang-format -i --style=format $(git ls-files '*.c' '*.h')
2020-02-13 22:07:21 +01:00
Ondřej Surý
36c6105e4f Use coccinelle to add braces to nested single line statement
Both clang-tidy and uncrustify chokes on statement like this:

for (...)
	if (...)
		break;

This commit uses a very simple semantic patch (below) to add braces around such
statements.

Semantic patch used:

@@
statement S;
expression E;
@@

while (...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

for (...;...;...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

if (...)
- if (E) S
+ { if (E) { S } }
2020-02-13 21:58:55 +01:00
Ondřej Surý
f50b1e0685 Use clang-format to reformat the source files 2020-02-12 15:04:17 +01:00
Mark Andrews
dd2830eb97 wait for apex NSEC3 to be generated
(cherry picked from commit c99ad5c8c7)
2020-02-12 10:02:14 +00:00
Mark Andrews
c38752b07c spin waiting for prototype dig responses 2020-02-12 08:12:02 +00:00
Ondřej Surý
bc1d4c9cb4 Clear the pointer to destroyed object early using the semantic patch
Also disable the semantic patch as the code needs tweaks here and there because
some destroy functions might not destroy the object and return early if the
object is still in use.
2020-02-09 18:00:17 -08:00
Michał Kępień
a5e90f2aa7 Fix the "pipelined" system test on OpenBSD
On OpenBSD, the bin/tests/system/pipelined/ans5/ans.py script does not
shut down when it is sent the SIGTERM signal.  What seems to be
happening is that starting the UDP listening thread somehow makes the
accept() calls in the script's main thread uninterruptible and thus the
SIGTERM signal sent to the main thread does not get processed until a
TCP connection is established with the script's TCP socket.  Work around
the issue by setting a timeout for operations performed on the script's
TCP socket, so that each accept() call in the main thread's infinite
loop returns after at most 1 second, allowing termination signals sent
to the script to be processed.
2020-02-08 14:01:21 -08:00
Mark Andrews
1e4773f121 indent failed: descriptions 2020-02-07 21:12:21 +00:00
Mark Andrews
ec95bc6f2c indent some test descriptions/continuation 2020-02-07 21:12:21 +00:00
Mark Andrews
0d5ec0c7dc remove space before 'failed' 2020-02-07 21:12:21 +00:00
Mark Andrews
059b16b991 ident continuation of test descriptions 2020-02-07 21:12:21 +00:00
Mark Andrews
879c63b573 remove space from before 'failed'; count errors 2020-02-07 21:12:21 +00:00
Evan Hunt
58aa084edc add support for key algorithm mnemonics in dnssec-policy 2020-02-07 19:17:05 +01:00
Matthijs Mekking
8c0db909ee Warn if key lengths are out of range/predefined 2020-02-07 09:30:26 -08:00
Matthijs Mekking
ae6bf1979d Make key-directory optional
The key-directory keyword actually does nothing right now but may
be useful in the future if we want to differentiate between key
directories or HSM keys, or if we want to speficy different
directories for different keys or policies.  Make it optional for
the time being.
2020-02-07 09:30:26 -08:00
Matthijs Mekking
2733edb2a6 Allow for key lifetime unlimited
The keyword 'unlimited' can be used instead of PT0S which means the
same but is more comprehensible for users.

Also fix some redundant "none" parameters in the kasp test.
2020-02-07 09:30:26 -08:00
Evan Hunt
9dc630016e rename 'zone-max-ttl' to 'max-zone-ttl' for consistency 2020-02-07 09:24:06 -08:00
Matthijs Mekking
e97313b44d whitespace: line out settime calls nicely 2020-02-07 15:42:31 +01:00
Matthijs Mekking
b6eb28f629 kasp test: Fix key id 0000 lookup
When checking keys we search for keys by key id. The kasp test used key id
0 as an indicator that a key was not yet found. Use "no" instead.
2020-02-07 15:42:31 +01:00
Mark Andrews
e378241324 wait a short while for no NSEC3PARAM 2020-02-07 12:16:13 +00:00
Michał Kępień
2f694f0b77 Fix the "dnssec" system test on Windows
Make sure carriage return characters are stripped from awk input to
enable the "dnssec" system test to pass on Windows.
2020-02-06 15:17:38 +01:00
Matthijs Mekking
e6c5ecd698 Update kasp test with CDNSKEY checks
Add checks to the kasp system test to verify CDNSKEY publication.
This test is not entirely complete, because when there is a CDNSKEY
available but there should not be one for KEY N, it is hard to tell
whether the existing CDNSKEY actually belongs to KEY N or another
key.

The check works if we expect a CDNSKEY although we cannot guarantee
that the CDNSKEY is correct: The test verifies existence, not
correctness of the record.
2020-02-06 11:02:22 +01:00
Matthijs Mekking
b378d0371f Fix kasp bug new KSK on restart [#1593]
When you do a restart or reconfig of named, or rndc loadkeys, this
triggers the key manager to run.  The key manager will check if new
keys need to be created. If there is an active key, and key rollover
is scheduled far enough away, no new key needs to be created.

However, there was a bug that when you just start to sign your zone,
it takes a while before the KSK becomes an active key. An active KSK
has its DS submitted or published, but before the key manager allows
that, the DNSKEY needs to be omnipresent. If you restart named
or rndc loadkeys in quick succession when you just started to sign
your zone, new keys will be created because the KSK is not yet
considered active.

Fix is to check for introducing as well as active keys. These keys
all have in common that their goal is to become omnipresent.
2020-02-06 10:17:22 +01:00
Mark Andrews
714594d468 's' must be non NULL, remove test.
122 cleanup:

	CID 1452696 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking s suggests that it may be
	null, but it has already been dereferenced on all paths
	leading to the check.

123        if (s != NULL)
124                isc_mem_free(mctx, s);
2020-02-05 18:37:17 +11:00
Matthijs Mekking
2c0c333d16 Increase TTL in serve-stale test
Increase the short lived record TTL and negative SOA TTL to make
this test less vulnerable to timing issues. The drawback is that we
also have to sleep longer in this test.
2020-02-04 13:35:06 +01:00
Matthijs Mekking
7135ef78ee Add test for "Others" rrtype stat counter
Add queries and checks for CAA RRtype in the serve-stale test.
Ensure that the "Others" rrtype stat counter is incremented and
decremented properly if the RRset becomes stale/ancient.

The low max-stale-ttl config option needs to be increased in order
to match the timing when things expire (aka become ancient).
2020-02-04 11:58:34 +01:00
Mark Andrews
fc4e44bd37 don't swallow backslash characters in test output 2020-02-03 18:58:27 -08:00
Mark Andrews
8745043a86 test all the scenarios for hashed filenames together 2020-02-03 18:58:27 -08:00
Evan Hunt
dba0163dac Correctly handle catalog zone entries containing slashes
- Add quotes before and after zone name when generating "addzone"
  input so avoid "unexpected token" errors.
- Use a hex digest for zone filenames when the zone or view name
  contains a slash.
- Test with a domain name containing a slash.
- Incidentally added 'catzhash.py' to contrib/scripts to generate
  hash labels for catalog zones, as it was needed to write the test.
2020-02-03 16:08:20 -08:00
Ondřej Surý
c73e5866c4 Refactor the isc_buffer_allocate() usage using the semantic patch
The isc_buffer_allocate() function now cannot fail with ISC_R_MEMORY.
This commit removes all the checks on the return code using the semantic
patch from previous commit, as isc_buffer_allocate() now returns void.
2020-02-03 08:29:00 +01:00
Ondřej Surý
5eb3f71a3e Refactor the isc_mempool_create() usage using the semantic patch
The isc_mempool_create() function now cannot fail with ISC_R_MEMORY.
This commit removes all the checks on the return code using the semantic
patch from previous commit, as isc_mempool_create() now returns void.
2020-02-03 08:27:16 +01:00
Mark Andrews
d159fdf25d add more CDS / CDNSKEY deletion record tests 2020-01-30 11:29:27 +11:00