Commit graph

4299 commits

Author SHA1 Message Date
Mark Andrews
7f079c4fa3 check kskonly key ids
(cherry picked from commit 379949cce4)
2020-01-31 00:15:16 +11:00
Mark Andrews
735dfc1ab8 check that a CDNSKEY deletion record is accepted
(cherry picked from commit f91b3a69ce)
2020-01-31 00:15:16 +11:00
Mark Andrews
103cd665e1 handle CDS deletion record in consistancy checks
(cherry picked from commit 0adb4b25d3)
2020-01-31 00:15:15 +11:00
Michał Kępień
6e9d3680f9 List atypical failures in system test summary
Each system test can be marked as failed not only due to some tested
component(s) not behaving as expected, but also because of core dumps,
assertion failures, and/or ThreadSanitizer reports being found among its
artifacts.  Make the system test summary list the tests which exhibit
such atypical symptoms to more clearly present the nature of problems
found.

(cherry picked from commit a8836b381f)
2020-01-29 14:50:42 +01:00
Mark Andrews
7865f1e28a wait longer for dynamic zone to be transfered
(cherry picked from commit 7b0ba6eb10)
2020-01-29 08:24:42 +11:00
Mark Andrews
cb271dcef0 wait for the ./NS lookup to complete
(cherry picked from commit 9b6df37303)
2020-01-24 08:20:04 +11:00
Mark Andrews
c585221d10 check that all servers have finished loading before beginging tests
(cherry picked from commit 4a992c7a18)
2020-01-24 08:20:04 +11:00
Mark Andrews
0336701524 wait for log message before testing that mirror zone is correctly removed
(cherry picked from commit c6ba51cfc4)
2020-01-23 16:19:38 +11:00
Mark Andrews
a0505547ca address timing issues in padding system test
'rndc stats' is not instantaneous. Wait for the dump to complete
before looking at the content.

(cherry picked from commit b3f06729e5)
2020-01-23 14:19:41 +11:00
Diego Fronza
f506a40914 Added test for the proposed fix
Added test to ensure that NXDOMAIN is returned when BIND is queried for a
non existing domain in CH class (if a view of CHAOS class is configured)
and that it also doesn't crash anymore in those cases.

(cherry picked from commit 7417b79c7a)
2020-01-22 12:25:34 -08:00
Michal Nowak
377e48e897
mkeys: Prevent failing grep invocations
Some 'grep' invocations were not guarded from interrupting the test
prematurely, e.g. when no text was matched.

(cherry picked from commit 6c4a2b602042d83450f0af50c25225efa8698750)
2020-01-22 15:54:19 +01:00
Mark Andrews
2db5a2539a dnssec: do not publish CDS records when -Psync is in the future
This is a bug I encountered when trying to schedule an algorithm
rollover. My plan, for a zone whose maximum TTL is 48h, was to sign
with the new algorithm and schedule a change of CDS records for more
than 48 hours in the future, roughly like this:

    $ dnssec-keygen -a 13 -fk -Psync now+50h $zone
    $ dnssec-keygen -a 13 $zone
    $ dnssec-settime -Dsync now+50h $zone_ksk_old

However the algorithm 13 CDS was published immediately, which could
have made the zone bogus.

To reveal the bug using the `smartsign` test, this change just adds a
KSK with all its times in the future, so it should not affect the
existing checks at all. But the final check (that there are no CDS or
CDSNSKEY records after -Dsync) fails with the old `syncpublish()`
logic, because the future key's sync records appear early. With the
new `syncpublish()` logic the future key does not affect the test, as
expected, and it now passes.

(cherry picked from commit 4227b7969b)
2020-01-21 23:04:16 +00:00
Witold Kręcicki
3f54e31d0c tests: add a missing log nextpart in inline test 2020-01-21 15:15:42 +01:00
Michał Kępień
bfedaa5a99 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.

(cherry picked from commit 451484b870)
2020-01-16 09:50:06 +01:00
Mark Andrews
0384fb7d92 address some timing issues in inline system test
(cherry picked from commit 2dc4d72fa9)
2020-01-14 14:36:35 +01:00
Mark Andrews
1327031232 Fix autosign system test issues.
* report when NSEC3PARAM is not yet present
* allow more time for NSEC3PARAM to become present
* adjust frequency failure message

(cherry picked from commit 17d25dbf47)
2020-01-14 13:24:19 +01:00
Mark Andrews
895f60d6f8 improve forensic logs
improve forensic logs by directing output to per sub-test named
files and reporting the sub-subtest number.

(cherry picked from commit 05aa45c602)
2020-01-14 11:57:40 +01:00
Mark Andrews
28695f1c92 suppress unnecessary zone transfer
suppressed unnecessary zone transfer in "test mapped zone with
out of zone data" sub-test.

(cherry picked from commit 9bd6720f58)
2020-01-14 11:54:58 +01:00
Mark Andrews
14ef8b10af Improve forensic logging in "testing basic zone transfer functionality"
Split the "testing basic zone transfer functionality" into primary and
secondary parts to improve forensic logging.

(cherry picked from commit 46982b414b)
2020-01-14 11:51:31 +01:00
Tony Finch
6014fe13ff Fix line spacing in rndc secroots
Before this change, there was a missing blank line between the
negative trust anchors for one view, and the heading line for the next
view. This is because dns_ntatable_totext() omits the last newline.
There is an example of the incorrect output below; the fixed output
has a blank line before "Start view auth".

secure roots as of 21-Oct-2019 12:03:23.500:

 Start view rec
   Secure roots:

./RSASHA256/20326 ; managed

   Negative trust anchors:

example.com: expiry 21-Oct-2019 13:03:15.000
 Start view auth
   Secure roots:

./RSASHA256/20326 ; managed

   Negative trust anchors:

example.com: expiry 21-Oct-2019 13:03:07.000

(cherry picked from commit 5b600c2cd8)
2020-01-14 06:29:09 +11:00
Mark Andrews
3636b0d275 replace grep -r with 'find -type f | xargs'
(cherry picked from commit 36ce99d8a4)
2020-01-10 10:51:37 +01:00
Ondřej Surý
3bc834daae Don't clean the system test temporary files if sanitizer reports were found inside
(cherry picked from commit 7489e6e6f9)
2020-01-10 10:47:54 +01:00
Michał Kępień
12f0f68742 Fix the "forward" system test on Windows
Make sure carriage return characters are stripped from sed input to
enable the "forward" system test to pass on Windows.

(cherry picked from commit 075613aea4)
2020-01-10 10:44:08 +01:00
Mark Andrews
05596de640 consume all arguments we have processed in shift
(cherry picked from commit 0ee0580fc9)
2020-01-10 10:41:23 +01:00
Ondřej Surý
bea5bcff8d Bail-out early if dig fails to finish successfully or takes too long
Before, the zero system test could get stuck almost infinitely, because
the first test sends > 300 queries with 5 seconds timeout on each in
each pass.  If named crashed early, it would took the test more than 4
hours to properly timeout.

This commit introduces a "watchdog" on the dig commands running in the
background and failing the test on timeout, failing any test if any dig
command fails to return successfully, and making the tests.sh script
shellcheck clean.

(cherry picked from commit 2a65a47f39)
2020-01-10 10:04:12 +01:00
Ondřej Surý
865fff9b5a Wait for named to forward the question before testing the validity
(cherry picked from commit fb03edacd8)
2020-01-10 09:10:46 +01:00
Ondřej Surý
b29efb0406 Make forward system test shellcheck clean
(cherry picked from commit 0e15cbb092)
2020-01-10 09:10:45 +01:00
Ondřej Surý
97985a2d4d Use $n to keep diagnostic output of every individual test separate
(cherry picked from commit 10f4cd066f)
2020-01-10 09:08:21 +01:00
Ondřej Surý
4cf83a956c Add the standard $n to each test
(cherry picked from commit 64df488e1e)
2020-01-10 09:06:13 +01:00
Witold Kręcicki
d1afbda2f0 tests: addzone: retry when checking for things, to allow for timing problems
(cherry picked from commit 8885fd6966)
2020-01-09 15:13:42 +01:00
Mark Andrews
80a26c15be loop waiting for the redirect zone to load
(cherry picked from commit 9e8cd3ccc5)
2020-01-09 15:13:42 +01:00
Matthijs Mekking
6dfdd83040 Move wait_for_log to conf.sh.common
(cherry picked from cfaa631f65)
2020-01-09 15:13:30 +01:00
Ondřej Surý
b29059b391 Test for the hard fetchlimit instead of soft fetchlimit
Previously, the fetchlimit tested the recursive-clients soft limit
that's defined as 90% of the hard limit (the actual configured value).
This worked previously because the reaping of the oldest recursive
client was put on the same event queue as the current TCP client, thus
the cleaning has happened before the new TCP client established a new
connection.

With the change in BIND 9.14 that added a multiple event queues the
cleaning of the oldests clients is no longer synchronous and could
happen stochastically making the soft limit testing fail often.  The
situation became even worse with the new networking manager, thus we
change the system test to fail only if the hard limit bound is not
honored.

Changing the accounting of the already reaped TCP clients so the soft
limit testing is possible again is out of the scope for this change.

(cherry picked from commit c35a4e05fa)
2020-01-09 14:08:05 +01:00
Ondřej Surý
e6b303344a Wait for 'all zones loaded' message instead of zoneless 'loaded serial' message
(cherry picked from commit b0ad689e16)
2020-01-09 12:28:39 +01:00
Ondřej Surý
f81589f255 Save all rndc diagnostic output
(cherry picked from commit 3b63c51a64)
2020-01-09 12:28:39 +01:00
Ondřej Surý
031de5a857 Make mkeys system test shellcheck clean and run under set -e
(cherry picked from commit 4ff25c06c1)
2020-01-09 12:28:38 +01:00
Ondřej Surý
5d0732634a Improve the error handling in mkeys test and use retry_quiet()
(cherry picked from commit f239d67c1a)
2020-01-09 12:26:28 +01:00
Diego Fronza
cbd4cc6242 Improved prefetch disabled test code
Using retry_quiet to test that prefetch is disabled instead of a
standard loop with sleep 1 between each iteration.

(cherry picked from commit 994fc2e822)
2020-01-09 11:28:34 +01:00
Diego Fronza
dd1b4007b8 Fix resolver tests: prefetch 40/41
These two tests were failing basically because in order for prefetching to
happen, the TTL for a given DNS record must be greater than or equal to
the prefetch config value + 9.

The previous TTL for both records was 10, while prefetch value in
configuration was 3, thus making only records with TTL >= 12 elligible
for prefetching.

TTL value for both records was adjusted to the value 13, and prefetch
value was set to 4 (inc by 1), so records with TTL (4 + 9) >= 13 are
elligible for prefetching.

Adjusting prefetch value to 4 gives the test 1 second more to avoid time
problems when sharing resources on a heavy loaded PC.

Also prefetch value in settings is now read by the script and used
by it to corrrectly calculate the amount of time needed to delay before
sending a request to trigger prefetch, adding a bit of flexibility to
fine tune the test in the future.

(cherry picked from commit a711d6f8c0)
2020-01-09 11:27:23 +01:00
Diego Fronza
e0c03d19a4 Fix resolver test: prefetch disabled
The previous test had two problems:
1. It wasn't written specifically for testing what it was supposed to:
prefetch disabled.
2. It could fail in some circunstances if the computer's load is too
high, due to sleeps not taking parallel tests and cpu load into account.

The new test is testing prefetch disabled as follows:
1. It asks for a txt record for a given domain and takes note of the
record's TTL (which is 10).
2. It sleeps for (TTL - 5) = 5 seconds, having a window of 5 seconds to
issue new queries before the record expires from cache.
3. Three(3) queries are executed in a row, with a interval of 1 second
between them, and for each query we verify that the TTL in response is
less than the previous one, thus ensuring that prefetch is disabled (if
it were enabled this record would have been refreshed already and TTL
would be >= the first TTL).

Having a window of 5 seconds to perform 3 queries with a interval of 1
second between them gives the test a reasonable amount of time
to not suffer from a machine with heavy load.

(cherry picked from commit dd524cc893)
2020-01-09 11:18:12 +01:00
Mark Andrews
96aa3bb884 Increase wait_for_message attempts to 20.
(cherry picked from commit 4dd9ec8919)
2020-01-09 10:46:27 +01:00
Mark Andrews
d60ca30d2d save wait_for_message contents
(cherry picked from commit 1334daaec0)
2020-01-09 10:46:27 +01:00
Ondřej Surý
557b051fc4 Use retry() and nextpart*() to simplify catz test
(cherry picked from commit 51b05189f7)
2020-01-08 14:11:29 +01:00
Witold Kręcicki
8cdad6bedf Fix timing issues in catz test
Make the log checks more precise and use the retry() function for
repeating the checks.

(cherry picked from commit 9b43e65c01)
2020-01-08 14:11:29 +01:00
Ondřej Surý
4a6d9ea152 Fix multiple issues in named setuid check
(cherry picked from commit cd804158b4)
2020-01-08 09:31:13 +01:00
Evan Hunt
dc760867d8 fixed a test failure, some other shell cleanup
(cherry picked from commit 7a8269207d)
2020-01-08 09:30:00 +01:00
Ondřej Surý
355eb0c288 Instead of sleeping for a fixed time, wait for named to log specific message in a loop
(cherry picked from commit f020199925)
2020-01-08 09:29:24 +01:00
Ondřej Surý
57b6aeabd5 Make runtime/tests.sh shellcheck and set -e clean
This mostly comprises of:

* using $(...) instead of `...`
* changing the directories in subshell and not ignoring `cd` return code
* handling every error gracefully instead of ignoring the return code

(cherry picked from commit 340b1d2b6b)
2020-01-08 09:28:24 +01:00
Ondřej Surý
d26e7166a6 Further improve the runtime tests to look for a specific instead of generic error
(cherry picked from commit 8f539a8886)
2020-01-08 09:27:48 +01:00
Ondřej Surý
60f335204a Fix couple of no-op tests to actually test something (configuration files were missing)
(cherry picked from commit b5a18ac439)
2020-01-08 09:27:16 +01:00