Commit graph

2937 commits

Author SHA1 Message Date
Michał Kępień
c787a539d2 Make stop.pl wait for lock file cleanup
bin/tests/system/stop.pl only waits for the PID file to be cleaned up
while named cleans up the lock file after the PID file.  Thus, the
aforementioned script may consider a named instance to be fully shut
down when in fact it is not.

Fix by also checking whether the lock file exists when determining a
given instance's shutdown status.  This change assumes that if a named
instance uses a lock file, it is called "named.lock".

Also rename clean_pid_file() to pid_file_exists(), so that it is called
more appropriately (it does not clean up the PID file itself, it only
returns the server's identifier if its PID file is not yet cleaned up).
2019-03-19 10:26:36 +01:00
Michał Kępień
4afad2a047 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.
2019-03-19 10:26:36 +01:00
Evan Hunt
885a3d208e remove "dnssec-enable" from all system tests 2019-03-14 23:30:13 -07:00
Joey Salazar
6acc306b10 Test named logs cmd line as expected
Test named logs control characters, special characters and large cmd line respectively as octal escaped, special escaped and elipsis
2019-03-14 14:43:45 -07:00
Mark Andrews
7bf6750330 check that state and state->log are non NULL before calling state->log 2019-03-14 15:28:58 -04:00
Michał Kępień
91e5a99b9b 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().
2019-03-12 08:42:48 +01:00
Petr Menšík
38301052e1 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.
2019-03-11 22:19:49 -04:00
Michał Kępień
e02de04e97 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.
2019-03-11 13:02:54 +01:00
Mark Andrews
dee1f1a498 ${ttl} must exist and be non null 2019-03-11 12:04:44 +01:00
Michał Kępień
a85cc41486 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.
2019-03-11 12:04:42 +01:00
Michał Kępień
8baf859063 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.
2019-03-11 12:04:42 +01:00
Michał Kępień
a597bd52a6 Fix message section checked in a TTL capping test
Commit c032c54dda inadvertently changed
the DNS message section inspected by one of the TTL capping checks from
ADDITIONAL to ANSWER, introducing a discrepancy between that check's
description and its actual meaning.  Revert to inspecting the ADDITIONAL
section in the aforementioned check.
2019-03-11 12:04:42 +01:00
Michał Kępień
9a36a1bba3 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.
2019-03-11 12:04:42 +01:00
Evan Hunt
e2062879c1 test the use of the view ACL in DLZ 2019-03-11 14:27:13 +11:00
Ondřej Surý
a04a390195 Convert *.vcxproj.user to CRLF line endings 2019-03-08 18:01:48 +01:00
Ondřej Surý
c2637c8429 Use ForcedIncludeFiles directive to include config.h everywhere automatically 2019-03-08 17:14:38 +01:00
Ondřej Surý
78d0cb0a7d Use coccinelle to remove explicit '#include <config.h>' from the source files 2019-03-08 15:15:05 +01:00
Michał Kępień
fd13fef299 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.
2019-03-08 13:47:13 +01:00
Curtis Blackburn
4f60a84e34 the wrong variable was used to count the test cases in one place. 2019-03-07 20:15:14 -05:00
Evan Hunt
aeed047495 disable a previously broken test under dnsrps 2019-03-06 20:48:30 -08:00
Mark Andrews
d1fa8be611 add the ability to control whether SOA records are added response-policy modified answers 2019-03-06 20:47:28 -08:00
Mark Andrews
a9c47414b3 remove dependancy on libxml 2019-03-07 10:09:33 +11:00
Michał Kępień
7c6bff3c4e 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.
2019-03-05 11:48:26 -08:00
Matthijs Mekking
e410803919 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.
2019-03-04 16:26:06 +01:00
Matthijs Mekking
c64ed484c8 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.
2019-03-04 16:26:06 +01:00
Petr Menšík
759a7b4ce3 Support DLZ filesystem detection in feature-test
Do not use variable from configure to detect the feature.
2019-03-01 17:41:06 +01:00
Michał Kępień
70ae48e5cb 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.
2019-03-01 01:32:54 -05:00
Evan Hunt
c6939f0bd4 test correct occlusion of DNSSEC records 2019-02-28 15:00:38 -08:00
Michał Kępień
6602848460 Do not include conf.sh from ttl/clean.sh
Including $SYSTEMTESTTOP/conf.sh from a system test's clean.sh script is
not needed for anything while it causes an error message to be printed
out when "./configure" is run, as "make clean" is invoked at the end.
Remove the offending line to prevent the error from occurring.
2019-02-28 13:17:01 +01:00
Michał Kępień
a077a3ae8a 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.
2019-02-28 12:34:10 +01:00
Matthijs Mekking
84700f9783 Update copyrights 2019-02-22 13:59:10 +01:00
Matthijs Mekking
ce5476acf0 Add test for rpz zone load fail 2019-02-22 13:59:10 +01:00
Matthijs Mekking
8d392f9093 Make RPZ tests more readable 2019-02-22 13:59:10 +01:00
Matthijs Mekking
9ecdb292c4 Add README to RPZ tests 2019-02-22 13:59:10 +01:00
Mark Andrews
a9307de85e denied axfr requests were not effective for writable DLZ zones 2019-02-20 19:44:38 -08:00
Evan Hunt
747035dcc5 fix test error 2019-02-20 19:44:37 -08:00
Mark Andrews
fe4810f1f8 check that multiple KEY-TAG trust-anchor-telemetry options don't leak memory 2019-02-20 19:44:36 -08:00
Evan Hunt
3022633d79 use algorithm 255 for both unsupported keys 2019-02-20 19:44:34 -08:00
Matthijs Mekking
38c2bdba0a 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.
2019-02-20 19:44:33 -08:00
Michał Kępień
72c201733c Do not check SEP bit for mirror zone trust anchors
When a mirror zone is verified, the 'ignore_kskflag' argument passed to
dns_zoneverify_dnssec() is set to false.  This means that in order for
its verification to succeed, a mirror zone needs to have at least one
key with the SEP bit set configured as a trust anchor.  This brings no
security benefit and prevents zones signed only using keys without the
SEP bit set from being mirrored, so change the value of the
'ignore_kskflag' argument passed to dns_zoneverify_dnssec() to true.
2019-02-14 11:03:35 +01:00
Michał Kępień
9c611dd999 Prevent races when waiting for log messages
The "mirror" system test checks whether log messages announcing a mirror
zone coming into effect are emitted properly.  However, the helper
functions responsible for waiting for zone transfers and zone loading to
complete do not wait for these exact log messages, but rather for other
ones preceding them, which introduces a possibility of false positives.

This problem cannot be addressed by just changing the log message to
look for because the test still needs to discern between transferring a
zone and loading a zone.

Add two new log messages at debug level 99 (which is what named
instances used in system tests are configured with) that are to be
emitted after the log messages announcing a mirror zone coming into
effect.  Tweak the aforementioned helper functions to only return once
the log messages they originally looked for are followed by the newly
added log messages.  This reliably prevents races when looking for
"mirror zone is now in use" log messages and also enables a workaround
previously put into place in the "mirror" system test to be reverted.
2019-02-14 10:41:56 +01:00
Michał Kępień
2cbf1028e9 Improve reliability of zone verification checks
In the "mirror" system test, ns3 periodically sends trust anchor
telemetry queries to ns1 and ns2.  It may thus happen that for some
non-recursive queries for names inside mirror zones which are not yet
loaded, ns3 will be able to synthesize a negative answer from the cached
records it obtained from trust anchor telemetry responses.  In such
cases, NXDOMAIN responses will be sent with the root zone SOA in the
AUTHORITY section.  Since the root zone used in the "mirror" system test
has the same serial number as ns2/verify.db.in and zone verification
checks look for the specified serial numbers anywhere in the answer, the
test could be broken if different zone names were used.

The +noauth dig option could be used to address this weakness, but that
would prevent entire responses from being stored for later inspection,
which in turn would hamper troubleshooting test failures.  Instead, use
a different serial number for ns2/verify.db.in than for any other zone
used in the "mirror" system test and check the number of records in the
ANSWER section of each response.
2019-02-14 10:41:56 +01:00
Michał Kępień
46480a4b47 Fix serial number used in zone verification checks
Due to the way the "mirror" system test is set up, it is impossible for
the "verify-unsigned" and "verify-untrusted" zones to contain any serial
number other than the original one present in ns2/verify.db.in.  Thus,
using presence of a different serial number in the SOA records of these
zones as an indicator of problems with mirror zone verification is
wrong.  Look for the original zone serial number instead as that is the
one that will be returned by ns3 if one of the aforementioned zones is
successfully verified.
2019-02-14 10:41:56 +01:00
Curtis Blackburn
8c929bd7c5 added prereq.sh to forward test to detect perl Net::DNS 2019-02-08 14:07:00 +01:00
Mark Andrews
a9fadafecd fix AMTRELAY name 2019-02-08 13:54:13 +11:00
Evan Hunt
9949163936 adjust style, match test to other tests 2019-02-07 16:53:46 -08:00
Tony Finch
a159675f44 dnssec-coverage: fix handling of zones without trailing dots
After change 5143, zones listed on the command line without trailing
dots were ignored.
2019-02-07 16:43:21 -08:00
Evan Hunt
3183663dd4 Add support for ZONEMD 2019-02-07 12:34:14 -08:00
Mark Andrews
66922ee7af Add support for ATMRELAY 2019-02-07 10:28:19 -08:00
Ondřej Surý
519152b191 Simplify the inline clean script 2019-02-06 00:57:35 -05:00
Mark Andrews
1878efe661 clean K* files in inline system test directory 2019-02-06 00:57:35 -05:00
Mark Andrews
275c355fba supported no longer exists so just do the default behaviour 2019-02-06 16:18:24 +11:00
Mark Andrews
0207199bb8 send over and undersized cookie 2019-02-06 12:34:42 +11:00
Evan Hunt
449842e1ce disable the check for crash on shutdown when running under cygwin 2019-01-31 21:35:08 -08:00
Michał Kępień
a9a47c79e9 Add system tests for IXFR statistics
Ensure IXFR statistics are calculated correctly by dig and named, both
for incoming and outgoing transfers.  Disable EDNS when using dig to
request an IXFR so that the same reference file can be used for testing
statistics calculated by both dig and named (dig uses EDNS by default
when sending transfer requests, which affects the number of bytes
transferred).
2019-01-31 16:55:01 -05:00
Michał Kępień
a22e24a411 Add system tests for AXFR statistics
Ensure AXFR statistics are calculated correctly by dig and named, both
for incoming and outgoing transfers.  Rather than employing a zone which
is already used in the "xfer" system test, create a new one whose AXFR
form spans multiple TCP messages.  Disable EDNS when using dig to
request an AXFR so that the same reference file can be used for testing
statistics calculated by both dig and named (dig uses EDNS by default
when sending transfer requests, which affects the number of bytes
transferred).
2019-01-31 16:55:01 -05:00
Michał Kępień
6071c6cc27 Add functions for extracting transfer statistics
Add two helper shell functions to facilitate extracting transfer
statistics from dig output and named log files.
2019-01-31 16:55:01 -05:00
Evan Hunt
6661db9564 silence a spurious dnssec-keygen warning in the dnssec system test
the occluded-key test creates both a KEY and a DNSKEY. the second
call to dnssec-keygen calls dns_dnssec_findmatchingkeys(), which causes
a spurious warning to be printed when it sees the type KEY record.
this should be fixed in dnssec.c, but the meantime this change silences
the warning by reversing the order in which the keys are created.
2019-01-31 13:23:11 -08:00
Evan Hunt
5c1c285370 test logging of key maintenance events 2019-01-31 12:18:55 -08:00
Evan Hunt
9bf37f4e48 detect crash on shutdown in stop.pl 2019-01-31 12:16:53 -05:00
Evan Hunt
ff3dace139 Ancient named.conf options are now a fatal configuration error
- options that were flagged as obsolete or not implemented in 9.0.0
  are now flagged as "ancient", and are a fatal error
- the ARM has been updated to remove these, along with other
  obsolete descriptions of BIND 8 behavior
- the log message for obsolete options explicitly recommends removal
2019-01-31 11:54:26 +01:00
Matthijs Mekking
a2d115cbfc Add tests for dumpdb stale ttl
This adds a test for rndc dumpdb to ensure the correct "stale
comment" is printed.  It also adds a test for non-stale data to
ensure no "stale comment" is printed for active RRsets.

In addition, the serve-stale tests are hardened with more accurate
grep calls.
2019-01-31 09:35:49 +01:00
Matthijs Mekking
1cc25ff5e0 Better signed TKEY response verification 2019-01-30 11:46:11 -08:00
Matthijs Mekking
935af4a795 No longer need +question 2019-01-30 11:46:11 -08:00
Evan Hunt
0010f73cde suggested alternate test for TSIG signature
feel free to remove this commit if you prefer the other method.
2019-01-30 11:46:11 -08:00
Evan Hunt
4754fa2ded "grep -q" isn't portable 2019-01-30 11:46:11 -08:00
Matthijs Mekking
29323a39bf Weak verification for signed TKEY response
The introduced grep call checks whether there was a
response that has an answer and an additional record.
There should be only one in the nsupdate output that is
for the TKEY response.
2019-01-30 11:46:11 -08:00
Matthijs Mekking
9fcad11e34 Weak verification for signed TKEY response
The introduced grep call checks whether there was a
response that has an answer and an additional record.
There should be only one in the nsupdate output that is
for the TKEY response.
2019-01-30 11:45:30 -08:00
Matthijs Mekking
cbe51ba325 Harden GSS-TSIG tests 2019-01-30 11:45:30 -08:00
Mark Andrews
36ea9b8181 only use a single policy file when testing. 2019-01-30 15:00:14 +11:00
Evan Hunt
dd45831acc also add -D options for transient named processes started in tests.sh 2019-01-28 19:58:24 -08:00
Evan Hunt
175d6e9bfb add properly-formatted -D options to named.args files
this prevents servers that use arguments specified in named.args
from appearing different in 'ps' output from servers run with arguments
from start.pl
2019-01-28 19:58:24 -08:00
Evan Hunt
70f36a25e4 reset SYSTEMTESTTOP when changing directories 2019-01-28 19:57:19 -08:00
Evan Hunt
7cc9fdc7fb fix rrl test
strip CR characters before using awk/sed
2019-01-25 00:44:11 -08:00
Evan Hunt
8cd39fae80 fix rpz test
- work around a CR newline problem
- use rndc to stop servers
2019-01-25 00:44:11 -08:00
Evan Hunt
f7471494ed fix rpzrecurse test
use rndc to stop servers
2019-01-25 00:44:11 -08:00
Evan Hunt
8778f484b3 fix dnssec test
- work around CR issues
- use UTC for time comparisons
- use $DIFF instead of cmp
2019-01-25 00:44:11 -08:00
Evan Hunt
8acc3434a7 fix legacy test
use rndc rather than signals to stop the server
2019-01-25 00:44:11 -08:00
Evan Hunt
fef19fb978 fix fetchlimit test
use TCP for the test queries in between UDP bursts; this avoids
congestion issues that interfered with the test on windows
2019-01-25 00:44:11 -08:00
Evan Hunt
5656e97ddf fix nsupdate test
rndc_reload was failing on windows
2019-01-25 00:44:11 -08:00
Evan Hunt
7942bc93e2 fix sfcache test
use a lame server configuration to force SERVFAILs instead of killing ns2.
this prevents test failures that occurred due to a different behavior of
the netowrking stack in windows.
2019-01-25 00:44:11 -08:00
Evan Hunt
a77b6a8abc fix rndc test
use regex instead of exact string matching to deal with CR at end of line
2019-01-25 00:44:11 -08:00
Evan Hunt
1150a008b2 fix statistics test
the active sockets test is supposed to be commented out on win32, but
only part of it was
2019-01-25 00:44:11 -08:00
Evan Hunt
37b0af81d2 fix redirect test
strip CR characters before using sed
2019-01-25 00:44:11 -08:00
Evan Hunt
6881f919e7 fix notify test
test the average delay between notifies instead of the minimum delay;
this helps avoid unnecessary test failures on systems with bursty
network performance.
2019-01-25 00:44:11 -08:00
Evan Hunt
10aba2cbbb fix masterformat test
use stop.pl instead of rndc to stop server
2019-01-25 00:44:11 -08:00
Evan Hunt
2ae3c97599 fix inline test
use regex instead of exact string matching, to deal with CR at end of ine
2019-01-25 00:44:11 -08:00
Evan Hunt
8b0d5a98bb fix forward test
strip CR characters before using sed
2019-01-25 00:44:11 -08:00
Evan Hunt
673cd0beeb fix cookie test
strip CR characters before comparing files
2019-01-25 00:44:11 -08:00
Evan Hunt
097cbec3c4 fix cds test
- use $PERL instead of perl
- use $DIFF instead of cmp for windows portability; cmp doesn't
  handle CR characters properly
2019-01-25 00:44:11 -08:00
Evan Hunt
e6f2c2f51f fix addzone test
typographical error prevented reconfiguration
2019-01-25 00:44:11 -08:00
Evan Hunt
def7574b1e use $DIFF instead of diff 2019-01-25 00:44:11 -08:00
Evan Hunt
d3d106b82c remove logfileconfig from test list
this test doesn't work on windows
2019-01-25 00:44:11 -08:00
Evan Hunt
c02dad7991 set and use SYSTEMTESTTOP consistently 2019-01-25 00:44:11 -08:00
Evan Hunt
1bc0ab5217 complete the set of tools available in windows tests
- dnssec-cds wasn't being built for windows
- nsec3hash was available, but the NSEC3HASH variable wasn't
  set in conf.sh.win32
2019-01-25 00:44:11 -08:00
Evan Hunt
086f770b38 more reliable method for killing "ans" servers on windows
as perl and python are both native to cygwin, we don't want to use
the "kill -f" option to terminate them.
2019-01-25 00:44:11 -08:00
Evan Hunt
3012803a22 update ifconfig.bat with current test interfaces
the addresses set up in ifconfig.bat were out of sync with the
ones in ifconfig.sh
2019-01-25 00:44:11 -08:00
Evan Hunt
d1fc4601ce update conf.sh.win32 test list
- the test lists in conf.sh.in and conf.sh.win32 were out of sync
2019-01-25 00:44:11 -08:00
Michał Kępień
0f168a4b37 dig: return a non-zero exit code for failed TCP EOF retries
dig retries a TCP query when a server closes the connection prematurely.
However, dig's exit code remains unaffected even if the second attempt
to get a response also fails with the same error for the same lookup,
which should not be the case.  Ensure the exit code is updated
appropriately when a retry triggered by a TCP EOF condition fails.
2019-01-24 23:05:43 -08:00
Evan Hunt
1ccf4e6c16 improve handling of trailing dots in dnssec-keymgr and dnssec-coverage
- mishandling of trailing dots caused bad behavior with the
  root zone or names like "example.com."
- fixing this exposed an error in dnssec-coverage caused the
  wrong return value if there were KSK errors but no ZSK errors
- incidentally silenced the dnssec-keygen output in the coverage
  system test
2019-01-24 12:33:42 -08:00
Evan Hunt
b9c9f2593a remove --disable-rpz-nsip and --disable-rpz-nsdname from configure 2019-01-24 11:32:44 -08:00
Mark Andrews
083b730ec7 introducing keymgr need to preserve functionality 2019-01-22 09:52:47 -08:00
Evan Hunt
bc7b34d6ef 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
2019-01-21 01:41:25 -05:00
Witold Kręcicki
b49310ac06 If possible don't use forwarders when priming the resolver.
If we try to fetch a record from cache and need to look into
hints database we assume that the resolver is not primed and
start dns_resolver_prime(). Priming query is supposed to return
NSes for "." in ANSWER section and glue records for them in
ADDITIONAL section, so that we can fill that info in 'regular'
cache and not use hints db anymore.
However, if we're using a forwarder the priming query goes through
it, and if it's configured to return minimal answers we won't get
the addresses of root servers in ADDITIONAL section. Since the
only records for root servers we have are in hints database we'll
try to prime the resolver with every single query.

This patch adds a DNS_FETCHOPT_NOFORWARD flag which avoids using
forwarders if possible (that is if we have forward-first policy).
Using this flag on priming fetch fixes the problem as we get the
proper glue. With forward-only policy the problem is non-existent,
as we'll never ask for root server addresses because we'll never
have a need to query them.

Also added a test to confirm priming queries are not forwarded.
2019-01-16 17:41:13 -05:00
Michał Kępień
7d6b8f7c12 Log a message when a mirror zone becomes unusable
Log a message if a mirror zone becomes unusable for the resolver (most
usually due to the zone's expiration timer firing).  Ensure that
verification failures do not cause a mirror zone to be unloaded
(instead, its last successfully verified version should be served if it
is available).
2019-01-16 10:38:12 -08:00
Michał Kępień
7665e13206 Log a message when a mirror zone loaded from disk comes into effect
Log a message when a mirror zone is successfully loaded from disk and
subsequently verified.

This could have been implemented in a simpler manner, e.g. by modifying
an earlier code branch inside zone_postload() which checks whether the
zone already has a database attached and calls attachdb() if it does
not, but that would cause the resulting logs to indicate that a mirror
zone comes into effect before the "loaded serial ..." message is logged,
which would be confusing.

Tweak some existing sed commands used in the "mirror" system test to
ensure that separate test cases comprising it do not break each other.
2019-01-16 10:34:15 -08:00
Michał Kępień
1c97ace7dc Log a message when a transferred mirror zone comes into effect
Log a message when a mirror zone is successfully transferred and
verified, but only if no database for that zone was yet loaded at the
time the transfer was initiated.

This could have been implemented in a simpler manner, e.g. by modifying
zone_replacedb(), but (due to the calling order of the functions
involved in finalizing a zone transfer) that would cause the resulting
logs to suggest that a mirror zone comes into effect before its transfer
is finished, which would be confusing given the nature of mirror zones
and the fact that no message is logged upon successful mirror zone
verification.

Once the dns_zone_replacedb() call in axfr_finalize() is made, it
becomes impossible to determine whether the transferred zone had a
database attached before the transfer was started.  Thus, that check is
instead performed when the transfer context is first created and the
result of this check is passed around in a field of the transfer context
structure.  If it turns out to be desired, the relevant log message is
then emitted just before the transfer context is freed.

Taking this approach means that the log message added by this commit is
not timed precisely, i.e. mirror zone data may be used before this
message is logged.  However, that can only be fixed by logging the
message inside zone_replacedb(), which causes arguably more dire issues
discussed above.

dns_zone_isloaded() is not used to double-check that transferred zone
data was correctly loaded since the 'shutdown_result' field of the zone
transfer context will not be set to ISC_R_SUCCESS unless axfr_finalize()
succeeds (and that in turn will not happen unless dns_zone_replacedb()
succeeds).
2019-01-16 10:33:02 -08:00
Evan Hunt
adcc16f2d7 error on allow-update and allow-update-forwarding at options/view level 2019-01-15 23:20:38 -08:00
Mark Andrews
7122b5786d add multi-view server and tests 2019-01-14 14:10:05 -08:00
Ondřej Surý
fd050b6baf b/t/s/dnssec/tests.sh: Cleanup showprivate() function 2019-01-14 11:49:55 +01:00
Evan Hunt
82e83d5dc7 fix testing errors
- the checkprivate function in the dnssec test set ret=0, erasing
  results from previous tests and making the test appear to have passed
  when it shouldn't have
- checkprivate needed a delay loop to ensure there was time for all
  private signing records to be updated before the test
2019-01-13 17:50:08 -08:00
Mark Andrews
5e8b772ad1 Ensure base64/base32/hex fields in DNS records that should be non-empty are. 2019-01-09 18:04:21 +11:00
Mark Andrews
8a8d378def wait longer for dump to complete 2019-01-08 23:04:22 -05:00
Michał Kępień
33350626f9 Track forwarder timeouts in fetch contexts
Since following a delegation resets most fetch context state, address
marks (FCTX_ADDRINFO_MARK) set inside lib/dns/resolver.c are not
preserved when a delegation is followed.  This is fine for full
recursive resolution but when named is configured with "forward first;"
and one of the specified forwarders times out, triggering a fallback to
full recursive resolution, that forwarder should no longer be consulted
at each delegation point subsequently reached within a given fetch
context.

Add a new badnstype_t enum value, badns_forwarder, and use it to mark a
forwarder as bad when it times out in a "forward first;" configuration.
Since the bad server list is not cleaned when a fetch context follows a
delegation, this prevents a forwarder from being queried again after
falling back to full recursive resolution.  Yet, as each fetch context
maintains its own list of bad servers, this change does not cause a
forwarder timeout to prevent that forwarder from being used by other
fetch contexts.
2019-01-08 08:29:54 +01:00
Mark Andrews
b75970efa3 named-checkconf triggered a assertion when a mirror zone had a bad name 2018-12-20 13:19:18 +11:00
Matthijs Mekking
17cdde1e56 Replace DSA with Reserved algorithm 2018-12-19 12:54:57 +01:00
Matthijs Mekking
6d976b37c1 Add dnssec-signzone tests with unsupported alg
dnssec-signzone should sign a zonefile that contains a DNSKEY record
with an unsupported algorithm.
2018-12-19 12:54:31 +01:00
Witold Kręcicki
6d50138405 Use rndc_reload in tests, make sure that reload is complete before continuing 2018-12-19 11:33:37 +01:00
Witold Kręcicki
fee890461b Get common stuff out of bin/tests/system/conf.sh.{in,win32} into conf.sh.common 2018-12-18 08:57:05 -05:00
Ondřej Surý
808dac0760 Properly detect msys/msys2 environment in the stop.pl script. 2018-12-18 14:27:56 +01:00
Ondřej Surý
7a721f983e Revert "Merge branch '782-cygwin-grep-CRLF-issue' into 'master'"
This reverts commit 4af9f97189, reversing
changes made to 0289f3f281.
2018-12-17 12:23:14 +01:00
Curtis Blackburn
2ec746dafe minor fixes to dns64 and rndc CRLF fix. rpzrecurse failure
will be addressed in a separate issue
2018-12-14 18:22:58 -08:00
Curtis Blackburn
9fc68285ef more CRLF fixes (dns64, rndc, rpzrecurse) 2018-12-14 18:22:58 -08:00
Curtis Blackburn
bdbf6ede3a missed one in the digdelv test 2018-12-14 18:22:58 -08:00
Curtis Blackburn
ba1b9ca4d4 digdelv test fixed for CRLF issue 2018-12-14 18:22:58 -08:00
Curtis Blackburn
18e8835044 windows CRLF issues fixed in builtin test 2018-12-14 18:22:58 -08:00
Mark Andrews
53a33f7365 pass the correct object to cfg_obj_log 2018-12-14 16:29:02 +11:00
Mark Andrews
7e4b82103b check that DNSKEY and other occluded data are excluded from the delegating bitmap 2018-12-14 12:48:55 +11:00
Mark Andrews
47a4e0eeaa check that the time between notify messages is not too small 2018-12-12 09:39:00 +11:00
Ondřej Surý
bc12c52e82 Run the digdelv tests with set -e enabled 2018-12-11 10:21:47 +01:00
Ondřej Surý
351efd8812 Update digdelv system test to not use static RSAMD5 key and make scripts shellcheck clean 2018-12-11 10:21:40 +01:00
Ondřej Surý
f5785f97fc Refactor synthfromdnssec system test to use $DEFAULT_ALGORITHM, be shellcheck clean and run under set -e 2018-12-11 09:44:08 +01:00
Ondřej Surý
e1bf5624fb Run the sfcache system tests with set -e enabled 2018-12-11 09:27:16 +01:00
Ondřej Surý
f566010717 sfcache system test: Remove RSAMD5 usage and make script shellcheck compliant 2018-12-11 09:27:16 +01:00
Ondřej Surý
7e07d05ae7 Replace RSAMD5 keys with keys using DEFAULT_ALGORITHM variable from conf.sh 2018-12-11 09:27:16 +01:00
Ondřej Surý
aeebcb4ae8 Run the dnssec system tests with set -e enabled 2018-12-10 19:47:32 +01:00
Ondřej Surý
ca7cadfa92 dnssec system test: Remove RSAMD5 usage and make script shellcheck compliant 2018-12-10 19:47:32 +01:00
Ondřej Surý
a160fecaa1 Replace RSAMD5 keys with keys using DEFAULT_ALGORITHM variable from conf.sh 2018-12-10 09:16:46 -08:00
Mark Andrews
3bca52ca07 allow a small about of time for the syncptr event to be processed 2018-12-10 16:59:27 +11:00
Michał Kępień
adbca54079 Check that DNAME is not treated as a delegation when signing 2018-12-09 23:12:41 -05:00
Mark Andrews
6b470bbf42 verify that auto-dnssec maintain generates and signs NSEC3 records with DNAME at the apex 2018-12-09 23:12:41 -05:00
Mark Andrews
06e218c421 verify that dnssec-signzone generates NSEC3 records with DNAME at the apex 2018-12-09 23:12:41 -05:00
Mark Andrews
9eec02a81f Properly detect bottom of zone when sign_a_node() is not called 2018-12-07 11:20:16 +11:00
Evan Hunt
fd20f10d52 name change from "hook modules" to "plugins"
- "hook" is now used only for hook points and hook actions
- the "hook" statement in named.conf is now "plugin"
- ns_module and ns_modlist are now ns_plugin and ns_plugins
- ns_module_load is renamed ns_plugin_register
- the mandatory functions in plugin modules (hook_register,
  hook_check, hook_version, hook_destroy) have been renamed
2018-12-06 10:36:50 -08:00
Evan Hunt
7a47e4d85f restore filter-aaaa syntax checking
- added functionality to check hook parameters in named-checkconf,
  and restored the checkconf tests that were removed from the
  filter-aaaa test.
2018-12-06 10:29:12 -08:00
Evan Hunt
427e9ca357 clear AD flag when altering response messages
- the AD flag was not being cleared correctly when filtering
- enabled dnssec valdiation in the filter-aaaa test to confirm this
  works correctly now
2018-12-06 10:29:11 -08:00
Evan Hunt
9911c835d3 add a parser to filter-aaaa.so and pass in the parameters
- make some cfg-parsing functions global so they can be run
  from filter-aaaa.so
- add filter-aaaa options to the hook module's parser
- mark filter-aaaa options in named.conf as obsolete, remove
  from named and checkconf, and update the filter-aaaa test not to
  use checkconf anymore
- remove filter-aaaa-related struct members from dns_view
2018-12-06 10:29:11 -08:00
Evan Hunt
d2f4644388 add hook statement to configuration parser
- allow multiple "hook" statements at global or view level
- add "optional bracketed text" type for optional parameter list
- load hook module from specified path rather than hardcoded path
- add a hooktable pointer (and a callback for freeing it) to the
  view structure
- change the hooktable functions so they no longer update ns__hook_table
  by default, and modify PROCESS_HOOK so it uses the view hooktable, if
  set, rather than ns__hook_table. (ns__hook_table is retained for
  use by unit tests.)
- update the filter-aaaa system test to load filter-aaaa.so
- add a prereq script to check for dlopen support before running
  the filter-aaaa system test

not yet done:
- configuration parameters are not being passed to the filter-aaaa
  module; the filter-aaaa ACL and filter-aaaa-on-{v4,v6} settings are
  still stored in dns_view
2018-12-06 10:29:11 -08:00
Evan Hunt
d43dcef139 refactor filter-aaaa implementation
- the goal of this change is for AAAA filtering to be fully contained
   in the query logic, and implemented at discrete points that can be
   replaced with hook callouts later on.
 - the new code may be slightly less efficient than the old filter-aaaa
   implementation, but maximum efficiency was never a priority for AAAA
   filtering anyway.
 - we now use the rdataset RENDERED attribute to indicate that an AAAA
   rdataset should not be included when rendering the message. (this
   flag was originally meant to indicate that an rdataset has already
   been rendered and should not be repeated, but it can also be used to
   prevent rendering in the first place.)
 - the DNS_MESSAGERENDER_FILTER_AAAA, NS_CLIENTATTR_FILTER_AAAA,
   and DNS_RDATASETGLUE_FILTERAAAA flags are all now unnecessary and
   have been removed.
2018-12-06 10:29:10 -08:00
Mark Andrews
6a5c8ec2ea add more error logging; add event processing logging 2018-12-05 18:23:30 -05:00
Ondřej Surý
00cc0b236a Add DNSKEY and CDNSKEY with unknown algorithm number (PRIVATEDNS) and \0 as content 2018-12-05 11:29:27 +01:00
Ondřej Surý
b13c7ca402 Refactor masterformat to be shellcheck clean and don't use RSAMD5 algorithm in the tests 2018-12-05 11:29:27 +01:00
Ondřej Surý
835bad2c5c Make the start.pl and stop.pl more Cygwin friendly 2018-12-04 15:02:22 +01:00
Ondřej Surý
88d3338f5f Replace realpath with cd&pwd shell magic 2018-12-03 20:40:59 +01:00
Witold Kręcicki
9532e3256e tcp test: sleep for 1 second before gathering stats to make
sure that the stats are there
2018-12-03 18:49:48 +00:00
Witold Kręcicki
a48ca15e77 Fetchlimit test: update softquota limit to 380.
In the test the quota is set to 400, and softquota to 90%*400=360.
We first attach to quota, and then if we're above softquota we
drop the oldest client. With new socket code and taskmgr it's
parallel enough to create a race between multiple instances doing
'attach to quota' and then 'drop oldest client' - making number
of clients go over softquota. It's not a problem in real life, as
it's just soft quota.
2018-12-03 18:49:48 +00:00
Ondřej Surý
e227815af5 Make calls to the stop.pl always use the test name instead of '.' 2018-12-03 16:24:09 +01:00
Ondřej Surý
27ee629e6b stop.pl - refactor 2018-12-03 16:24:09 +01:00
Ondřej Surý
16b95157e8 Make calls to the start.pl always use the test name instead of '.' 2018-12-03 15:50:21 +01:00
Brian Conry
0fc8bfef13 start.pl - refactor 2018-12-03 15:50:21 +01:00
Brian Conry
597049461d start.pl - wait for server to say 'running' 2018-12-03 15:23:36 +01:00
Ondřej Surý
253c175d7b Fix typos and missing ALTERNATIVE_ALGORITHM in conf.sh.win32 2018-12-03 09:29:33 +01:00
Ondřej Surý
b2c4c35493 Add ALTERNATIVE_ALGORITHM to conf.sh 2018-12-03 08:34:49 +01:00
Ondřej Surý
1b2a3a0ea6 Export SYSTEMTESTTOP from run.sh (so, it doesn't have to be defined in each script) and scrub / from the test names 2018-12-03 08:34:45 +01:00
Mark Andrews
6499bdfd8b use documented default key ttl 2018-11-29 07:50:02 +11:00
Mark Andrews
0ac2a868bb add reproducer for [GL #585] 2018-11-29 07:50:02 +11:00
Evan Hunt
dfa1589975 echo debug output (D:text) the same as informational (I:text) 2018-11-16 19:30:30 +00:00
Witold Kręcicki
d960210114 Fix fetchlimit test to allow softquota to be overruled; Remove 'verifying that named checks for conflicting listeners' test from runtime 2018-11-15 08:21:17 +00:00
Witold Kręcicki
9c8fead6d8 qname minimization: issue a warning only if the server is really broken 2018-11-14 19:55:10 +00:00
Ondřej Surý
cf9c2ef305 Fix the max-ncache-ttl tests 2018-11-14 18:24:53 +01:00
Ondřej Surý
f6ca532df4 Add system tests for {min,max}-{cache,ncache}-ttl 2018-11-14 18:24:53 +01:00
Ondřej Surý
02b828e63f Use @abs_top_builddir@ to define BIND 9 top build directory in conf.sh 2018-11-14 18:24:53 +01:00
Ondřej Surý
54fdd6e834 Add min-{n,}cache-ttl tests for checkconf 2018-11-14 18:24:53 +01:00
Mark Andrews
77128c867c check that delv -q -m works 2018-11-14 11:38:08 +11:00
Mark Andrews
f6f07fb41e check that dig -q -m works 2018-11-14 11:14:49 +11:00
Mark Andrews
28442f11f0 log RPZ type and class 2018-11-08 22:48:28 -05:00
Ondřej Surý
fbd2e47f51 Add small tweaks to the code to fix compilation when ISC assertions are disabled
While implementing the new unit testing framework cmocka, it was found that the
BIND 9 code doesn't compile when assertions are disabled or replaced with any
function (such as mock_assert() from cmocka unit testing framework) that's not
directly recognized as assertion by the compiler.

This made the compiler to complain about blocks of code that was recognized as
unreachable before, but now it isn't.

The changes in this commit include:

* assigns default values to couple of local variables,
* moves some return statements around INSIST assertions,
* adds __builtin_unreachable(); annotations after some INSIST assertions,
* fixes one broken assertion (= instead of ==)
2018-11-08 12:21:53 +07:00
Witold Krecicki
82dfb77328 Remove unnecessary sed from autosign test 2018-11-08 00:07:00 +01:00
Witold Krecicki
0949b1fe2c Use 'local' variable in echo functions in tests 2018-11-07 23:15:06 +01:00
Witold Kręcicki
dbf2e7928e Get rid of bashism in CDS test 2018-11-07 23:13:47 +01:00
Witold Kręcicki
152c437bb8 Allow slight over-quota in'checking lame server clients are dropped at the soft limit' test 2018-11-06 08:19:50 +00:00
Tony Finch
1b1d63acd8 Fixes for rndc nta user interface
Tell the user explicitly about their mistakes:

* Unknown options, e.g. -list instead of -dump
  or -delete instead of -remove.

* Unknown view names.

* Excess arguments.

Include the view name in `rndc nta -dump` output, for consistency with
the NTA add and remove actions.

When removing an NTA from all views, do not abort with an error if the
NTA was not found in one of the views.
2018-11-05 22:01:28 -08:00
Ondřej Surý
e8c57a78aa Update the idna tests for the new non-tty defaults 2018-11-06 12:48:08 +07:00
Mark Andrews
164370102a test require-server-cookie with rate-limit 2018-11-06 10:10:04 +11:00
Evan Hunt
fc99651d7d disable QNAME minimization in the dnstap test so packet counts will be correct 2018-11-02 11:34:27 -07:00
Witold Kręcicki
9163e93b9e Avoid a race in qmin test 2018-11-02 13:51:31 -04:00
Michał Kępień
27cfe83a38 Check serve-stale behavior with a cold cache
Ensure that serve-stale works as expected when returning stale answers
is enabled, the authoritative server does not respond, and there is no
cached answer available.
2018-10-31 14:08:09 +01:00
Michał Kępień
893ab37ce7 Check TTL of stale answers
Make sure that stale answers returned when the serve-stale feature is
enabled have a TTL matching the value of the stale-answer-ttl setting.
2018-10-31 14:08:09 +01:00
Mark Andrews
280d0ca507 use new packet for response; rename variable to request and response 2018-10-31 16:14:43 +11:00
Witold Kręcicki
67f824434f Fix style in catz test 2018-10-30 19:08:11 +00:00
Witold Kręcicki
ce47ca8c6b catz test: wait for dom8.example to be transferred before checking its availability 2018-10-30 19:08:11 +00:00
Mark Andrews
2ff57d8a39 Record types which support a empty rdata field were not handling the empty rdata field case. 2018-10-30 11:03:02 +11:00
Witold Kręcicki
08460c8cb2 Don't do qname minimization when forwarding; Avoid some intermittent errors in qmin tests caused by timing 2018-10-29 19:22:10 +00:00
Witold Kręcicki
b4ca282589 Test for #361 - forwarding breaks with qname minimization 2018-10-29 19:22:10 +00:00
Witold Kręcicki
5979471dc7 statschannel test: try 5 times to check if compressed and regular output of statschannel is the same - some counters can change, minimize risk of bad timing 2018-10-26 08:36:48 +00:00
Mark Andrews
fbab100426 Add support for EID and NIMLOC 2018-10-25 15:20:33 -07:00
Mark Andrews
eb7ca65b78 GID, UID and UINFO could not be loaded using unknown record format. 2018-10-25 13:00:32 -07:00
Mark Andrews
f9ceddd8ca Add support for ATMA 2018-10-25 13:21:49 +11:00
Michał Kępień
adbe2caf28 Test whether mirror zones can be added and removed dynamically
Extend the "mirror" zone system test to make sure mirror zones can be
added and removed dynamically using rndc.
2018-10-24 20:32:56 +02:00
Michał Kępień
2c69734bcf Define a default master server list for the root zone
To minimize the effort required to set up IANA root zone mirroring,
define a default master server list for the root zone and use it when
that zone is to be mirrored and no master server list was explicitly
specified.  Contents of that list are taken from RFC 7706 and are
subject to change in future releases.

Since the static get_masters_def() function in bin/named/config.c does
exactly what named_zone_configure() in bin/named/zoneconf.c needs to do,
make the former non-static and use it in the latter to prevent code
duplication.
2018-10-24 20:32:55 +02:00