Commit graph

196 commits

Author SHA1 Message Date
Matthijs Mekking
fd01889b8a Update nsupdate test
The nsupdate system test did not record failures from the
'update_test.pl' Perl script. This was because the 'ret' value was
not being saved outside the '{ $PERL ... || ret=1 } cat_i' scope.

Change this piece to store the output in a separate file and then
cat its contents. Now the 'ret' value is being saved.

Also record failures in 'update_test.pl' if sending the update
failed.

Add missing 'n' incrementals to 'nsupdate/test.sh' to keep track of
test numbers.

(cherry picked from commit 5b31811b5f)
2021-04-30 14:28:30 +02:00
Mark Andrews
f9425a9ae6 NSEC3PARAM support was added to Net::DNS in 1.00_06
Require 1.01 or later to when adding a NSEC3PARAM records.

(cherry picked from commit 044933756a)
2021-04-30 16:29:41 +10:00
Mark Andrews
5546c7959c Check that named rejects excessive iterations via UPDATE
(cherry picked from commit 4ce8437a6e)
2021-04-29 17:55:39 +10:00
Mark Andrews
b8708ebfa1 nsupdate: reject attempts to add NSEC3PARAM with excessive iterations
(cherry picked from commit 3fe75d9809)
2021-04-29 17:55:35 +10:00
Michał Kępień
cce29c3929 Test "tkey-gssapi-credential" conditionally
If "tkey-gssapi-credential" is set in the configuration and GSSAPI
support is not available, named will refuse to start.  As the test
system framework does not support starting named instances
conditionally, ensure that "tkey-gssapi-credential" is only present in
named.conf if GSSAPI support is available.

(cherry picked from commit 6feac68b50)
2021-04-26 09:27:31 +02:00
Petr Špaček
1d4fbe2511
Add tests for the "tkey-gssapi-credential" option
Four named instances in the "nsupdate" system test have GSS-TSIG support
enabled.  All of them currently use "tkey-gssapi-keytab".  Configure two
of them with "tkey-gssapi-credential" to test that option.

As "tkey-gssapi-keytab" and "tkey-gssapi-credential" both provide the
same functionality, no test modifications are required.  The difference
between the two options is that the value of "tkey-gssapi-keytab" is an
explicit path to the keytab file to acquire credentials from, while the
value of "tkey-gssapi-credential" is the name of the principal whose
credentials should be used; those credentials are looked up in the
keytab file expected by the Kerberos library, i.e. /etc/krb5.keytab by
default.  The path to the default keytab file can be overridden using by
setting the KRB5_KTNAME environment variable.  Utilize that variable to
use existing keytab files with the "tkey-gssapi-credential" option.

The KRB5_KTNAME environment variable should not interfere with the
"tkey-gssapi-keytab" option.  Nevertheless, rename one of the keytab
files used with "tkey-gssapi-keytab" to something else than the contents
of the KRB5_KTNAME environment variable in order to make sure that both
"tkey-gssapi-keytab" and "tkey-gssapi-credential" are actually tested.

(cherry picked from commit 1746d2e84a)
2021-04-23 09:19:45 +02:00
Evan Hunt
131bbb9bbe remove dns_client_update() and related code
the libdns client API is no longer being maintained for
external use, we can remove the code that isn't being used
internally, as well as the related tests.

(cherry picked from commit fb2a352e7c)
2021-04-19 13:25:48 +02:00
Mark Andrews
8dc5d63e1d Ignore the actual error code returned by getaddrinfo
when testing if interactive mode continues or not on
invalid hostname.  We only need to detect that getaddrinfo
failed and that we continued or not.

(cherry picked from commit 25d1276170)
2021-03-16 11:12:47 +11:00
Mark Andrews
abb2eb9d97 Add a named acl example
(cherry picked from commit 3dee62cfa5)
2021-01-28 13:43:47 +11:00
Mark Andrews
a30675998b Check that 'nsupdate -y' works for all HMAC algorithms
(cherry picked from commit 4b01ba44ea)
2021-01-28 12:57:03 +11:00
Evan Hunt
7b2880d191 further tidying of primary/secondary terminology in system tests
this changes most visble uses of master/slave terminology in tests.sh
and most uses of 'type master' or 'type slave' in named.conf files.
files in the checkconf test were not updated in order to confirm that
the old syntax still works. rpzrecurse was also left mostly unchanged
to avoid interference with DNSRPS.

(cherry picked from commit e43b3c1fa1)
2021-01-12 15:21:14 +01:00
Evan Hunt
04b9cdb53c add "primaries" as a synonym for "masters" in named.conf
as "type primary" is preferred over "type master" now, it makes
sense to make "primaries" available as a synonym too.

added a correctness check to ensure "primaries" and "masters"
cannot both be used in the same zone.

(cherry picked from commit 16e14353b1)
2021-01-12 15:21:14 +01:00
Evan Hunt
df698d73f4 update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
Mark Andrews
1ef4fa9a0b Check 'deny name' + 'grant subdomain' for the same name
(cherry picked from commit a402ffbced)
2020-09-03 16:22:01 +10:00
Michał Kępień
894b7a8345 Use "-T maxcachesize=2097152" in all system tests
In order to lower the amount of memory allocated at startup by named
instances used in the BIND system test suite, set the default value of
"max-cache-size" for these to 2 megabytes.  The purpose of this change
is to prevent named instances (or even entire virtual machines) from
getting killed by the operating system on the test host due to excessive
memory use.

Remove all "max-cache-size" statements from named configuration files
used in system tests ("checkconf" notwithstanding) to prevent confusion
as the "-T maxcachesize=..." command line option takes precedence over
configuration files.

(cherry picked from commit dad6572093)
2020-08-31 23:42:38 +02:00
Mark Andrews
14aa0c5df6 Add a test for update-policy 'zonesub'
The new test checks that 'update-policy zonesub' is properly enforced.
2020-08-05 15:55:06 +02:00
Mark Andrews
5bf457e89a Add a test for update-policy 'subdomain'
The new test checks that 'update-policy subdomain' is properly enforced.
2020-08-05 15:55:06 +02:00
Michal Nowak
24f5f68d7a
Ensure test fails if packet.pl does not work as expected 2020-07-30 16:20:46 +02:00
Mark Andrews
6ac4e62fbc Ignore attempts to add DS records at zone apex
DS records belong in the parent zone at a zone cut and
are not retrievable with modern recursive servers.

(cherry picked from commit ae55fbbe9c)
2020-06-04 16:06:45 +02:00
Mark Andrews
906211a02a Wait longer (up to 20 secs) for journal to be truncated
(cherry picked from commit 0c2f0e02f2)
2020-05-19 08:15:11 +10:00
Evan Hunt
11a0d771f9 fix spelling errors reported by Fossies.
(cherry picked from commit ba0313e649)
2020-02-21 07:05:31 +00:00
Evan Hunt
24510a1fda adjust system tests to deal with possible timing issues
With the netmgr in use, named may start answering queries before zones
are loaded. This can cause transient failures in system tests after
servers are restarted or reconfigured. This commit adds retry loops
and sleep statements where needed to address this problem.

Also incidentally silenced a clang warning.
2019-11-07 12:42:14 -08:00
Evan Hunt
53f0b6c34d convert ns_client and related objects to use netmgr
- ns__client_request() is now called by netmgr with an isc_nmhandle_t
  parameter. The handle can then be permanently associated with an
  ns_client object.
- The task manager is paused so that isc_task events that may be
  triggred during client processing will not fire until after the netmgr is
  finished with it. Before any asynchronous event, the client MUST
  call isc_nmhandle_ref(client->handle), to prevent the client from
  being reset and reused while waiting for an event to process. When
  the asynchronous event is complete, isc_nmhandle_unref(client->handle)
  must be called to ensure the handle can be reused later.
- reference counting of client objects is now handled in the nmhandle
  object.  when the handle references drop to zero, the client's "reset"
  callback is used to free temporary resources and reiniialize it,
  whereupon the handle (and associated client) is placed in the
  "inactive handles" queue.  when the sysstem is shutdown and the
  handles are cleaned up, the client's "put" callback is called to free
  all remaining resources.
- because client allocation is no longer handled in the same way,
  the '-T clienttest' option has now been removed and is no longer
  used by any system tests.
- the unit tests require wrapping the isc_nmhandle_unref() function;
  when LD_WRAP is supported, that is used. otherwise we link a
  libwrap.so interposer library and use that.
2019-11-07 11:55:37 -08:00
Michał Kępień
f8746cddbc Wait more than 1 second for NSEC3 chain changes
One second may not be enough for an NSEC3 chain change triggered by an
UPDATE message to complete.  Wait up to 10 seconds when checking whether
a given NSEC3 chain change is complete in the "nsupdate" system test.
2019-04-23 14:59:05 +02:00
Michał Kępień
1c8e5ea333 Remove redundant sleeps
In the "nsupdate" system test, do not sleep before checking results of
changes which are expected to be processed synchronously, i.e. before
nsupdate returns.
2019-04-23 14:59:05 +02:00
Evan Hunt
885a3d208e remove "dnssec-enable" from all system tests 2019-03-14 23:30:13 -07: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
Evan Hunt
5656e97ddf fix nsupdate test
rndc_reload was failing on windows
2019-01-25 00:44:11 -08: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
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ý
16b95157e8 Make calls to the start.pl always use the test name instead of '.' 2018-12-03 15:50:21 +01:00
Mark Andrews
54c4db569b add krb5-* tests to nsupdate system test. 2018-09-10 09:32:32 +10:00
Mark Andrews
abe41ba011 use guard values for testing unixtime serial 2018-08-02 10:25:56 +10:00
Mark Andrews
6b30bc73c0 save SOA values 2018-08-01 20:04:09 -04:00
Ondřej Surý
c40425d0f6 RSA and ECDSA cryptography is now mandatory; remove the checks for those 2018-07-19 12:47:03 -04:00
Mukund Sivaraman
a7e6a584ea Add system tests for "tcp-self" update-policy 2018-07-11 10:55:24 -07:00
Evan Hunt
a7a2fa296a update system tests so validation won't fail when using IANA key
- all tests with "recursion yes" now also specify "dnssec-validation yes",
  and all tests with "recursion no" also specify "dnssec-validation no".
  this must be maintained in all new tests, or else validation will fail
  when we use local root zones for testing.
- clean.sh has been modified where necessary to remove managed-keys.bind
  and viewname.mkeys files.
2018-05-31 18:22:33 +02:00
Ondřej Surý
2b8fab6828 Remove genrandom command and all usage of specific random files throughout the system test suite 2018-05-16 09:54:35 +02:00
Ondřej Surý
55a10b7acd Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
Evan Hunt
0e52fbd0b3 clean up test output
- removed a few remaing places where output wasn't being passed
  through echo_i or cat_i
- added a "digcomp" function to conf.sh.in to send digcomp.pl output
  through cat_i and return the correct exit value
- set SYSTESTDIR when calling echo_i from nsX directories, so that
  the test name will always be printed correctly
- fixed a test name typo in conf.sh.in
2018-02-26 23:37:05 -08:00
Michał Kępień
857a40c87b Fix MX checks for dynamic updates
The check_mx() function in lib/ns/update.c incorrectly tests whether the
DNS_RDATA_CHECKMX/DNS_RDATA_CHECKMXFAIL flags are set for each applied
MX record update as these flags are never set in code paths related to
dynamic updates; they can only be set when loading a zone from a master
file (DNS_ZONEOPT_CHECKMX -> DNS_MASTER_CHECKMX -> DNS_RDATA_CHECKMX).
This flaw allows MX records containing IP addresses to be added to a
zone even when "check-mx fail;" is used.

Ensure correct behavior by modifying the relevant tests in check_mx() so
that they use DNS_ZONEOPT_CHECKMX/DNS_ZONEOPT_CHECKMXFAIL instead.
2018-02-26 13:10:45 +01:00
Ondřej Surý
843d389661 Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
Evan Hunt
0c559199bf final cleanup
- add CHANGES note
- update copyrights and license headers
- add -j to the make commands in .gitlab-ci.yml to take
  advantage of parallelization in the gitlab CI process
2018-02-22 22:58:15 -08:00
Evan Hunt
c032c54dda parallelize most system tests 2018-02-22 15:29:02 -08:00
Tinderbox User
3fda67b596 update copyright notice / whitespace 2018-01-22 23:46:02 +00:00
Mukund Sivaraman
8a4ce20172 Don't permit loading meta RR types such as TKEY from master files (#47009) 2018-01-22 14:26:04 +05:30
Michał Kępień
00ff44c7c2 [master] Stabilize nsupdate system test [RT #46673] 2017-11-27 10:10:42 +01:00
Mark Andrews
9eb5aa40aa set SAMPLEUPDATE under windows; test if SAMPLEUPDATE exists and only run tests if it does 2017-11-11 09:23:44 +11:00
Mark Andrews
f581ac4726 allow more time for journal to sync 2017-11-10 18:18:04 +11:00
Evan Hunt
aebdc6cd7d [master] log when update-policy local gets a key match from a remote host
4788.	[cleanup]	When using "update-policy local", log a warning
			when an update matching the session key is received
			from a remote host. [RT #46213]

- this completes change #4762.
2017-10-25 00:58:11 -07:00