Commit Graph
9292 Commits
Author SHA1 Message Date
Mark AndrewsandMichał Kępień 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ýandMichał Kępień 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 AndrewsandMichał Kępień 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ýandMichał Kępień 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ýandMichał Kępień 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ýandMichał Kępień b29efb0406 Make forward system test shellcheck clean
(cherry picked from commit 0e15cbb092)
2020-01-10 09:10:45 +01:00
Ondřej SurýandMichał Kępień 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ýandMichał Kępień 4cf83a956c Add the standard $n to each test
(cherry picked from commit 64df488e1e)
2020-01-10 09:06:13 +01:00
Witold KręcickiandMichał Kępień 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 AndrewsandMichał Kępień 80a26c15be loop waiting for the redirect zone to load
(cherry picked from commit 9e8cd3ccc5)
2020-01-09 15:13:42 +01:00
Matthijs MekkingandMichał Kępień 6dfdd83040 Move wait_for_log to conf.sh.common
(cherry picked from cfaa631f65)
2020-01-09 15:13:30 +01:00
Ondřej SurýandMichał Kępień 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ýandMichał Kępień 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ýandMichał Kępień f81589f255 Save all rndc diagnostic output
(cherry picked from commit 3b63c51a64)
2020-01-09 12:28:39 +01:00
Ondřej SurýandMichał Kępień 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ýandMichał Kępień 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 FronzaandMichał Kępień 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 FronzaandMichał Kępień 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 FronzaandMichał Kępień 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 AndrewsandMichał Kępień 96aa3bb884 Increase wait_for_message attempts to 20.
(cherry picked from commit 4dd9ec8919)
2020-01-09 10:46:27 +01:00
Mark AndrewsandMichał Kępień d60ca30d2d save wait_for_message contents
(cherry picked from commit 1334daaec0)
2020-01-09 10:46:27 +01:00
Ondřej SurýandMichał Kępień 557b051fc4 Use retry() and nextpart*() to simplify catz test
(cherry picked from commit 51b05189f7)
2020-01-08 14:11:29 +01:00
Witold KręcickiandMichał Kępień 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ýandMichał Kępień 4a6d9ea152 Fix multiple issues in named setuid check
(cherry picked from commit cd804158b4)
2020-01-08 09:31:13 +01:00
Evan HuntandMichał Kępień 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ýandMichał Kępień 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ýandMichał Kępień 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ýandMichał Kępień 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ýandMichał Kępień 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
Ondřej SurýandMichał Kępień fe021299e0 runtime test: make the pidfiles match the names of configuration files
(cherry picked from commit ce86721bc3)
2020-01-08 09:24:49 +01:00
Ondřej SurýandMichał Kępień e9d348bac5 runtime test: use helper function that kills named and waits for the finish
(cherry picked from commit e9fa7b831b)
2020-01-08 09:22:59 +01:00
Mark AndrewsandOndřej Surý 546efbe2ee Address timing issues in 'inline' system test.
"rndc signing -serial <value>" could take longer than a second to
complete.  Loop waiting for update to succeed.

For tests where "rndc signing -serial <value>" is supposed to not
succeed, repeatedly test that we don't get the new serial, then
test that we have the old value.  This should prevent false negatives.

(cherry picked from commit 13fa80ede8)
2020-01-08 08:31:42 +01:00
Ondřej SurýandMichał Kępień ba2b616a4a Detect cores on FreeBSD
(cherry picked from commit 38277ddb0b)
2020-01-07 15:58:44 +01:00
Ondřej SurýandMichał Kępień 48512e11be Reduce the minimal numbers of days in jitter test to 5
(cherry picked from commit 4b2911a45a)
2020-01-07 15:46:28 +01:00
Ondřej SurýandMichał Kępień e359a954fc Tune the performance of CDS/CDNSKEY deletion test
(cherry picked from commit 76eac9a691)
2020-01-07 15:46:27 +01:00
Ondřej SurýandMichał Kępień 46403cff2c Tune the performance of oldsigs test
The oldsigs test was checking only for the validity of the A
a.oldsigs.example. resource record and associated DNSSEC signature while
the zone might not have been fully signed yet leading to validation
failures because of bogus signatures on the validation path.

This commit changes the test to test that all old signatures in the
oldsigs.example. zone were replaced and the zone is fully resigned
before running the main check.

(cherry picked from commit 519b047362)
2020-01-07 15:44:50 +01:00
Ondřej SurýandMichał Kępień a6a19bb246 Tune the performance of the jitter test
(cherry picked from commit ffb7ae8beb)
2020-01-07 15:44:50 +01:00
Ondřej SurýandMichał Kępień 2f57988483 Wait a little bit longer for autosign, bail out on not enough categories
(cherry picked from commit f1cbdc5498)
2020-01-07 15:37:40 +01:00
Ondřej SurýandMichał Kępień 8061971926 Adjust the jitter range to +-3*stddev
(cherry picked from commit d6f68fc4f0)
2020-01-07 15:37:40 +01:00
Ondřej SurýandMichał Kępień 484d131137 Check if the RRSIG jitter falls into mean+-2.5*stddev range
(cherry picked from commit 0480a95ddf)
2020-01-07 15:34:33 +01:00
Ondřej SurýandMichał Kępień 002f908c2f Dump the backtrace to stdout when core is found in systest directory
(cherry picked from commit 512dadc8d1)
2020-01-07 14:42:06 +01:00
Evan Hunt 6e73d3266c update copyright year to 2020 2020-01-02 21:47:16 -08:00
Mark Andrews 631ac188ee update usage message
(cherry picked from commit 41d827893e)
2019-12-20 20:04:36 +11:00
Petr MenšíkandMark Andrews e37d8aecba Include protobuf-c version
Include used version of protobuf-c in version info, both link time and
runtime version is available.

(cherry picked from commit 85f3476894)
2019-12-18 00:31:43 +00:00
Petr MenšíkandMark Andrews 412d7724ae Provide GeoIP2 library version in version
Libmaxmind does not provide any version macro for link time version.
Print at least runtime version library used, if linked.

(cherry picked from commit e6d7384c0d)
2019-12-18 00:31:43 +00:00
Michał Kępień f60cd0c730 Include prepare-softhsm2.sh in source tarballs
The util/prepare-softhsm2.sh script is useful for initializing a working
SoftHSM environment which can be used by unit tests and system tests.
However, since it is a test-specific script, it does not really belong
in the util/ subdirectory which is mostly pruned during the BIND source
tarball creation process.  Move the prepare-softhsm2.sh script to
bin/tests/ so that its location is more appropriate for its purpose and
also so that it does not get removed during the BIND source tarball
creation process, allowing it to be used for setting up test
environments for tarball-based builds.

(cherry picked from commit c0be772ebc)
2019-12-11 12:23:20 +01:00
Michał Kępień 7c14f67d74 Only use LC_ALL=C where intended
The LC_ALL=C assignments in the "idna" system test, which were only
meant to affect a certain subset of checks, in fact persist throughout
all the subsequent checks in that system test.  That affects the test's
behavior and is misleading.

When the "VARIABLE=value command ..." syntax is used in a shell script,
in order for the variable assignment to only apply to "command", the
latter must be an external binary; otherwise, the VARIABLE=value
assignment persists for all subsequent commands in a script:

    $ cat foo.sh
    #!/bin/sh

    foo() {
        /bin/sh bar.sh
    }

    BAR="baz0"
    BAR="baz1" /bin/sh bar.sh
    echo "foo: BAR=${BAR}"
    BAR="baz2" foo
    echo "foo: BAR=${BAR}"

    $ cat bar.sh
    #!/bin/sh

    echo "bar: BAR=${BAR}"

    $ /bin/sh foo.sh
    bar: BAR=baz1
    foo: BAR=baz0
    bar: BAR=baz2
    foo: BAR=baz2
    $

Fix by saving the value of LC_ALL before the relevant set of checks in
the "idna" system test, restoring it afterwards, and dropping the
"LC_ALL=C command ..." syntax.

(cherry picked from commit 2ee7ff23ce)
2019-12-10 11:57:57 +01:00
Matthijs Mekking 6658c11251 Better error handling in autosign system test
(cherry picked from commit bd4035900a)
2019-12-09 16:01:53 +01:00
Matthijs Mekking fb0ddd5bfe Fix race in autosign test
The autosign test has a test case where a DNSSEC maintaiend zone
has a set of DNSSEC keys without any timing metadata set.  It
tests if named picks up the key for publication and signing if a
delayed dnssec-settime/loadkeys event has occured.

The test failed intermittently despite the fact it sleeps for 5
seconds but the triggered key reconfigure action should happen after
3 seconds.

However, the test output showed that the test query came in before
the key reconfigure action was complete (see excerpts below).

The loadkeys command is received:

15:38:36 received control channel command 'loadkeys delay.example.'

The reconfiguring zone keys action is triggered after 3 seconds:

15:38:39 zone delay.example/IN: reconfiguring zone keys
15:38:39 DNSKEY delay.example/NSEC3RSASHA1/7484 (ZSK) is now published
15:38:39 DNSKEY delay.example/NSEC3RSASHA1/7455 (KSK) is now published
15:38:39 writing to journal

Two seconds later the test query comes in:

15:38:41 client @0x7f1b8c0562b0 10.53.0.1#44177: query
15:38:41 client @0x7f1b8c0562b0 10.53.0.1#44177: endrequest

And 6 more seconds later the reconfigure keys action is complete:

15:38:47 zone delay.example/IN: next key event: 05-Dec-2019 15:48:39

This commit fixes the test by checking the "next key event" log has
been seen before executing the test query, making sure that the
reconfigure keys action has been complete.

This commit however does not fix, nor explain why it took such a long
time (8 seconds) to reconfigure the keys.

(cherry picked from commit 2e4273b55a)
2019-12-09 15:53:02 +01:00