Commit Graph
8919 Commits
Author SHA1 Message Date
Mark AndrewsandOndřej Surý c237ca4d43 Dump the returned packet 2020-09-02 08:54:40 +02:00
Ondřej Surý 36ec930560 Add -r <repeats> option to packet.pl
For some tests, we need to send big data streams (for TCP) or repeated
packets (for UDP), this commits adds `-r` option to packet.pl that sends
the same input <repeats> times using the specified protocol.

(cherry picked from commit dd46559a19)
2020-09-02 08:54:40 +02:00
Ondřej Surý abae6c0f95 Properly format 2037-pk11_numbits-crash-test.pkt file
(cherry picked from commit 22e0272063)
2020-09-02 08:54:40 +02:00
Ondřej SurýandOndřej Surý a40151fe76 Add PoC system test for pk11_numbits() assertion
(cherry picked from commit a69433ba40)
2020-08-31 11:49:36 +02:00
Mark AndrewsandOndřej Surý 78d0355f30 check that a malformed truncated response to a TSIG query is handled
(cherry picked from commit 8bbf3eb5f3)
2020-08-31 08:35:10 +02:00
Evan Hunt 15d57a425e Merge tag 'v9_11_22' into v9_11
BIND 9.11.22
2020-08-20 12:10:47 -07:00
Michal Nowak d79c96da01 Make sure .txt files are not identified as crashed test
Previously .txt files with full backtrace may be identified as a
crashed test:

    I:Core dumps were found for the following system tests:
    I:	 core.19948-backtrace.txt
    I:   shutdown

Now .txt files are removed from the list.

Change 'run.sh.in' to match the core matching pattern in
'testsummary.sh'.

(cherry picked from commit c2dcd95966)
(cherry picked from commit 01119ac4f9)
2020-08-12 09:56:16 +02:00
Mark Andrews 1cc06636fc Ensure rl_message() gets prototype.
(cherry picked from commit fd126553d4)
2020-08-12 09:46:31 +10:00
Mark Andrews fd370a250d Stop deprecated functions being defined
(cherry picked from commit 1532a34658)
2020-08-12 09:42:34 +10:00
Mark Andrews f155ff75e4 Check isc_mutex_init() return values 2020-08-11 01:19:02 +00:00
Mark AndrewsandMichał Kępień 58e560beb5 Add a test for update-policy 'zonesub'
The new test checks that 'update-policy zonesub' is properly enforced.
2020-08-05 15:55:14 +02:00
Mark AndrewsandMichał Kępień 393e8f643c Add a test for update-policy 'subdomain'
The new test checks that 'update-policy subdomain' is properly enforced.
2020-08-05 15:55:14 +02:00
Mark AndrewsandMichał Kępień e4cccf9668 Update-policy 'subdomain' was incorrectly treated as 'zonesub'
resulting in names outside the specified subdomain having the wrong
restrictions for the given key.
2020-08-05 15:55:14 +02:00
Mark Andrews d3281b80a9 Check rcode is FORMERR
(cherry picked from commit 88ff6b846c)
2020-08-04 23:08:49 +10:00
Mark Andrews 5770740587 Map DNS_R_BADTSIG to FORMERR
Now that the log message has been printed set the result code to
DNS_R_FORMERR.  We don't do this via dns_result_torcode() as we
don't want upstream errors to produce FORMERR if that processing
end with DNS_R_BADTSIG.

(cherry picked from commit 20488d6ad3)
2020-08-04 23:07:02 +10:00
Michal Nowak fc1e50e73a Fix name of the test directory of stop.pl in masterformat test 2020-07-31 09:26:51 +02:00
Michal Nowak 9470e9e469 Ensure test fails if packet.pl does not work as expected 2020-07-31 09:26:51 +02:00
Michał Kępień 41e2117866 Only run system tests as root in developer mode
Running system tests with root privileges is potentially dangerous.
Only allow it when explicitly requested (by building with
--enable-developer).

(cherry picked from commit 3ef106f69d)
2020-07-31 07:47:49 +02:00
Diego FronzaandEvan Hunt 4bc9ee1844 Update copyrights 2020-07-27 13:40:50 -07:00
Diego FronzaandEvan Hunt 40fd600f25 Add test for RPZ wildcard passthru ignored fix 2020-07-27 13:40:50 -07:00
Mark Andrews b424dfaada Check walking the hip rendezvous servers.
Also fixes extraneous white space at end of record when
there are no rendezvous servers.

(cherry picked from commit 78db46d746)
2020-07-24 15:43:54 +10:00
Petr MenšíkandMark Andrews 35fbfaa498 Prevent crash on dst initialization failure
server might be created, but not yet fully initialized, when fatal
function is called. Check both server and task before attaching
exclusive task.

(cherry picked from commit c5e7152cf0)
2020-07-23 11:29:57 +10:00
Michal Nowak 3745767b2b Check tests for core files regardless of test status
Failed test should be checked for core files et al. and have
backtrace generated.
2020-07-20 17:09:20 +02:00
Michal Nowak 9996811493 Rationalize backtrace logging
GDB backtrace generated via "thread apply all bt full" is too long for
standard output, lets save them to .txt file among other log files.
2020-07-20 17:00:13 +02:00
Evan Hunt 0f7f6201e3 make sure new_zone_lock is locked before unlocking it
it was possible for the count_newzones() function to try to
unlock view->new_zone_lock on return before locking it, which
caused a crash on shutdown.

(cherry picked from commit ed37c63e2b)
2020-07-13 12:32:51 -07:00
Mark Andrews 55f567ab35 Fallback to built in trust-anchors, managed-keys, or trusted-keys
if the bind.keys file cannot be parsed.

(cherry picked from commit d02a14c795)
2020-07-13 15:55:59 +10:00
Michał Kępień 25818ac81f Fix locking for LMDB 0.9.26
When "rndc reconfig" is run, named first configures a fresh set of views
and then tears down the old views.  Consider what happens for a single
view with LMDB enabled; "envA" is the pointer to the LMDB environment
used by the original/old version of the view, "envB" is the pointer to
the same LMDB environment used by the new version of that view:

 1. mdb_env_open(envA) is called when the view is first created.
 2. "rndc reconfig" is called.
 3. mdb_env_open(envB) is called for the new instance of the view.
 4. mdb_env_close(envA) is called for the old instance of the view.

This seems to have worked so far.  However, an upstream change [1] in
LMDB which will be part of its 0.9.26 release prevents the above
sequence of calls from working as intended because the locktable mutexes
will now get destroyed by the mdb_env_close() call in step 4 above,
causing any subsequent mdb_txn_begin() calls to fail (because all of the
above steps are happening within a single named process).

Preventing the above scenario from happening would require either
redesigning the way we use LMDB in BIND, which is not something we can
easily backport, or redesigning the way BIND carries out its
reconfiguration process, which would be an even more severe change.

To work around the problem, set MDB_NOLOCK when calling mdb_env_open()
to stop LMDB from controlling concurrent access to the database and do
the necessary locking in named instead.  Reuse the view->new_zone_lock
mutex for this purpose to prevent the need for modifying struct dns_view
(which would necessitate library API version bumps).  Drop use of
MDB_NOTLS as it is made redundant by MDB_NOLOCK: MDB_NOTLS only affects
where LMDB reader locktable slots are stored while MDB_NOLOCK prevents
the reader locktable from being used altogether.

[1] https://git.openldap.org/openldap/openldap/-/commit/2fd44e325195ae81664eb5dc36e7d265927c5ebc

(cherry picked from commit 53120279b5)
2020-07-10 11:31:43 +02:00
Michał KępieńandMark Andrews 74a738428c Silence PyYAML warning
Make yaml.load_all() use yaml.SafeLoader to address a warning currently
emitted when bin/tests/system/dnstap/ydump.py is run:

    ydump.py:28: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
      for l in yaml.load_all(f.stdout):

(cherry picked from commit 62f631f798)
2020-06-30 11:43:35 +10:00
Mark Andrews 686ee5bd12 Check that 'rndc dnstap -roll <value>' works
(cherry picked from commit a289a57c7f)
2020-06-30 08:39:19 +10:00
Mark Andrews d958d51797 Just test for the two possible values rather than testing for ipv6.
testsock6 can return a false negative when testing under Windows.
2020-06-26 08:55:39 +00:00
Matthijs MekkingandMark Andrews 7e3777c28a Add todo in dnssec system test for [GL #1689]
Add a note why we don't have a test case for the issue.

It is tricky to write a good test case for this if our tools are
not allowed to create signatures for unsupported algorithms.

(cherry picked from commit c6345fffe9)
2020-06-25 22:49:38 +10:00
Mark Andrews 003d9d55ca Resize unamebuf[] to avoid warnings about snprintf() not having
enough buffer space.  Also change named_os_uname() prototype so
that it is now returning (const char *) rather than (char *).  If
uname() is not supported on a UNIX build prepopulate unamebuf[]
with "unknown architecture".

(cherry picked from commit 4bc3de070f)
2020-06-25 09:32:02 +10:00
Mark Andrews dd43437388 Fix resolver system test on system without ipv6 (--disable-ipv6). 2020-06-05 10:42:55 +10:00
Petr MensikandOndřej Surý d33aef43de Delay kserver cleanup until all tasks finishes
It might be possible some pending task would run when kserver is already
cleaned up. Postpone gsstsig structures cleanup after task and timer
managers are destroyed. No pending threads are possible after it.

Make action in maybeshutdown only if doshutdown was not already called.
Might be called from getinput event.

(cherry picked from commit 2685e69be8)
2020-06-04 11:35:07 +02:00
Ondřej Surý 7e2d9531a7 Change the invalid CIDR from parser error to warning
In [RT #43367], the BIND 9 changed the strictness of address / prefix
length checks:

    Check prefixes in acls to make sure the address and
    prefix lengths are consistent.  Warn only in
    BIND 9.11 and earlier.

Unfortunately, a regression slipped in and the check was made an error
also in the BIND 9.11.  This commit fixes the regression, but turning
the error into a warning.
2020-06-03 22:17:02 +02:00
Mark Andrews 919ea623aa Lock access to 'answer' to silence TSAN
(cherry picked from commit b3bd8a270b)
2020-05-28 11:13:37 +10:00
Mark Andrews 2f75aa8120 Add DBC checks to named_checknames_get
(cherry picked from commit 20c07da49b)
2020-05-25 11:56:15 +10:00
Mark Andrews 35964017d0 Set obj to NULL so INSIST makes sense
(cherry picked from commit ac9e266749)
2020-05-25 11:56:14 +10:00
Stephen MorrisandMichał Kępień 5fb65f4544 Add test for reduction in number of fetches
Add a system test that counts how many address fetches are made
for different numbers of NS records and checks that the number
are successfully limited.
2020-05-19 14:24:53 +02:00
Mark AndrewsandMichał Kępień 67ba3f8f3a Check that a 'BADTIME' response with 'QR=0' is handled as a request 2020-05-19 14:24:52 +02:00
Mark Andrews 809d55226b Address race in dnssec system test. 'clear signing records' can fail
as the update triggers by the rndc command to clear the signing records
may not have completed by the time the subsequent rndc command to test
that the records have been removed is commenced.  Loop several times to
prevent false negative.

(cherry picked from commit 353018c0e5)
2020-05-19 13:50:51 +10:00
Mark Andrews ae4f31e434 Retry checks that records are present and signed
There a race between when the delta is logged and when the
server returns signed record.  Retry the queries if the
lookups fail to meet expectations.

(cherry picked from commit 46c4e5d96f)
2020-05-18 16:00:51 +10:00
Mark Andrews 7c1043ae73 move provide-ixfr testing after the serial has been checked
(cherry picked from commit c7cdc47cc5)
(cherry picked from commit 89c1bc58e4)
2020-05-18 09:40:13 +10:00
Mark Andrews ee49cc6201 Check display of EDE option
(cherry picked from commit e6b0153f8a)
(cherry picked from commit 88e11a9971)
2020-05-13 12:18:55 +10:00
Mark Andrews c0d34e8b05 Report Extended DNS Error codes
(cherry picked from commit b144ae1bb0)
(cherry picked from commit eed4fab37b)
2020-05-13 12:18:55 +10:00
Mark AndrewsandOndřej Surý 31b863f3d1 Silence: E741 ambiguous variable name 'l'
(cherry picked from commit 189d21fb96)
2020-05-12 14:05:37 +02:00
Mark Andrews e9013cfe26 add [-s (full|relative)] to usage
(cherry picked from commit 3f93f3ee11)
2020-05-08 16:55:33 +10:00
Evan Hunt 1df4141279 initialize sockaddrdscp to prevent spurious output from 'named-checkconf -p'
(cherry picked from commit f8d753d452)
2020-05-06 12:48:13 -07:00
Evan Hunt 410ee752dd named-checkconf -z could exit with an incorrect staatus
the CHECK() macro resets result, so an error code from an earlier
view could be erased if the last view loaded had no errors.

(cherry picked from commit 7e73660206)
2020-05-01 17:47:44 -07:00
Mark Andrews 0c21ddcac6 Add more special zones to addzone restart test.
Test zones with various escape sequences and filesystem seperator
characters.
* escaped double quote (\")
* escaped escape (\\)
* escaped decimal byte value (\032)
* slash seperator (/)

(cherry picked from commit 5ab9b5b1e6)
2020-05-01 09:18:04 +10:00