256 Commits

Author SHA1 Message Date
Mukund Sivaraman
8af1d5916f Add NSEC3 fromtext/totext unittests
(cherry picked from commit b0d9198e03)
2018-06-04 13:01:18 +10:00
Evan Hunt
61de568197 copyrights 2018-05-23 09:52:09 -07:00
Mark Andrews
de2d23db2a alphabetize and remove ISCPK11LIBS 2018-05-17 16:32:43 +10:00
Michał Kępień
f26ae1ea9f Extend the list of headers included by lib/dns/tests/sigs_test.c
(cherry picked from commit f98e145c5b)
2018-05-14 09:31:18 +02:00
Mark Andrews
8d93b77c31 return untested if not built with OPENSSL or PKCS11CRYPTO
(cherry picked from commit 2420320b96)
2018-05-14 09:31:18 +02:00
Ondřej Surý
c35de9b383 Remove $Id markers, Principal Author and Reviewed tags from the full source tree
(cherry picked from commit 55a10b7acd)
2018-05-11 14:19:35 +02:00
Evan Hunt
b1ef7d8ecd Merge branch '135-add-basic-unit-tests-for-update_sigs' into 'v9_12'
Add basic unit tests for update_sigs()

Closes #135

See merge request isc-projects/bind9!112
2018-05-10 00:02:06 -07:00
Michał Kępień
3e93e4bb62 Define basic test cases for dns__zone_updatesigs()
Add some basic test cases ensuring dns__zone_updatesigs() behaves as
expected.

(cherry picked from commit 8b9d2c27b4)
2018-05-10 00:01:41 -07:00
Michał Kępień
3dde7c42db Add a framework for dns__zone_updatesigs() unit tests
Add a new ATF test, sigs_test, containing everything required to start
defining test cases for dns__zone_updatesigs().  The framework is
written in a way which ensures that changes to zone database applied by
any dns__zone_updatesigs() invocation are preserved between subsequent
checks.

(cherry picked from commit 1f10186476)
2018-05-10 00:01:41 -07:00
Michał Kępień
d4c603eb8a Add a helper function to facilitate preparing dns_diff_t structures
Implement dns_test_difffromchanges(), a function which enables preparing
a dns_diff_t structure from a mostly-textual representation of zone
database changes to be applied.  This will improve readability of test
case definitions by allowing contents of a dns_diff_t structure, passed
e.g. to update_sigs(), to be represented in a human-friendly manner.

(cherry picked from commit 3c22af0d35)
2018-05-10 00:00:31 -07:00
Michał Kępień
107102d333 Rename dns_test_rdata_fromstring() to dns_test_rdatafromstring()
Remove the underscore from "rdata_fromstring" so that all helper
functions for libdns tests use a common naming covention.

(cherry picked from commit 2980cbd55f)
2018-05-10 00:00:31 -07:00
Michał Kępień
f70c02d2c2 Rework dns_test_makezone()
The dns_test_makezone() helper function always assigns the created zone
to some view, which is not always necessary and complicates cleanup of
non-managed zones as they are required not to be assigned to any view.

Rework dns_test_makezone() in order to make it easier to use in unit
tests operating on non-managed zones.  Use dns_name_fromstring() instead
of dns_name_fromtext() to simplify code.  Do not use the CHECK() macro
and add comments to make code flow simpler to follow.  Use
dns_test_makeview() instead of dns_view_create().

Adjust existing unit tests using this function so that they still pass.

(cherry picked from commit bfbeef3609)
2018-05-10 00:00:31 -07:00
Mark Andrews
ba238ab374 use %u instead of %d for unsigned int arguments
(cherry picked from commit 49f8e9571c)
2018-04-20 15:13:12 -07:00
Michał Kępień
0041aeb751 Use dns_fixedname_initname() where possible
Replace dns_fixedname_init() calls followed by dns_fixedname_name()
calls with calls to dns_fixedname_initname() where it is possible
without affecting current behavior and/or performance.

This patch was mostly prepared using Coccinelle and the following
semantic patch:

    @@
    expression fixedname, name;
    @@
    -	dns_fixedname_init(&fixedname);
    	...
    -	name = dns_fixedname_name(&fixedname);
    +	name = dns_fixedname_initname(&fixedname);

The resulting set of changes was then manually reviewed to exclude false
positives and apply minor tweaks.

It is likely that more occurrences of this pattern can be refactored in
an identical way.  This commit only takes care of the low-hanging fruit.

(cherry picked from commit 4df4a8e731)
2018-04-10 13:09:24 -07:00
Mukund Sivaraman
d2dea05356 Check return value of isc_mem_get()
(cherry picked from commit de3a4af1bf)
2018-03-20 09:54:08 +11:00
Evan Hunt
7bc7557df9 Merge branch 'clean-bin-tests-v9_12' into 'v9_12'
clean up bin/tests, convert unit tests to ATF

Closes #115

See merge request isc-projects/bind9!93
2018-03-09 14:40:12 -08:00
Evan Hunt
80834b5b90 final cleanup
- update Kyuafiles to match Atffiles
- copyrights
- CHANGES note

(cherry picked from commit 86e00cbb71)
2018-03-09 14:40:12 -08:00
Evan Hunt
4439c471d1 migrate t_dst signature test to lib/dns/tests/dst_test
(cherry picked from commit a4ebe83cdb)
2018-03-09 14:39:56 -08:00
Evan Hunt
56da937399 migrate t_db to lib/dns/tests/db_test
(cherry picked from commit f58ac8ada3)
2018-03-09 14:39:56 -08:00
Evan Hunt
aefad99e1e migrate t_names to lib/dns/tests/name_test
(cherry picked from commit 8ecf69ef7b)
2018-03-09 14:39:56 -08:00
Evan Hunt
c505afd183 migrate t_rbt to lib/dns/tests/rbt_test
(cherry picked from commit 109546cbda)
2018-03-09 14:39:56 -08:00
Evan Hunt
30e157f6e4 migrate t_resolver to lib/dns/tests/resolver_test
(cherry picked from commit d80825c40b)
2018-03-09 14:39:56 -08:00
Evan Hunt
787c5d1394 allow ATF tests to run in parallel
(cherry picked from commit ef0b4c91bc)
2018-03-09 14:36:06 -08:00
Petr Menšík
eb5c7e91fa unit/unittest.sh is generated by configure. It will always be
generated into builddir. If out-of-tree build is used, make unit
will always fail. Kyuafiles and testdata still have to be copied
manually into the builddir.

(cherry picked from commit 95cde3608a)
2018-02-23 15:45:19 -08:00
Ondřej Surý
557a5c3f78 Update license headers to not include years in copyright in all applicable files
(cherry picked from commit 843d389661)
2018-02-23 10:38:02 +01:00
Mark Andrews
494a3b33a2 Clarify calculation precedence for '&' and '?' 2018-02-16 14:08:26 +11:00
Tinderbox User
d59b79c94f update copyright notice / whitespace 2018-01-24 23:46:37 +00:00
Evan Hunt
bb0a05e72b [v9_12] change uint to isc_uint 2018-01-24 11:02:57 -08:00
Tinderbox User
5088140fc7 update copyright notice / whitespace 2018-01-21 23:46:29 +00:00
Mark Andrews
f6911d4295 4869. [bug] Address some cases where NULL with zero length could
be passed to memmove which is undefined behaviour and
                        can lead to bad optimisation. [RT #46888]

(cherry picked from commit fdd8838bf9)
2018-01-22 09:37:30 +11:00
Tinderbox User
251446d350 regen v9_12 2017-12-29 02:16:29 +00:00
Mark Andrews
d8cb1587ec initalize sigsize to zero; ATF_CHECK_EQ(sigsize, tsig.siglen);
(cherry picked from commit 9f61f6b46b)
2017-12-22 08:58:59 +11:00
Mark Andrews
cb8650d875 don't attempt to call isc_buffer_free(&buf) twice; don't attempt to call dns_message_destroy(&msg) twice; don't test for key != NULL 2017-12-12 13:20:56 +11:00
Mark Andrews
1dc8208a89 silence %lu vs size_t warning by casting to (unsigned long) 2017-11-24 10:25:37 +11:00
Tinderbox User
3bfc28a0d0 update copyright notice / whitespace 2017-11-13 23:45:33 +00:00
Mark Andrews
04934b28ea 4815. [bug] rbt_test.c:insert_and_delete needed to call
dns_rbt_addnode instead of dns_rbt_addname. [RT #46553]
2017-11-13 15:26:35 +11:00
Michał Kępień
c6c1193e39 [master] Improve clarity of keytable unit tests
4799.	[cleanup]	Improve clarity of keytable unit tests. [RT #46407]
2017-10-28 19:59:40 +02:00
Evan Hunt
c9f8165a06 [master] tag initializing keys
4798.	[func]		Keys specified in "managed-keys" statements
			are tagged as "initializing" until they have been
			updated by a key refresh query. If initialization
			fails it will be visible from "rndc secroots".
			[RT #46267]
2017-10-27 15:49:44 -07:00
Tinderbox User
08f18efba2 update copyright notice / whitespace 2017-10-26 23:45:58 +00:00
Tinderbox User
8e2a8a3855 update copyright notice / whitespace 2017-10-25 23:47:47 +00:00
Michał Kępień
910a01550a [master] Rename nsec3param_salt_totext() to dns_nsec3param_salttotext(), make it public, add unit tests
4786.	[cleanup]	Turn nsec3param_salt_totext() into a public function,
			dns_nsec3param_salttotext(), and add unit tests for it.
			[RT #46289]
2017-10-25 09:46:18 +02:00
Evan Hunt
3abcd7cd8a [master] Revert "[master] tag initializing keys so they can't be used for normal validation"
This reverts commit 560d8b833e.

This change created a potential race between key refresh queries and
root zone priming queries which could leave the root name servers in
the bad-server cache.
2017-10-12 10:53:35 -07:00
Evan Hunt
d0c3272eaa [master] copyrights 2017-10-11 21:11:37 -07:00
Evan Hunt
560d8b833e [master] tag initializing keys so they can't be used for normal validation
4773.	[bug]		Keys specified in "managed-keys" statements
			can now only be used when validating key refresh
			queries during initialization of RFC 5011 key
			maintenance. If initialization fails, DNSSEC
			validation of normal queries will also fail.
			Previously, validation of normal queries could
			succeed using the initializing key, potentially
			masking problems with managed-keys. [RT #46077]
2017-10-11 21:01:13 -07:00
Michał Kępień
c0f78692ee [master] Sync draft-durand-doa-over-dns snippet in lib/dns/tests/rdata_test.c with draft version -03 2017-10-09 10:52:50 +02:00
Michał Kępień
417218837e [master] Add support for DOA
4761.	[protocol]	Add support for DOA. [RT #45612]
2017-10-06 12:22:08 +02:00
Tinderbox User
791aa3e9be update copyright notice / whitespace 2017-09-28 23:45:49 +00:00
Mark Andrews
f735293431 4743. [func] Exclude trust-anchor-telementry queries from
synth-from-dnssec processing. [RT #46123]
2017-09-28 16:40:45 +10:00
Mark Andrews
f9f3f20d2d 4739. [cleanup] Address clang static analysis warnings. [RT #45952] 2017-09-27 10:27:09 +10:00
Mark Andrews
d17cf1cade explicitly list test programs 2017-09-21 12:56:33 +10:00