Commit Graph

148 Commits

Author SHA1 Message Date
Mukund Sivaraman
d1af2db397 Add NSEC3 fromtext/totext unittests
(cherry picked from commit b0d9198e03)
2018-06-04 13:34:46 +10:00
Evan Hunt
f2dc9a516f copyrights
(cherry picked from commit 58fd94cbce)
2018-05-23 09:58:57 -07:00
Michał Kępień
7f38fd70c1 Extend the list of headers included by lib/dns/tests/sigs_test.c
(cherry picked from commit 1e1ed6627b)
2018-05-14 09:34:56 +02:00
Mark Andrews
77cd6fe0f5 return untested if not built with OPENSSL or PKCS11CRYPTO
(cherry picked from commit 9d8bab64ad)
2018-05-14 09:34:42 +02:00
Michał Kępień
e41d2a195e 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)
(cherry picked from commit 3e93e4bb62)
(cherry picked from commit 505267f320)
(cherry picked from commit 5a957ec9e1)
2018-05-10 09:45:50 -07:00
Michał Kępień
02da03b17f 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)
(cherry picked from commit 3dde7c42db)
(cherry picked from commit e787e54ea1)
(cherry picked from commit 7394dd8732)
2018-05-10 09:45:48 -07:00
Michał Kępień
645c43d09c Move zonediff_t to lib/dns/zone_p.h
Rename zonediff_t to dns__zonediff_t and move it to lib/dns/zone_p.h, so
that unit tests can be written for functions taking pointers to
structures of this type as arguments.

(cherry picked from commit ace465a9f9)
(cherry picked from commit ea15c54d8a)
(cherry picked from commit 5712d9528f)
(cherry picked from commit 5f0b4eaf70)
2018-05-10 09:42:13 -07:00
Michał Kępień
f7a84380dd 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)
(cherry picked from commit d4c603eb8a)
(cherry picked from commit 1f454b8d91)
(cherry picked from commit 7193496b6e)
2018-05-10 09:42:13 -07:00
Michał Kępień
1eec107a94 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)
(cherry picked from commit 107102d333)
(cherry picked from commit 5097723d1b)
(cherry picked from commit 94caf8ebdb)
2018-05-10 09:42:13 -07:00
Michał Kępień
c7d9100dcb 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)
(cherry picked from commit f70c02d2c2)
(cherry picked from commit d45ee39bae)
(cherry picked from commit d76fdb8718)
2018-05-10 09:42:13 -07:00
Mukund Sivaraman
eb98f2759e Check return value of isc_mem_get()
(cherry picked from commit de3a4af1bf)
2018-03-20 09:56:09 +11:00
Ondřej Surý
9f830be501 update file headers to remove copyright years 2018-03-15 09:09:15 +01:00
Evan Hunt
a6e5d9a2ca Merge branch 'clean-bin-tests-v9_9' into 'v9_9'
clean up bin/tests, convert unit tests to ATF

Closes #115

See merge request isc-projects/bind9!93
2018-03-09 23:52:26 -08:00
Evan Hunt
e6c446bfba final cleanup
- update Kyuafiles to match Atffiles
- copyrights
- CHANGES note

(cherry picked from commit 86e00cbb71)
(cherry picked from commit 80834b5b90)
(cherry picked from commit 442c1530a3)
(cherry picked from commit 6fe8188cc3)
2018-03-09 23:35:02 -08:00
Evan Hunt
2591c077f0 migrate t_dst signature test to lib/dns/tests/dst_test
(cherry picked from commit a4ebe83cdb)
(cherry picked from commit 4439c471d1)
(cherry picked from commit 57a5820dcc)
(cherry picked from commit dbc21e4393)
2018-03-09 23:22:04 -08:00
Evan Hunt
a11252dbbc migrate t_db to lib/dns/tests/db_test
(cherry picked from commit f58ac8ada3)
(cherry picked from commit 56da937399)
(cherry picked from commit d3518e57b1)
(cherry picked from commit c5dbc0b727)
2018-03-09 23:20:11 -08:00
Evan Hunt
28d62b0a31 migrate t_names to lib/dns/tests/name_test
(cherry picked from commit 8ecf69ef7b)
(cherry picked from commit aefad99e1e)
(cherry picked from commit b2fef3b438)
(cherry picked from commit 2893e982ed)
2018-03-09 23:19:11 -08:00
Evan Hunt
20da3cd7e7 migrate t_rbt to lib/dns/tests/rbt_test
(cherry picked from commit 109546cbda)
(cherry picked from commit c505afd183)
(cherry picked from commit 42fa3932ab)
(cherry picked from commit 4c6818ff8e)
2018-03-09 23:17:36 -08:00
Evan Hunt
48c8aca49b migrate t_resolver to lib/dns/tests/resolver_test
(cherry picked from commit d80825c40b)
(cherry picked from commit 30e157f6e4)
(cherry picked from commit 5dd25f2285)
(cherry picked from commit 29474940ea)
2018-03-09 23:13:44 -08:00
Evan Hunt
7677cb277a final cleanup
- add CHANGES note
- update copyrights and license headers
2018-02-25 13:13:26 -08:00
Petr Menšík
3727e6a944 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)
(cherry picked from commit 6d9b38e9fe)
(cherry picked from commit 6f2fd5ccca)
2018-02-23 15:51:50 -08:00
Tinderbox User
763a9ad41f update copyright notice / whitespace 2018-01-24 23:49:40 +00:00
Evan Hunt
7fe379bf51 [v9_9] change uint to isc_uint 2018-01-24 11:02:45 -08:00
Tinderbox User
7aeee801e6 regen v9_9 2017-12-29 02:41:20 +00:00
Mark Andrews
9711fe2244 initalize sigsize to zero; ATF_CHECK_EQ(sigsize, tsig.siglen);
(cherry picked from commit 9f61f6b46b)
2017-12-22 08:59:15 +11:00
Mark Andrews
2884abf6a1 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
(cherry picked from commit cb8650d875)
2017-12-12 13:25:12 +11:00
Mark Andrews
c4f2e47fea silence %lu vs size_t warning by casting to (unsigned long)
(cherry picked from commit 1dc8208a89)
2017-11-24 10:26:48 +11:00
Tinderbox User
f46bfe0899 update copyright notice / whitespace 2017-10-25 23:55:13 +00:00
Michał Kępień
c6753bad79 [v9_9] 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]

(cherry picked from commit 54a43e9bf1)
2017-10-25 09:51:06 +02:00
Michał Kępień
89e10f4b41 [v9_9] Sync draft-durand-doa-over-dns snippet in lib/dns/tests/rdata_test.c with draft version -03 2017-10-09 10:53:15 +02:00
Michał Kępień
c32a80e1d6 [v9_9] Add support for DOA
4761.	[protocol]	Add support for DOA. [RT #45612]

(cherry picked from commit 4ee1fbe056)
2017-10-06 13:00:00 +02:00
Mark Andrews
80dd4971d9 4739. [cleanup] Address clang static analysis warnings. [RT #45952]
(cherry picked from commit f9f3f20d2d)
2017-09-27 13:19:37 +10:00
Tinderbox User
a7741835cc regen v9_9 2017-09-21 07:51:57 +00:00
Tinderbox User
01bad075b6 regen v9_9 2017-09-21 04:07:03 +00:00
Mark Andrews
799bb89429 explicitly list test programs 2017-09-21 13:07:12 +10:00
Tinderbox User
077f3c4e27 update copyright notice / whitespace 2017-09-14 00:03:54 +00:00
Mukund Sivaraman
20a3b9a914 add #include <isc/string.h>
(cherry picked from commit 4c9ba9ded8)
(cherry picked from commit 28a55095f7)
(cherry picked from commit bf5e318303)
2017-09-13 20:00:18 +05:30
Evan Hunt
f07825440f [master] cleanup strcat/strcpy
4722.	[cleanup]	Clean up uses of strcpy() and strcat() in favor of
			strlcpy() and strlcat() for safety. [RT #45981]

(cherry picked from commit 114f95089c)
(cherry picked from commit 7cd594b842)
(cherry picked from commit e0ddfb109e)
2017-09-13 00:20:09 -07:00
Mukund Sivaraman
b7df525e93 Fix tsig_test.c unittest (OK'd by Mark on Jabber)
(cherry picked from commit f2b6eef899)
(cherry picked from commit 8ecd1dc557)
(cherry picked from commit dc94345bbd)
2017-08-08 21:56:57 +05:30
Tinderbox User
f9d3d16a27 update copyright notice / whitespace 2017-08-01 23:55:29 +00:00
Michał Kępień
60b55fe41c [v9_9] Refactor RDATA unit tests
4667.	[cleanup]	Refactor RDATA unit tests. [RT #45610]

(cherry picked from commit 41620b94c4)
2017-08-01 13:08:33 +02:00
Tinderbox User
b5f2eaec62 update copyright notice / whitespace 2017-07-21 23:48:17 +00:00
Mark Andrews
169bf685a1 4654. [cleanup] Don't use C++ keywords delete, new and namespace.
[RT #45538]

(cherry picked from commit 4bf32aa587)
2017-07-21 12:50:13 +10:00
Mark Andrews
49a977c6aa 4650. [test] Silence coverity warnings in tsig_test.c. [RT #45528]
(cherry picked from commit c0ac259940)
2017-07-19 14:37:10 +10:00
Tinderbox User
59de594242 update copyright notice / whitespace 2017-07-07 23:47:50 +00:00
Mark Andrews
142d902f08 add #include <isc/print.h>
(cherry picked from commit 00a235c8e6)
2017-07-08 00:48:37 +10:00
Mark Andrews
2fc1b8102d 4647. [bug] Change 4643 broke verification of TSIG signed TCP
message sequences where not all the messages contain
                        TSIG records.  These may be used in AXFR and IXFR
                        responses.  [RT #45509]

(cherry picked from commit 58f0fb325b)
2017-07-07 23:32:01 +10:00
Tinderbox User
ff69a0423e update copyright notice / whitespace 2016-11-08 23:57:34 +00:00
Mark Andrews
964e19cea8 4497. [port] Add support for OpenSSL 1.1.0. [RT #41284] 2016-11-09 09:59:32 +11:00
Tinderbox User
a06917d08f update copyright notice / whitespace 2016-11-02 23:51:39 +00:00