Commit graph

8555 commits

Author SHA1 Message Date
Michał Kępień
ebedeffa25 Correctly invoke stop.pl when start.pl fails
MR !1141 broke the way stop.pl is invoked when start.pl fails:

  - start.pl changes the working directory to $testdir/$server before
    attempting to start $server,

  - commit 27ee629e6b causes the $testdir
    variable in stop.pl to be determined using the $SYSTEMTESTTOP
    environment variable, which is set to ".." by all tests.sh scripts,

  - commit e227815af5 makes start.pl pass
    $test (the test's name) rather than $testdir (the path to the test's
    directory) to stop.pl when a given server fails to start.

Thus, when a server is restarted from within a tests.sh script and such
a restart fails, stop.pl attempts to look for the server directory in a
nonexistent location ($testdir/$server/../$test, i.e. $testdir/$test,
instead of $testdir/../$test).  Fix the issue by changing the working
directory before stop.pl is invoked in the scenario described above.

(cherry picked from commit 4afad2a047)
2019-03-19 10:28:59 +01:00
Matthijs Mekking
1461accf9c Add test for rpz zone load fail 2019-03-15 09:16:49 +01:00
Matthijs Mekking
97118d59ba Make RPZ tests more readable 2019-03-15 08:32:03 +01:00
Matthijs Mekking
a8f20871c4 Add README to RPZ tests 2019-03-15 08:32:03 +01:00
Mark Andrews
3756a08d30 check that state and state->log are non NULL before calling state->log
(cherry picked from commit 7bf6750330)
2019-03-14 12:57:21 -07:00
Mark Andrews
9c2f4af5a1 pkcs11-kegen build failed if ECDSA was not supported 2019-03-14 13:15:21 +11:00
Michał Kępień
42a210b7cf Silence a Perl warning output by stop.pl
On Unix systems, the CYGWIN environment variable is not set at all when
BIND system tests are run.  If a named instance crashes on shutdown or
otherwise fails to clean up its pidfile and the CYGWIN environment
variable is not set, stop.pl will print an uninitialized value warning
on standard error.  Prevent this by using defined().

(cherry picked from commit 91e5a99b9b)
2019-03-12 08:43:13 +01:00
Petr Menšík
1f32ad6064 Allow ifconfig to be called from any directory
ifconfig.sh depends on config.guess for platform guessing. It uses it to
choose between ifconfig or ip tools to configure interfaces. If
system-wide automake script is installed and local was not found, use
platform guess. It should work well on mostly any sane platform. Still
prefers local guess, but passes when if cannot find it.

(cherry picked from commit 38301052e1)
2019-03-12 14:11:03 +11:00
Mark Andrews
93ee793d97 use client->query.qname
(cherry picked from commit 8758d36a5e)
2019-03-11 11:27:45 -07:00
Michał Kępień
170cb442a9 Stabilize the "gost" system test
In the "gost" system test, the ./NS RRset returned in the response to
ns2's priming query might not yet be validated when ns2 assembles the
response to the ./SOA query.  If that happens, the ./NS RRset will not
be placed in the AUTHORITY section of the response to the ./SOA query,
triggering a false positive for the "gost" system test as the ./NS RRset
is always present in the response sent by ns1 (since it is authoritative
for the root zone).  As the purpose of the "gost" system test is to
check whether a zone signed using GOST is properly validated and only
positive responses are inspected, use the +noauth dig option for all
queries in that test, so that the contents of the AUTHORITY section do
not influence its outcome.
2019-03-11 13:32:02 +01:00
Michał Kępień
780e1134e7 Stabilize "delzsk.example" zone checks
When a zone is converted from NSEC to NSEC3, the private record at zone
apex indicating that NSEC3 chain creation is in progress may be removed
during a different (later) zone_nsec3chain() call than the one which
adds the NSEC3PARAM record.  The "delzsk.example" zone check only waits
for the NSEC3PARAM record to start appearing in dig output while private
records at zone apex directly affect "rndc signing -list" output.  This
may trigger false positives for the "autosign" system test as the output
of the "rndc signing -list" command used for checking ZSK deletion
progress may contain extra lines which are not accounted for.  Ensure
the private record is removed from zone apex before triggering ZSK
deletion in the aforementioned check.

Also future-proof the ZSK deletion progress check by making it only look
at lines it should care about.

(cherry picked from commit e02de04e97)
2019-03-11 13:03:23 +01:00
Mark Andrews
e6718cf4c4 ${ttl} must exist and be non null
(cherry picked from commit dee1f1a498)
2019-03-11 12:25:19 +01:00
Michał Kępień
7656e7431b Make ANSWER TTL capping checks stricter
For checks querying a named instance with "dnssec-accept-expired yes;"
set, authoritative responses have a TTL of 300 seconds.  Assuming empty
resolver cache, TTLs of RRsets in the ANSWER section of the first
response to a given query will always match their authoritative
counterparts.  Also note that for a DNSSEC-validating named resolver,
validated RRsets replace any existing non-validated RRsets with the same
owner name and type, e.g. cached from responses received while resolving
CD=1 queries.  Since TTL capping happens before a validated RRset is
inserted into the cache and RRSIG expiry time does not impose an upper
TTL bound when "dnssec-accept-expired yes;" is set and, as pointed out
above, the original TTLs of the relevant RRsets equal 300 seconds, the
RRsets in the ANSWER section of the responses to expiring.example/SOA
and expired.example/SOA queries sent with CD=0 should always be exactly
120 seconds, never a lower value.  Make the relevant TTL checks stricter
to reflect that.

(cherry picked from commit a85cc41486)
2019-03-11 12:23:27 +01:00
Michał Kępień
bacbe3a5aa Relax ADDITIONAL TTL capping checks
Always expecting a TTL of exactly 300 seconds for RRsets found in the
ADDITIONAL section of responses received for CD=1 queries sent during
TTL capping checks is too strict since these responses will contain
records cached from multiple DNS messages received during the resolution
process.

In responses to queries sent with CD=1, ns.expiring.example/A in the
ADDITIONAL section will come from a delegation returned by ns2 while the
ANSWER section will come from an authoritative answer returned by ns3.
If the queries to ns2 and ns3 happen at different Unix timestamps,
RRsets cached from the older response will have a different TTL by the
time they are returned to dig, triggering a false positive.

Allow a safety margin of 60 seconds for checks inspecting the ADDITIONAL
section of responses to queries sent with CD=1 to fix the issue.  A
safety margin this large is likely overkill, but it is used nevertheless
for consistency with similar safety margins used in other TTL capping
checks.

(cherry picked from commit 8baf859063)
2019-03-11 12:22:23 +01:00
Michał Kępień
38da4bdf5e Fix NTA-related races
Changes introduced by commit 6b8e4d6e69
were incomplete as not all time-sensitive checks were updated to match
revised "nta-lifetime" and "nta-recheck" values.  Prevent rare false
positives by updating all NTA-related checks so that they work reliably
with "nta-lifetime 12s;" and "nta-recheck 9s;".  Update comments as well
to prevent confusion.

(cherry picked from commit 9a36a1bba3)
2019-03-11 12:17:36 +01:00
Michał Kępień
e82ef27449 Fix regex used for mangling druz/DNSKEY
During "dlv" system test setup, the "sed" regex used for mangling the
DNSKEY RRset for the "druz" zone does not include the plus sign ("+"),
which may:

  - cause the replacement to happen near the end of DNSKEY RDATA, which
    can cause the latter to become an invalid Base64 string,

  - prevent the replacement from being performed altogether.

Both cases prevent the "dlv" system test from behaving as intended and
may trigger false positives.  Add the missing character to the
aforementioned regex to ensure the replacement is always performed on
bytes 10-25 of DNSKEY RDATA.

(cherry picked from commit fd13fef299)
2019-03-08 13:49:02 +01:00
Tony Finch
660c9af77b cleanup: use dns_secalg_t and dns_dsdigest_t where appropriate
Use them in structs for various rdata types where they are missing.
This doesn't change the structs since we are replacing explicit
uint8_t field types with aliases for uint8_t.

Use dns_dsdigest_t in library function arguments.

(cherry picked from commit 0f219714e1)
2019-03-08 22:25:27 +11:00
Curtis Blackburn
4aa9ecf914 the wrong variable was used to count the test cases in one place.
(cherry picked from commit 4f60a84e34)
2019-03-07 18:42:54 -08:00
Mark Andrews
6f48cea0a6 explicitly convert byte to string
(cherry picked from commit ec3d830bc5)
2019-03-06 21:15:10 -08:00
Tony Finch
0f8351b282 cleanup dnssec-keygen manual page
Alphabetize options and synopsis; remove spurious -z from synopsis;
refer to -T KEY in options that are only relevant to pre-RFC3755
DNSSEC, and add a -f KSK example.

(cherry picked from commit 1954f8d2bf)
2019-03-06 17:34:26 -08:00
Mark Andrews
6f331e068e remove dependancy on libxml
(cherry picked from commit a9c47414b3)
2019-03-07 10:57:42 +11:00
Michał Kępień
ca24253980 Make nsupdate use OS-supplied ephemeral port range
Make nsupdate honor the operating system's preferred ephemeral port
range instead of always using the default 1024-65535 range for outgoing
messages.

(cherry picked from commit 06f582f23e)
2019-03-06 14:03:09 +01:00
Michał Kępień
44e1e371e3 Disable SERVFAIL cache for ns5 in the "mkeys" system test
The "check key refreshes are resumed after root servers become
available" check may trigger a false positive for the "mkeys" system
test if the second example/TXT query sent by dig is received by ns5 less
than a second after it receives a REFUSED response to the upstream query
it sends to ns1 in order to resolve the first example/TXT query sent by
dig.  Since that REFUSED response from ns1 causes ns5 to return a
SERVFAIL answer to dig, example/TXT is added to the SERVFAIL cache,
which is enabled by default with a TTL of 1 second.  This in turn may
cause ns5 to return a cached SERVFAIL response to the second example/TXT
query sent by dig, i.e. make ns5 not perform full query processing as
expected by the check.

Since the primary purpose of the check in question is to ensure that key
refreshes are resumed once initially unavailable root servers become
available, the optimal solution appears to be disabling SERVFAIL cache
for ns5 as doing that still allows the check to fulfill its purpose and
it is arguably more prudent than always sleeping for 1 second.

(cherry picked from commit 7c6bff3c4e)
2019-03-05 13:25:40 -08:00
Matthijs Mekking
9227ed8665 Ensure all system tests run clean.sh from setup.sh
For consistency between all system tests, add missing setup.sh scripts
for tests which do not have one yet and ensure every setup.sh script
calls its respective clean.sh script.

(cherry picked from commit e410803919)
2019-03-05 11:44:35 +01:00
Matthijs Mekking
321e87fbb7 Only perform test cleanups in clean.sh scripts
Temporary files created by a given system test should be removed by its
clean.sh script, not its setup.sh script.  Remove redundant "rm"
invocations from setup.sh scripts.  Move required "rm" invocations from
setup.sh scripts to their corresponding clean.sh scripts.

(cherry picked from commit c64ed484c8)
2019-03-05 11:38:54 +01:00
Petr Menšík
1e5c61d5cc Support DLZ filesystem detection in feature-test
Do not use variable from configure to detect the feature.

(cherry picked from commit 759a7b4ce3)
2019-03-04 14:10:16 +11:00
Michał Kępień
17a82643fe Fix IP regex used in the "resolver" system test
If dots are not escaped in the "1.2.3.4" regular expressions used for
checking whether IP address 1.2.3.4 is present in the tested resolver's
answers, a COOKIE that matches such a regular expression will trigger a
false positive for the "resolver" system test.  Properly escape dots in
the aforementioned regular expressions to prevent that from happening.

(cherry picked from commit 70ae48e5cb)
2019-03-01 07:54:10 +01:00
Michał Kępień
beeaefb401 Call clean.sh from all relevant setup.sh scripts
For all system tests utilizing named instances, call clean.sh from each
test's setup.sh script in a consistent way to make sure running the same
system test multiple times using run.sh does not trigger false positives
caused by stale files created by previous runs.

Ideally we would just call clean.sh from run.sh, but that would break
some quirky system tests like "rpz" or "rpzrecurse" and being consistent
for the time being does not hurt.

(cherry picked from commit a077a3ae8a)
2019-02-28 12:51:36 +01:00
Tinderbox User
639695b37d prep 9.11.6 2019-02-27 23:27:22 +00:00
Evan Hunt
946ca23f51 fixed an error in the mkeys system test 2019-02-20 19:54:41 -08:00
Tinderbox User
4738d62e1c doc rebuild 2019-02-20 19:54:40 -08:00
Mark Andrews
34348d9ee4 denied axfr requests were not effective for writable DLZ zones
(cherry picked from commit d9077cd0038e59726e1956de18b4b7872038a283)
2019-02-20 19:54:22 -08:00
Mark Andrews
2bda5ac2e1 check that multiple KEY-TAG trust-anchor-telemetry options don't leak memory
(cherry picked from commit 4b1dc4a5445e9561f2208f9388cf9f9e2cfcbe51)
(cherry picked from commit f545e9dff1f0eadcdea5531ef7062324d232c716)
2019-02-20 19:54:22 -08:00
Mark Andrews
d5243a5231 silently ignore additional keytag options
(cherry picked from commit 36158e6c96e982768bd33d4090cbe563718534f2)
(cherry picked from commit ccca4986b3a14188becb173c4473d9eac1587f66)
2019-02-20 19:54:21 -08:00
Evan Hunt
de8b2d4a6a use algorithm 255 for both unsupported keys 2019-02-20 19:54:21 -08:00
Matthijs Mekking
8c2a8ca509 Add tests for mkeys with unsupported algorithm
These tests check if a key with an unsupported algorithm in
managed-keys is ignored and when seeing an algorithm rollover to
an unsupported algorithm, the new key will be ignored too.

(cherry picked from commit 144cb53d0ae3aa5e6e3123720b603f9ab2bd1fa9)
2019-02-20 19:54:20 -08:00
Evan Hunt
1702187676 fix broken masterformat test
- dig command had the @ parameter in the wrong place
- private-dnskey and private-cdnskey are queried in a separate
  loop, which strips 'private-' from the name to determine the qtype

(cherry picked from commit bc7b34d6ef)
2019-02-20 22:30:09 -05:00
Mark Andrews
2019d4d64c silence clang
(cherry picked from commit 7b60f6832e)
2019-02-19 10:25:59 +11:00
Mark Andrews
20c29a251a don't overwrite result
(cherry picked from commit 70fab477b1)
2019-02-19 10:25:13 +11:00
Tony Finch
33cdef544d Improve dnssec-keymgr manual
Illustrate the syntax for the policy options, with semicolons.

Explicitly mention the "default" policy.

Fix a few typos and remove some redundant wording.

(cherry picked from commit 7ee56e2abd)
2019-02-18 15:46:24 +11:00
Petr Menšík
e7e85d37b6 Correct path in dnssec-checkds help
(cherry picked from commit 7bd544e795)
2019-02-14 12:53:50 -08:00
Curtis Blackburn
4fd2677873 added prereq.sh to forward test to detect perl Net::DNS
(cherry picked from commit 8c929bd7c5)
2019-02-08 14:37:09 +01:00
Mark Andrews
495d4153ad fix AMTRELAY name
(cherry picked from commit a9fadafecd)
2019-02-08 14:10:37 +11:00
Evan Hunt
d3a962db1e adjust style, match test to other tests
(cherry picked from commit 9949163936)
2019-02-07 18:29:14 -08:00
Tony Finch
5a090dd203 dnssec-coverage: fix handling of zones without trailing dots
After change 5143, zones listed on the command line without trailing
dots were ignored.

(cherry picked from commit a159675f44)
2019-02-07 17:33:30 -08:00
Evan Hunt
37ad2d4de3 Add support for ZONEMD
(cherry picked from commit 3183663dd4)
2019-02-08 08:33:09 +11:00
Mark Andrews
060dd0a372 Add support for ATMRELAY
(cherry picked from commit 66922ee7af)
2019-02-08 08:33:08 +11:00
Mark Andrews
9e89c1f898 error out if there are extra command line options
(cherry picked from commit f73816ff0f)
2019-02-07 23:46:13 +11:00
Ondřej Surý
0ca3e23b38 Simplify the inline clean script
(cherry picked from commit 519152b191)
2019-02-06 17:53:02 +11:00
Mark Andrews
5ebf7adae6 clean K* files in inline system test directory
(cherry picked from commit 1878efe661)
2019-02-06 17:38:00 +11:00