]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 years agoAdd a job creating a release tarball to GitLab CI
Michał Kępień [Wed, 11 Dec 2019 11:04:29 +0000 (12:04 +0100)] 
Add a job creating a release tarball to GitLab CI

Add a GitLab CI job (which is run only if all other jobs in a pipeline
succeed) that builds a BIND release tarball, i.e. fetches the source
tarball from the tarball building job, creates Windows zips, puts
certain parts of BIND documentation into the appropriate places, and
packs it all up into a single tarball whose contents can be subsequently
signed and published.

6 years agoAdd a Windows debug system test job to GitLab CI
Michał Kępień [Wed, 11 Dec 2019 11:04:29 +0000 (12:04 +0100)] 
Add a Windows debug system test job to GitLab CI

Add a system test job for binaries created by Visual Studio in the
"Debug" build configuration to GitLab CI so that they can be tested
along their "Release" counterparts when necessary.

6 years agoAdd a Windows debug build job to GitLab CI
Michał Kępień [Wed, 11 Dec 2019 11:04:29 +0000 (12:04 +0100)] 
Add a Windows debug build job to GitLab CI

Add a Visual Studio build job using the "Debug" build configuration to
GitLab CI without enabling it for every pipeline as it takes about twice
as long to complete as its "Release" counterpart.

6 years agoCreate and test BIND source tarballs in GitLab CI
Michał Kępień [Wed, 11 Dec 2019 11:04:29 +0000 (12:04 +0100)] 
Create and test BIND source tarballs in GitLab CI

Add a set of jobs to GitLab CI that create a BIND source tarball and
then build and test its contents.  Run those extra jobs only when a tag
is pushed to the Git repository as they are only meant to be sanity
checks of BIND source tarball contents.

6 years agoInclude prepare-softhsm2.sh in source tarballs
Michał Kępień [Wed, 11 Dec 2019 11:04:29 +0000 (12:04 +0100)] 
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.

6 years agoList paths which should be excluded from tarballs
Michał Kępień [Wed, 11 Dec 2019 11:04:29 +0000 (12:04 +0100)] 
List paths which should be excluded from tarballs

Convert the logic (currently present in the form of "rm -rf" calls in
util/kit.sh) for removing files and directories which are tracked by Git
but redundant in release tarballs into a set of .gitattributes rules
which allow the same effect to be achieved using "git archive".

6 years agoMerge branch 'michal/fix-the-forward-system-test-on-windows' into 'master'
Michał Kępień [Wed, 11 Dec 2019 09:37:35 +0000 (09:37 +0000)] 
Merge branch 'michal/fix-the-forward-system-test-on-windows' into 'master'

Fix the "forward" system test on Windows

See merge request isc-projects/bind9!2750

6 years agoFix the "forward" system test on Windows
Michał Kępień [Wed, 11 Dec 2019 08:42:09 +0000 (09:42 +0100)] 
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.

6 years agoMerge branch '1479-_wait_for_rcode-adds-extraneous-query' into 'master'
Mark Andrews [Wed, 11 Dec 2019 00:25:07 +0000 (00:25 +0000)] 
Merge branch '1479-_wait_for_rcode-adds-extraneous-query' into 'master'

Resolve "_wait_for_rcode adds extraneous query"

Closes #1479

See merge request isc-projects/bind9!2747

6 years agoconsume all arguments we have processed in shift
Mark Andrews [Tue, 10 Dec 2019 23:23:20 +0000 (10:23 +1100)] 
consume all arguments we have processed in shift

6 years agoMerge branch '1411-threadsanitizer-data-race-resolver-c-2153-in-fctx_query' into...
Mark Andrews [Tue, 10 Dec 2019 23:53:13 +0000 (23:53 +0000)] 
Merge branch '1411-threadsanitizer-data-race-resolver-c-2153-in-fctx_query' into 'master'

Resolve "ThreadSanitizer: data race resolver.c:2153 in fctx_query"

Closes #1411

See merge request isc-projects/bind9!2675

6 years agoNote bucket lock requirements and move REQUIRE inside locked section.
Mark Andrews [Thu, 5 Dec 2019 04:25:21 +0000 (15:25 +1100)] 
Note bucket lock requirements and move REQUIRE inside locked section.

6 years agolock access to fctx->nqueries
Mark Andrews [Mon, 2 Dec 2019 05:58:57 +0000 (16:58 +1100)] 
lock access to fctx->nqueries

6 years agoMerge branch '1473-threadsanitizer-data-race-home-ondrej-projects-bind9-lib-isc-netmg...
Ondřej Surý [Tue, 10 Dec 2019 13:00:17 +0000 (13:00 +0000)] 
Merge branch '1473-threadsanitizer-data-race-home-ondrej-projects-bind9-lib-isc-netmgr-netmgr-c-1027-in' into 'master'

Resolve "ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1027 in nmhandle_free"

Closes #1473

See merge request isc-projects/bind9!2739

6 years agoAdd isc_refcount_destroy() call to nm_handle_free()
Ondřej Surý [Tue, 10 Dec 2019 10:09:56 +0000 (11:09 +0100)] 
Add isc_refcount_destroy() call to nm_handle_free()

6 years agoAdd isc_refcount_destroy() call to nm_destroy()
Ondřej Surý [Tue, 10 Dec 2019 09:47:08 +0000 (10:47 +0100)] 
Add isc_refcount_destroy() call to nm_destroy()

6 years agoCorrect the DbC check order in isc__nm_async_tcpchildstop()
Ondřej Surý [Tue, 10 Dec 2019 09:46:49 +0000 (10:46 +0100)] 
Correct the DbC check order in isc__nm_async_tcpchildstop()

6 years agoMerge branch '1441-threadsanitizer-lock-order-inversion-potential-deadlock-usr-lib...
Mark Andrews [Tue, 10 Dec 2019 12:35:20 +0000 (12:35 +0000)] 
Merge branch '1441-threadsanitizer-lock-order-inversion-potential-deadlock-usr-lib-x86_64-linux-gnu-libtsan-so-0' into 'master'

Resolve "ThreadSanitizer: lock-order-inversion (potential deadlock) (/usr/lib/x86_64-linux-gnu/libtsan.so.0+0x2cf99) in pthread_rwlock_rdlock"

Closes #1441

See merge request isc-projects/bind9!2734

6 years agoaddress deadlock introduced in cd2469d3cdbc211ecf8a82c76c1a0a1c4a545fec
Mark Andrews [Tue, 10 Dec 2019 02:16:58 +0000 (13:16 +1100)] 
address deadlock introduced in cd2469d3cdbc211ecf8a82c76c1a0a1c4a545fec

6 years agoMerge branch '1465-fix-idna-system-test' into 'master'
Michał Kępień [Tue, 10 Dec 2019 10:57:02 +0000 (10:57 +0000)] 
Merge branch '1465-fix-idna-system-test' into 'master'

Fix the "idna" system test

See merge request isc-projects/bind9!2740

6 years agoOnly use LC_ALL=C where intended
Michał Kępień [Tue, 10 Dec 2019 09:31:33 +0000 (10:31 +0100)] 
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.

6 years agoMerge branch 'ondrej/run-full-pipeline-on-schedule' into 'master'
Ondřej Surý [Tue, 10 Dec 2019 09:30:26 +0000 (09:30 +0000)] 
Merge branch 'ondrej/run-full-pipeline-on-schedule' into 'master'

Run all jobs on scheduled builds (including OpenBSD and Windows)

See merge request isc-projects/bind9!2736

6 years agoRun all jobs on scheduled builds (including OpenBSD and Windows)
Ondřej Surý [Tue, 10 Dec 2019 08:23:37 +0000 (09:23 +0100)] 
Run all jobs on scheduled builds (including OpenBSD and Windows)

6 years agoMerge branch '1469-lock-order-inversion-tcp-listening' into 'master'
Witold Krecicki [Tue, 10 Dec 2019 09:21:03 +0000 (09:21 +0000)] 
Merge branch '1469-lock-order-inversion-tcp-listening' into 'master'

Fix a potential lock-order-inversion in tcp listening code

Closes #1469

See merge request isc-projects/bind9!2737

6 years agoFix a potential lock-order-inversion in tcp listening code
Witold Kręcicki [Tue, 10 Dec 2019 09:05:15 +0000 (10:05 +0100)] 
Fix a potential lock-order-inversion in tcp listening code

6 years agoMerge branch 'wpk/tcp-multithreaded' into 'master'
Witold Krecicki [Mon, 9 Dec 2019 21:20:40 +0000 (21:20 +0000)] 
Merge branch 'wpk/tcp-multithreaded' into 'master'

netmgr: make tcp listening multithreaded.

See merge request isc-projects/bind9!2659

6 years agoCHANGES entry
Witold Kręcicki [Mon, 9 Dec 2019 12:18:05 +0000 (13:18 +0100)] 
CHANGES entry

6 years agoshorten some names
Evan Hunt [Mon, 9 Dec 2019 20:24:46 +0000 (12:24 -0800)] 
shorten some names

reduce line breaks and general unwieldiness by changing some
function, type, and parameter names.

6 years agostyle nits
Evan Hunt [Mon, 9 Dec 2019 18:49:37 +0000 (10:49 -0800)] 
style nits

6 years agounittest: Allow for 32 (not 16) mock nmhandles in ns tests
Witold Kręcicki [Mon, 9 Dec 2019 13:39:38 +0000 (14:39 +0100)] 
unittest: Allow for 32 (not 16) mock nmhandles in ns tests

6 years agoRemove read callback before detaching from inner socket in tcpdns
Witold Kręcicki [Sun, 8 Dec 2019 22:09:16 +0000 (23:09 +0100)] 
Remove read callback before detaching from inner socket in tcpdns

6 years agoFix a race in socket destruction - we need to remove handle from socket in async...
Witold Kręcicki [Sun, 8 Dec 2019 21:44:08 +0000 (22:44 +0100)] 
Fix a race in socket destruction - we need to remove handle from socket in async close callback or we might race between destruction in the callback and in the original nmhandle_unref

6 years agoalways return true in ns_interfacemgr_listeningon if interfacemgr is shutting down
Witold Kręcicki [Sat, 7 Dec 2019 22:44:16 +0000 (23:44 +0100)] 
always return true in ns_interfacemgr_listeningon if interfacemgr is shutting down
to avoid deadlocks on shutdown.

6 years agonetmgr: Add more DbC checks for asynchronous calls.
Witold Kręcicki [Sat, 7 Dec 2019 22:43:52 +0000 (23:43 +0100)] 
netmgr: Add more DbC checks for asynchronous calls.

6 years agopause and unpause netmgr in isc_nm_destroy to flush all events from worker queues
Witold Kręcicki [Sun, 8 Dec 2019 20:14:08 +0000 (21:14 +0100)] 
pause and unpause netmgr in isc_nm_destroy to flush all events from worker queues

6 years agoStyle fixes
Evan Hunt [Sat, 7 Dec 2019 00:48:11 +0000 (01:48 +0100)] 
Style fixes

6 years agoFix a race in tcpdns close with uv_close on timer
Witold Kręcicki [Fri, 6 Dec 2019 21:25:52 +0000 (22:25 +0100)] 
Fix a race in tcpdns close with uv_close on timer

stop timers before closing

netmgr: tcpdns_close needs to be asynchronous, it manipulates sock->timer

6 years agonetmgr: fix a race in socket destruction, happening if we close the socket
Witold Kręcicki [Fri, 6 Dec 2019 19:45:00 +0000 (20:45 +0100)] 
netmgr: fix a race in socket destruction, happening if we close the socket
externally and, at the same time, a timeout timer callback was called.

6 years agonetmgr:
Witold Kręcicki [Tue, 3 Dec 2019 18:48:10 +0000 (19:48 +0100)] 
netmgr:
 - make tcp listening IPC pipe name saner
 - put the pipe in /tmp on unices
 - add pid to the pipe name to avoid conflicts between processes
 - fsync directory in which the pipe resides to make sure that the
   child threads will see it and be able to open it

6 years agostyle, comments
Evan Hunt [Tue, 3 Dec 2019 08:07:59 +0000 (00:07 -0800)] 
style, comments

6 years ago- Add separate priority event queue for events that must be processed
Witold Kręcicki [Mon, 2 Dec 2019 12:54:44 +0000 (13:54 +0100)] 
- Add separate priority event queue for events that must be processed
  even when worker is paused (e.g. interface reconfiguration). This is
  needed to prevent deadlocks when reconfiguring interfaces - as network
  manager is paused then, but we still need to stop/start listening.

- Proper handling of TCP listen errors in netmgr - bind to the socket first,
  then return the error code.

6 years agoAdd uv_handle_{get,set}_data functions that's absent in pre-1.19 libuv to make code...
Witold Kręcicki [Mon, 2 Dec 2019 10:19:55 +0000 (11:19 +0100)] 
Add uv_handle_{get,set}_data functions that's absent in pre-1.19 libuv to make code clearer.
This might be removed when we stop supporting older libuv versions.

6 years agonetmgr: make tcp listening multithreaded.
Witold Kręcicki [Thu, 28 Nov 2019 09:21:34 +0000 (10:21 +0100)] 
netmgr: make tcp listening multithreaded.

When listening for TCP connections we create a socket, bind it
and then pass it over IPC to all threads - which then listen on
in and accept connections. This sounds broken, but it's the
official way of dealing with multithreaded TCP listeners in libuv,
and works on all platforms supported by libuv.

6 years agoMerge branch '1443-threadsanitizer-data-race-lib-dns-rbtdb-c-1960-in-decrement_refere...
Ondřej Surý [Mon, 9 Dec 2019 18:48:35 +0000 (18:48 +0000)] 
Merge branch '1443-threadsanitizer-data-race-lib-dns-rbtdb-c-1960-in-decrement_reference-2' into 'master'

Resolve "ThreadSanitizer: data race lib/dns/rbtdb.c:1960 in decrement_reference"

Closes #1443

See merge request isc-projects/bind9!2703

6 years agoAdd is_leaf and send_to_prune_tree.
Mark Andrews [Thu, 5 Dec 2019 23:08:52 +0000 (10:08 +1100)] 
Add is_leaf and send_to_prune_tree.

Add is_leaf and send_to_prune_tree to make the logic easier
to understand in cleanup_dead_nodes and decrement_reference.

6 years agoTesting node->down requires the tree lock to be held.
Mark Andrews [Wed, 4 Dec 2019 10:41:04 +0000 (21:41 +1100)] 
Testing node->down requires the tree lock to be held.

In decrement_reference only test node->down if the tree lock
is held.  As node->down is not always tested in
decrement_reference we need to test that it is non NULL in
cleanup_dead_nodes prior to removing the node from the rbt
tree.  Additionally it is not always possible to aquire the
node lock and reactivate a node when adding parent nodes.
Reactivate such nodes in cleanup_dead_nodes if required.

6 years agoMerge branch '1453-the-zero-system-test-timeouts-intermittently' into 'master'
Ondřej Surý [Mon, 9 Dec 2019 17:41:25 +0000 (17:41 +0000)] 
Merge branch '1453-the-zero-system-test-timeouts-intermittently' into 'master'

Bail-out early if dig fails to finish successfully or takes too long

Closes #1453

See merge request isc-projects/bind9!2712

6 years agoMerge branch '1458-intermittent-failure-in-the-forward-system-test' into 'master'
Ondřej Surý [Mon, 9 Dec 2019 17:15:53 +0000 (17:15 +0000)] 
Merge branch '1458-intermittent-failure-in-the-forward-system-test' into 'master'

Resolve "Intermittent failure in the forward system test"

Closes #1458

See merge request isc-projects/bind9!2716

6 years agoBail-out early if dig fails to finish successfully or takes too long
Ondřej Surý [Thu, 5 Dec 2019 17:09:21 +0000 (18:09 +0100)] 
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.

6 years agoWait for named to forward the question before testing the validity
Ondřej Surý [Fri, 6 Dec 2019 10:54:54 +0000 (11:54 +0100)] 
Wait for named to forward the question before testing the validity

6 years agoMake forward system test shellcheck clean
Ondřej Surý [Fri, 6 Dec 2019 10:17:33 +0000 (11:17 +0100)] 
Make forward system test shellcheck clean

6 years agoUse $n to keep diagnostic output of every individual test separate
Ondřej Surý [Fri, 6 Dec 2019 10:07:28 +0000 (11:07 +0100)] 
Use $n to keep diagnostic output of every individual test separate

6 years agoAdd the standard $n to each test
Ondřej Surý [Fri, 6 Dec 2019 10:03:54 +0000 (11:03 +0100)] 
Add the standard $n to each test

6 years agoMerge branch '1425-intermittent-failure-in-the-addzone-system-test' into 'master'
Ondřej Surý [Mon, 9 Dec 2019 16:27:31 +0000 (16:27 +0000)] 
Merge branch '1425-intermittent-failure-in-the-addzone-system-test' into 'master'

Resolve "Intermittent failure in the addzone system test"

Closes #1425

See merge request isc-projects/bind9!2714

6 years agotests: addzone: retry when checking for things, to allow for timing problems
Witold Kręcicki [Mon, 9 Dec 2019 08:25:40 +0000 (09:25 +0100)] 
tests: addzone: retry when checking for things, to allow for timing problems

6 years agoloop waiting for the redirect zone to load
Mark Andrews [Fri, 6 Dec 2019 02:30:14 +0000 (13:30 +1100)] 
loop waiting for the redirect zone to load

6 years agoMerge branch '1466-kasp-test-keyid-0' into 'master'
Matthijs Mekking [Mon, 9 Dec 2019 14:42:08 +0000 (14:42 +0000)] 
Merge branch '1466-kasp-test-keyid-0' into 'master'

Fix get key id from key_idpad

Closes #1466

See merge request isc-projects/bind9!2731

6 years agoFix get key id from key_idpad
Matthijs Mekking [Mon, 9 Dec 2019 13:54:04 +0000 (14:54 +0100)] 
Fix get key id from key_idpad

The kasp system test has a call to sed to retrieve the key identifier
without leading zeros.  The sed call could not handle key id 0.
Update the kasp test to also correctly deal with this case.

6 years agoMerge branch '1457-intermittent-failure-autosign' into 'master'
Matthijs Mekking [Mon, 9 Dec 2019 13:29:36 +0000 (13:29 +0000)] 
Merge branch '1457-intermittent-failure-autosign' into 'master'

Resolve "Intermittent failure in the autosign system test"

Closes #1457

See merge request isc-projects/bind9!2729

6 years agoBetter error handling in autosign system test
Matthijs Mekking [Mon, 9 Dec 2019 10:22:57 +0000 (11:22 +0100)] 
Better error handling in autosign system test

6 years agoFix race in autosign test
Matthijs Mekking [Mon, 9 Dec 2019 07:26:46 +0000 (08:26 +0100)] 
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.

6 years agoMove wait_for_log to conf.sh.common
Matthijs Mekking [Fri, 6 Dec 2019 16:16:45 +0000 (17:16 +0100)] 
Move wait_for_log to conf.sh.common

6 years agoSave settime output
Matthijs Mekking [Fri, 6 Dec 2019 15:48:49 +0000 (16:48 +0100)] 
Save settime output

6 years agoMerge branch 'misc-fixes-kasp' into 'master'
Matthijs Mekking [Mon, 9 Dec 2019 08:22:56 +0000 (08:22 +0000)] 
Merge branch 'misc-fixes-kasp' into 'master'

Miscellaneous fixes kasp

See merge request isc-projects/bind9!2711

6 years agoChange some dnssec-policy defaults
Matthijs Mekking [Thu, 5 Dec 2019 11:17:19 +0000 (12:17 +0100)] 
Change some dnssec-policy defaults

Suggested by Tony Finch, these seem to be more reasonable defaults.

6 years agoDefault key size 2048
Matthijs Mekking [Thu, 5 Dec 2019 10:16:53 +0000 (11:16 +0100)] 
Default key size 2048

The default size for RSA keys is 2048 bits, for both ZSKs and KSKs.

6 years agoUpdate docs with durations, built-in dnssec-policy
Matthijs Mekking [Thu, 5 Dec 2019 09:47:20 +0000 (10:47 +0100)] 
Update docs with durations, built-in dnssec-policy

Clarify in the ARM that TTL-style options can also now take ISO
8601 durations.

Mention the built-in dnssec policies "default" and "none".  Mention
that "none" is the default.

Add a file documenting the default dnssec-policy configuration options.

Fix dnssec-policy syntax in ARM (dnssec-policy.grammar.xml).

6 years agoMerge branch 'ondrej/remove-too-generic-node_count-macro-from-dns_acl' into 'master'
Ondřej Surý [Mon, 9 Dec 2019 06:49:00 +0000 (06:49 +0000)] 
Merge branch 'ondrej/remove-too-generic-node_count-macro-from-dns_acl' into 'master'

Change the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the global namespace

See merge request isc-projects/bind9!2725

6 years agoChange the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the...
Ondřej Surý [Fri, 6 Dec 2019 14:47:39 +0000 (15:47 +0100)] 
Change the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the global namespace

6 years agoMerge branch '1401-intermittent-failures-in-the-catz-system-test' into 'master'
Mark Andrews [Fri, 6 Dec 2019 14:16:03 +0000 (14:16 +0000)] 
Merge branch '1401-intermittent-failures-in-the-catz-system-test' into 'master'

Debug "Intermittent failures in the catz system test"

See merge request isc-projects/bind9!2715

6 years agoIncrease wait_for_message attempts to 20.
Mark Andrews [Fri, 6 Dec 2019 05:44:27 +0000 (16:44 +1100)] 
Increase wait_for_message attempts to 20.

6 years agosave wait_for_message contents
Mark Andrews [Fri, 6 Dec 2019 03:52:06 +0000 (14:52 +1100)] 
save wait_for_message contents

6 years agoMerge branch '1452-system-test-framework-cleanup-tweaks' into 'master'
Michał Kępień [Fri, 6 Dec 2019 13:32:07 +0000 (13:32 +0000)] 
Merge branch '1452-system-test-framework-cleanup-tweaks' into 'master'

System test framework: cleanup tweaks

Closes #1452

See merge request isc-projects/bind9!2717

6 years agoMerge branch '1452-detect-missing-system-test-results' into 'master'
Michał Kępień [Fri, 6 Dec 2019 13:24:26 +0000 (13:24 +0000)] 
Merge branch '1452-detect-missing-system-test-results' into 'master'

Detect missing system test results

See merge request isc-projects/bind9!2708

6 years agoAutomatically run clean.sh from run.sh
Michał Kępień [Fri, 6 Dec 2019 13:11:01 +0000 (14:11 +0100)] 
Automatically run clean.sh from run.sh

The first step in all existing setup.sh scripts is to call clean.sh.  To
reduce code duplication and ensure all system tests added in the future
behave consistently with existing ones, invoke clean.sh from run.sh
before calling setup.sh.

6 years agoDetect missing system test results
Michał Kępień [Fri, 6 Dec 2019 13:11:01 +0000 (14:11 +0100)] 
Detect missing system test results

At the end of each system test suite run, the system test framework
collects all existing test.output files from system test subdirectories
and produces bin/tests/system/systests.output from those files.
However, it does not check whether a test.output file was found for
every executed test.  Thus, if the test.output file is accidentally
deleted by the system test itself (e.g. due to an overly broad file
removal wildcard present in clean.sh), its output will not be included
in bin/tests/system/systests.output.  Since the result of each system
test suite run is determined by bin/tests/system/testsummary.sh, which
only operates on the contents of bin/tests/system/systests.output, this
can lead to test failures being ignored.  Fix by ensuring the number of
test results found in bin/tests/system/systests.output is equal to the
number of tests run and triggering a system test suite failure in case
of a discrepancy between these two values.

6 years agoRemove bin/tests/system/clean.sh
Michał Kępień [Fri, 6 Dec 2019 13:11:01 +0000 (14:11 +0100)] 
Remove bin/tests/system/clean.sh

Since the role of the bin/tests/system/clean.sh script has now been
reduced to calling a given system test's clean.sh script, remove the
former altogether and replace its only use with a direct invocation of
the latter.

6 years agoRemove the -r switch from system test scripts
Michał Kępień [Fri, 6 Dec 2019 13:11:01 +0000 (14:11 +0100)] 
Remove the -r switch from system test scripts

Since files containing system test output are no longer stored in test
subdirectories, bin/tests/system/clean.sh no longer needs to take care
of removing the test.output file for a given test as testsummary.sh
already takes care of that and even if a test suite terminates
abnormally and another one is started, tee invoked without the -a
command line switch overwrites the destination file if it exists, so
leftover test.output.* files from previous test suite runs are not a
concern.  Remove the -r command line switch and the code associated with
it from the relevant scripts.

6 years agoStore system test output in bin/tests/system/
Michał Kępień [Fri, 6 Dec 2019 13:11:01 +0000 (14:11 +0100)] 
Store system test output in bin/tests/system/

Some clean.sh scripts contain overly broad file deletion wildcards which
cause the test.output file (used by the system test framework for
collecting output) in a given system test's directory to be erroneously
removed immediately after the test is started (due to setup.sh scripts
calling clean.sh at the beginning).  This prevents the test's output
from being placed in bin/tests/system/systests.output at the end of a
test suite run and thus can lead to test failures being ignored.  Fix by
storing each test's output in a test.output.<test-name> file in
bin/tests/system/, which prevents clean.sh scripts from removing it (as
they should only ever affect files contained in a given system test's
directory).

6 years agoMerge branch '1460-duration-ttlval-print-bug' into 'master'
Matthijs Mekking [Fri, 6 Dec 2019 13:03:14 +0000 (13:03 +0000)] 
Merge branch '1460-duration-ttlval-print-bug' into 'master'

Resolve "checkconf test failure on Solaris"

Closes #1460

See merge request isc-projects/bind9!2718

6 years agoAdd semantic patch to find void f() { ... return ((void)g())); ... }
Ondřej Surý [Fri, 6 Dec 2019 12:29:04 +0000 (13:29 +0100)] 
Add semantic patch to find void f() { ... return ((void)g())); ... }

When a function returns void, it can be used as an argument to return in
function returning also void, e.g.:

void in(void) {
  return;
}

void out(void) {
  return (in());
}

while this is legal, it should be rewritten as:

void out(void) {
  in();
  return;
}

The semantic patch just find the occurrences, and they need to be fixed
by hand.

6 years agoFix duration printing on Solaris
Matthijs Mekking [Fri, 6 Dec 2019 12:12:06 +0000 (13:12 +0100)] 
Fix duration printing on Solaris

6 years agoReplace two leftover ttlval with duration
Matthijs Mekking [Fri, 6 Dec 2019 11:28:40 +0000 (12:28 +0100)] 
Replace two leftover ttlval with duration

Since the introduction of durations, all ttlval configuration types
are replaced with durations.  Duration is an ISO 8601 duration, a
TTL-style value, or a number.  These two references were missed and
are now also replaced.

6 years agoMerge branch 'trust-anchors-minor-fixes' into 'master'
Matthijs Mekking [Fri, 6 Dec 2019 08:12:55 +0000 (08:12 +0000)] 
Merge branch 'trust-anchors-minor-fixes' into 'master'

Minor fixes in trust anchor code

See merge request isc-projects/bind9!2676

6 years agoMinor fixes in trust anchor code
Matthijs Mekking [Mon, 2 Dec 2019 08:29:02 +0000 (09:29 +0100)] 
Minor fixes in trust anchor code

This commit makes some minor changes to the trust anchor code:

1. Replace the undescriptive n1, n2 and n3 identifiers with slightly
   better rdata1, rdata2, and rdata3.
2. Fix an occurrence where in the error log message a static number
   32 was printed, rather than the rdata3 length.
3. Add a default case to the switch statement checking DS digest
   algorithms to catch unknown algorithms.

6 years agoMerge branch '1455-job-failed-453300' into 'master'
Mark Andrews [Thu, 5 Dec 2019 22:05:24 +0000 (22:05 +0000)] 
Merge branch '1455-job-failed-453300' into 'master'

Resolve "Job Failed #453300"

Closes #1455

See merge request isc-projects/bind9!2706

6 years agoloop waiting for the redirect zone to load
Mark Andrews [Wed, 4 Dec 2019 23:42:33 +0000 (10:42 +1100)] 
loop waiting for the redirect zone to load

6 years agoMerge branch '1427-intermittent-failure-in-fetchlimit-system-test' into 'master'
Ondřej Surý [Thu, 5 Dec 2019 15:55:24 +0000 (15:55 +0000)] 
Merge branch '1427-intermittent-failure-in-fetchlimit-system-test' into 'master'

Test for the hard fetchlimit instead of soft fetchlimit

Closes #1427

See merge request isc-projects/bind9!2705

6 years agoTest for the hard fetchlimit instead of soft fetchlimit
Ondřej Surý [Wed, 4 Dec 2019 23:02:43 +0000 (00:02 +0100)] 
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.

6 years agoMerge branch '1407-intermittent-failure-in-the-mkeys-system-test' into 'master'
Ondřej Surý [Thu, 5 Dec 2019 14:24:29 +0000 (14:24 +0000)] 
Merge branch '1407-intermittent-failure-in-the-mkeys-system-test' into 'master'

Improve the error handling in mkeys test and use retry_quiet()

Closes #1407

See merge request isc-projects/bind9!2704

6 years agoWait for 'all zones loaded' message instead of zoneless 'loaded serial' message
Ondřej Surý [Thu, 5 Dec 2019 13:11:21 +0000 (14:11 +0100)] 
Wait for 'all zones loaded' message instead of zoneless 'loaded serial' message

6 years agoSave all rndc diagnostic output
Ondřej Surý [Wed, 4 Dec 2019 14:56:30 +0000 (15:56 +0100)] 
Save all rndc diagnostic output

6 years agoMake mkeys system test shellcheck clean and run under set -e
Ondřej Surý [Wed, 4 Dec 2019 14:27:13 +0000 (15:27 +0100)] 
Make mkeys system test shellcheck clean and run under set -e

6 years agoImprove the error handling in mkeys test and use retry_quiet()
Ondřej Surý [Wed, 4 Dec 2019 14:06:24 +0000 (15:06 +0100)] 
Improve the error handling in mkeys test and use retry_quiet()

6 years agoMerge branch 'dnssec-keys-rename-to-trust-anchors' into 'master'
Matthijs Mekking [Thu, 5 Dec 2019 13:57:11 +0000 (13:57 +0000)] 
Merge branch 'dnssec-keys-rename-to-trust-anchors' into 'master'

Rename 'dnssec-keys' to 'trust-anchors'

See merge request isc-projects/bind9!2702

6 years agoRename 'dnssec-keys' to 'trust-anchors'
Matthijs Mekking [Wed, 4 Dec 2019 10:06:40 +0000 (11:06 +0100)] 
Rename 'dnssec-keys' to 'trust-anchors'

6 years agoMerge branch '1410-intermittent-failure-in-the-resolver-test' into 'master'
Diego dos Santos Fronza [Wed, 4 Dec 2019 22:58:21 +0000 (22:58 +0000)] 
Merge branch '1410-intermittent-failure-in-the-resolver-test' into 'master'

Resolve "Intermittent failure in the resolver test"

Closes #1410

See merge request isc-projects/bind9!2671

6 years agoImproved prefetch disabled test code
Diego Fronza [Tue, 3 Dec 2019 13:45:39 +0000 (10:45 -0300)] 
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.

6 years agoFix resolver tests: prefetch 40/41
Diego Fronza [Mon, 2 Dec 2019 22:19:56 +0000 (19:19 -0300)] 
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.

6 years agoFix resolver test: prefetch disabled
Diego Fronza [Fri, 29 Nov 2019 14:53:09 +0000 (11:53 -0300)] 
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.