3871 Commits

Author SHA1 Message Date
Mark Andrews
1225cd3f8b remove incorrect UNUSED(argc); add POST(argv); 2019-09-05 11:15:52 +10:00
Mark Andrews
12b2727382 use v9_11 style rndc reload 2019-09-04 18:23:41 +10:00
Mark Andrews
da08c99d5b silence dos2unix messages
(cherry picked from commit 2390d16955)
2019-09-04 11:09:31 +10:00
Mark Andrews
79dd970a73 don't escape commas when saving named's command line
(cherry picked from commit 70dd93bf8a)
2019-08-30 10:44:51 +10:00
Mark Andrews
b67c6fe8bd Add support for displaying EDNS option LLQ.
(cherry picked from commit d98f446d3f)
2019-08-28 17:48:24 +10:00
Mark Andrews
27daac1e4b add good and bad CDS / CDNSKEY test zones
(cherry picked from commit 30610eb9a5)
2019-08-28 17:29:20 +10:00
Mark Andrews
ad1950439c fix dnssec system tests that fail now that we call dns_zone_cdscheck
(cherry picked from commit 3705605e0b)
2019-08-28 17:18:51 +10:00
Michał Kępień
323c309724 Use rndc_dumpdb() in the "sfcache" system test
(cherry picked from commit 4a8b3a8ac0)
2019-08-08 15:12:12 +02:00
Michał Kępień
999e04854b Use rndc_dumpdb() in the "rndc" system test
(cherry picked from commit 443449863b)
2019-08-08 15:12:12 +02:00
Michał Kępień
e641d74a8a Use rndc_dumpdb() in the "dnssec" system test
(cherry picked from commit 44c0cc881f)
2019-08-08 15:12:12 +02:00
Michał Kępień
fb55b7dabd Use rndc_dumpdb() in the "cookie" system test
(cherry picked from commit cbf32b901b)
2019-08-08 15:12:12 +02:00
Michał Kępień
7276b6756e Use rndc_dumpdb() in the "cacheclean" system test
(cherry picked from commit 22d5355782)
2019-08-08 15:12:12 +02:00
Michał Kępień
678a631f54 Implement a convenience function for "rndc dumpdb"
Add a helper shell function, rndc_dumpdb(), which provides a convenient
way to call "rndc dumpdb" for a given server with optional additional
arguments.  Since database dumping is an asynchronous process, the
function waits until the dump is complete before returning, which
prevents false positives in system tests caused by inspecting the dump
before its preparation is finished.  The function also renames the dump
file before returning so that it does not get overwritten by subsequent
calls; this retains forensic data in case of an unexpected test failure.

(cherry picked from commit ab78e350dd)
2019-08-08 15:12:12 +02:00
Evan Hunt
529a81217b added "mdig +multi +norrcomment" test; also fixed the flawed dig test
(cherry picked from commit 93ad3eea90)
2019-08-07 21:05:53 -07:00
Mark Andrews
153512960b check that example/DS is not fetched when validating a.example
(cherry picked from commit 4293a2f4bf)
2019-08-02 16:52:57 +10:00
Mark Andrews
30f5a99364 check that bits 64..71 in a dns64 prefix are zero
(cherry picked from commit a7ec7eb6ed)
2019-07-31 22:45:02 +10:00
Michał Kępień
6987363936 Make root hints consistent with authoritative data
Multiple resolvers in the "wildcard" system test are configured with a
single root hint: "ns.root-servers.nil", pointing to 10.53.0.1, which is
inconsistent with authoritative data served by ns1.  This may cause
intermittent resolution failures, triggering false positives for the
"wildcard" system test.  Prevent this from happening by making ns2, ns3,
and ns5 use root hints corresponding to the contents of ns1/root.db.in.

(cherry picked from commit dd430c3093)
2019-07-31 11:07:47 +02:00
Michał Kępień
9829962c81 Make root hints consistent with authoritative data
The ns2 named instance in the "staticstub" system test is configured
with a single root hint commonly used in BIND system tests
(a.root-servers.nil with an address of 10.53.0.1), which is inconsistent
with authoritative data served by ns1.  This may cause intermittent
resolution failures, triggering false positives for the "staticstub"
system test.  Prevent this from happening by making ns1 serve data
corresponding to the contents of bin/tests/system/common/root.hint.

(cherry picked from commit 4b5e1da0e3)
2019-07-31 09:18:24 +02:00
Michał Kępień
1546298005 Fix awk invocation in the "verify" system test
Appending output of a command to the same file as the one that command
is reading from is a dangerous practice.  It seems to have accidentally
worked with all the awk implementations we have tested against so far,
but for BusyBox awk, doing this may result in the input/output file
being written to in an infinite loop.  Prevent this from happening by
redirect awk output to a temporary file and appending its contents to
the original file in a separate shell pipeline.

(cherry picked from commit bb9c1654e2)
2019-07-30 22:22:28 +02:00
Michał Kępień
2ce4f23bc0 Extend prerequisites for the "xfer" system test
The Net::DNS Perl module needs the Digest::HMAC module to support TSIG.
However, since the latter is not a hard requirement for the former, some
packagers do not make Net::DNS depend on Digest::HMAC.  If Net::DNS is
installed on a host but Digest::HMAC is not, the "xfer" system test
breaks in a very hard-to-debug way (ans5 returns TSIG RRs with empty
RDATA, which prevents TSIG-signed SOA queries and transfers from
working).  Prevent this from happening by making the "xfer" system test
explicitly require Digest::HMAC apart from Net::DNS.

(cherry picked from commit b10d28d1e0)
2019-07-30 22:22:28 +02:00
Michał Kępień
566f76b1fe Make "autosign" system test work with BusyBox awk
The BusyBox version of awk treats some variables which other awk
implementations consider to be decimal values as octal values.  This
intermittently breaks key event interval calculations in the "autosign"
system test, trigger false positives for it.  Prevent the problem from
happening by stripping leading zeros from the affected awk variables.

(cherry picked from commit ad008f7dbf)
2019-07-30 22:22:28 +02:00
Michał Kępień
6563ee9c7d Make root hints consistent with authoritative data
Resolvers in the "filter-aaaa" system test are configured with a single
root hint: "ns.rootservers.net", pointing to 10.53.0.1.  However,
querying ns1 for "ns.rootservers.net" results in NXDOMAIN answers.
Since the TTL for the root hint is set to 0, it may happen that a
resolver's ADB will be asked to return any known addresses for
"ns.rootservers.net", but it will only have access to a cached NXDOMAIN
answer for that name and an expired root hint, which will result in a
resolution failure, triggering a false positive for the "filter-aaaa"
system test.  Prevent this from happening by making all the root hints
consistent with authoritative data served by ns1.

(cherry picked from commit c19ebde14b)
2019-07-29 21:45:06 +02:00
Evan Hunt
661ea29ecb add a system test, confirming that named fails to reload without crashing
(cherry picked from commit 8f1cdaeed9)
2019-07-28 13:16:29 -07:00
Mark Andrews
00920b3a9b Check that RPZ 'CNAME *.' (NODATA) works with DNS64.
(cherry picked from commit b9dc9b68cd)
2019-07-25 07:26:35 +10:00
Mark Andrews
8f2d5e6a86 named-checkconf failed to report dnstap-output missing
from named.conf when dnstap was specified

(cherry picked from commit a4f38bec6a)
2019-07-23 23:36:40 +10:00
Ondřej Surý
9feaf319b4 Test the AES DNS Cookie algorithm only if available 2019-07-22 09:06:03 -04:00
Ondřej Surý
a0f4e6d27e Add new siphash24 DNS Cookie algorithm
This commit changes the BIND cookie algorithms to match
draft-sury-toorop-dnsop-server-cookies-00.  Namely, it changes the Client Cookie
algorithm to use SipHash 2-4, adds the new Server Cookie algorithm using SipHash
2-4.  The change doesn't make the SipHash 2-4 to be the default algorithm, this
is up to the operator.

(cherry picked from commit 196b342bc9)
2019-07-22 09:06:03 -04:00
Michał Kępień
825497f508 Make ifconfig.sh work on DragonFly BSD
On DragonFly BSD, use the same commands for configuring network
interfaces used during system tests as on NetBSD and OpenBSD.

(cherry picked from commit 496397eb3f)
2019-07-22 08:09:49 -04:00
Evan Hunt
cf9c7959a0 add support for building GeoIP2 on windows 2019-07-04 12:06:01 -07:00
Evan Hunt
bb4b3e7f14 add geoip2 system test
(cherry picked from commit 9a1caf99ef)
(cherry picked from commit 049d8a311b)
2019-07-02 12:29:44 -07:00
Evan Hunt
a553ac45ed add HAVE_GEOIP2 #ifdef branches, without implementing yet
(cherry picked from commit fe46d5bc34)
(cherry picked from commit 7fc92bee0c)
2019-07-02 12:28:14 -07:00
Evan Hunt
7de12aaa34 add a search for GeoIP2 libraries in configure
- "--with-geoip" is used to enable the legacy GeoIP library.
- "--with-geoip2" is used to enable the new GeoIP2 library
  (libmaxminddb), and is on by default if the library is found.
- using both "--with-geoip" and "--with-geoip2" at the same time
  is an error.
- an attempt is made to determine the default GeoIP2 database path at
  compile time if pkg-config is able to report the module prefix. if
  this fails, it will be necessary to set the path in named.conf with
  geoip-directory
- Makefiles have been updated, and a stub lib/dns/geoip2.c has been
  added for the eventual GeoIP2 search implementation.

(cherry picked from commit fea6b5bf10)
(cherry picked from commit 6a7e805796)
2019-07-02 12:28:14 -07:00
Michał Kępień
621f8aa90a Add and use keyfile_to_key_id() helper function
When trying to extract the key ID from a key file name, some test code
incorrectly attempts to strip all leading zeros.  This breaks tests when
keys with ID 0 are generated.  Add a new helper shell function,
keyfile_to_key_id(), which properly handles keys with ID 0 and use it in
test code whenever a key ID needs to be extracted from a key file name.

(cherry picked from commit 7d6eaad1bd)
2019-06-28 14:09:36 +02:00
Michał Kępień
511f3c3601 dnstap-read: clear buffer before expanding it
When printing a packet, dnstap-read checks whether its text form takes
up more than the 2048 bytes allocated for the output buffer by default.
If that is the case, the output buffer is automatically expanded, but
the truncated output is left in the buffer, resulting in malformed data
being printed.  Clear the output buffer before expanding it to prevent
this issue from occurring.

(cherry picked from commit 3549abe81d)
2019-06-28 12:45:44 +02:00
Mark Andrews
53543c1ecc check xsl vs xml
(cherry picked from commit d5c795942f)
2019-06-27 13:40:52 +10:00
Evan Hunt
f608f9335d x 2019-06-26 09:38:59 -07:00
Evan Hunt
2fd9e88405 add system test to confirm glue is returned in priming queries
(cherry picked from commit 9a1f0ea873)
2019-06-26 09:27:26 -07:00
Evan Hunt
59dc713fc3 add a test that reloading errors are not ignored
(cherry picked from commit e48b3f1a00)
2019-06-26 08:56:14 -07:00
Michał Kępień
d48ba3ce12 Prevent "idna" test failures with libidn2 2.2.0+
libidn2 2.2.0+ parses Punycode more strictly than older versions and
thus "dig +idnin +noidnout xn--19g" fails with libidn2 2.2.0+ but
succeeds with older versions.

We could preserve the old behavior by using the IDN2_NO_ALABEL_ROUNDTRIP
flag available in libidn2 2.2.0+, but:

  - this change in behavior is considered a libidn2 bug fix [1],
  - we want to make sure dig behaves as expected, not libidn2,
  - implementing that would require additional configure.ac cruft.

Removing the problematic check appears to be the simplest solution as it
does not prevent the relevant block of checks in the "idna" system test
from achieving its purpose, i.e. ensuring dig properly handles invalid
U-labels.

[1] see upstream commit 241e8f486134793cb0f4a5b0e5817a97883401f5

(cherry picked from commit 60ce0ed411)
2019-06-26 14:41:10 +02:00
Mark Andrews
8802a3a901 wait for zones to load
(cherry picked from commit b62e6418b5)
2019-06-24 14:19:05 +10:00
Michał Kępień
29e31a6858 Always fail a system test if crashes are detected
In certain situations (e.g. a named instance crashing upon shutdown in a
system test which involves shutting down a server and restarting it
afterwards), a system test may succeed despite a named crash being
triggered.  This must never be the case.  Extend run.sh to mark a test
as failed if core dumps or log lines indicating assertion failures are
detected (the latter is only an extra measure aimed at test environments
in which core dumps are not generated; note that some types of crashes,
e.g. segmentation faults, will not be detected using this method alone).

(cherry picked from commit 7706f22924)
2019-06-18 09:26:40 +02:00
Michał Kępień
6c8546edc6 Fix key ID processing
If ns1/setup.sh generates a key with ID 0, the "KEYID" token in
ns1/named.conf.in will be replaced with an empty string, causing the
following broken statement to appear in ns1/named.conf:

    tkey-dhkey "server" ;

Such a statement triggers false positives for the "tkey" system test due
to ns1 being unable to start with a broken configuration file.  Fix by
tweaking the regular expression used for removing leading zeros from the
key ID, so that it removes at most 4 leading zeros.

(cherry picked from commit 0b7b1161c2)
2019-06-17 14:16:20 +02:00
Witold Kręcicki
171db1a22d Address GCC 8.3 -O3 compilation warning
Compiling with -O3 triggers the following warning with GCC 8.3:

    driver.c: In function ‘dlz_findzonedb’:
    driver.c:198:29: warning: ‘%u’ directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 99 [-Wformat-truncation=]
      snprintf(buffer, size, "%s#%u", addr_buf, port);
                                 ^~
    driver.c:198:25: note: directive argument in the range [0, 65535]
      snprintf(buffer, size, "%s#%u", addr_buf, port);
                             ^~~~~~~
    driver.c:198:2: note: ‘snprintf’ output between 3 and 106 bytes into a destination of size 100
      snprintf(buffer, size, "%s#%u", addr_buf, port);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Increase the size of the relevant array to prevent this warning from
being triggered.

(cherry picked from commit 44e6bb8b93)
2019-06-11 10:19:22 +02:00
Mark Andrews
174b6be987 capture named-checkconf output
(cherry picked from commit 36dd373ab4)
2019-06-06 18:48:57 +10:00
Michał Kępień
ed45b53cb7 Backport missing "legacy" system test checks
Backport "legacy" system test checks which are present in master and
v9_14 branches, but missing in the v9_11 branch, in order to improve the
consistency of this test across all maintained branches.  Note that the
"ednsnotimp" check is expected to succeed with 9.11 whereas it is
expected to fail with 9.14 and later versions.
2019-05-31 12:43:31 +02:00
Mark Andrews
ac4d3e8496 test Ed448 against test vectors
(cherry picked from commit 20f2d9b41b)
2019-05-30 23:06:09 +10:00
Michał Kępień
9016f78a0f Optimize dig parameters to decrease test run time
Performing server setup checks using "+tries=3 +time=5" is redundant as
a single query is arguably good enough for determining whether a given
named instance was set up properly.  Only use multiple queries with a
long timeout for resolution checks in the "legacy" system test, in order
to significantly reduce its run time (on a contemporary machine, from
about 1m45s to 0m40s).

(cherry picked from commit 47b850348c)
2019-05-29 11:11:49 +02:00
Michał Kępień
2cd5954745 Make "plain" server setup checks more similar
Send a test TCP query to the "plain" server during its setup check to
improve its consistency with the setup check for the "plain + no TCP"
server.

(cherry picked from commit bb939a03ff)
2019-05-29 11:11:46 +02:00
Michał Kępień
45d2833684 Add more EDNS checks for dig output files
In the "legacy" system test, in order to make server setup checks more
consistent with each other, add further checks for either presence or
absence of the EDNS OPT pseudo-RR in the responses returned by the
tested named instances.

(cherry picked from commit 56ed1275c6)
2019-05-29 11:11:43 +02:00
Michał Kępień
c7f5ba42f8 Do not ignore dig exit codes
Make sure the "legacy" system test fails if any exit code returned by
dig does not match the expected one.

(cherry picked from commit 4dea5cb799)
2019-05-29 11:11:40 +02:00