Commit Graph
11116 Commits
Author SHA1 Message Date
Evan Hunt 5f3ba36436 convert safe_test
(cherry picked from commit c1c8d8846f)
2018-11-14 22:12:47 -08:00
Evan Hunt 5640841732 convert radix_test
(cherry picked from commit 718ca3166c)
2018-11-14 22:10:33 -08:00
Evan Hunt 57d78a76e5 convert heap_test
(cherry picked from commit cc6ab2416b)
2018-11-14 22:10:14 -08:00
Evan Hunt f29a9d5bc5 convert parse_test
(cherry picked from commit a7c308df9c)
2018-11-14 22:08:50 -08:00
Evan Hunt 856add745a convert counter_test
(cherry picked from commit 52b86f0abe)
2018-11-14 22:08:50 -08:00
Evan Hunt 3095574c1c convert buffer_test
(cherry picked from commit 02a5db7631)
2018-11-14 22:08:49 -08:00
Evan Hunt c679b85424 convert aes_test
(cherry picked from commit dc88db015b)
2018-11-14 22:08:26 -08:00
Evan Hunt 8db9794322 convert listenlist_test; remove ATF from lib/ns/tests
(cherry picked from commit 79ac715763)
2018-11-14 22:04:39 -08:00
Evan Hunt fe4619b886 convert notify_test
(cherry picked from commit 48dc2831d7)
2018-11-14 22:04:38 -08:00
Evan Hunt 5b473f87b2 convert query_test
- also fixed a bug in openssldh_link.c that turned up in the process

(cherry picked from commit 318b340f5e)
2018-11-14 22:04:38 -08:00
Evan Hunt 1d76da4943 convert resconf_test; remove ATF from lib/irs/tests
(cherry picked from commit cec8c52cbe)
2018-11-14 22:04:38 -08:00
Evan Hunt 66fa5b9af6 convert parser_test; remove ATF from lib/isccfg/tests
(cherry picked from commit 7ec945bd41)
2018-11-14 22:04:38 -08:00
Evan Hunt 41831a7d24 assert if {isc,dns,ns}_test_begin() is called when a prior test is running
(cherry picked from commit d8766293ab)
2018-11-14 22:04:35 -08:00
Evan Hunt 03c7a096c6 remove .NOTPARALLEL so unit tests can build faster
(cherry picked from commit b434b0a4b6)
2018-11-14 21:54:43 -08:00
Evan Hunt cd5855378e add cmocka support to remaining unit test makefiles
- also cleaned up some existing test code

(cherry picked from commit 2afd18a2ce)
2018-11-14 21:53:50 -08:00
Mark AndrewsandEvan Hunt 5c47dd82ac uninitalize memory read on error path
(cherry picked from commit 4eadebe2b2)
2018-11-15 00:15:33 +00:00
Mark AndrewsandEvan Hunt 6b409b89cd errors initalizing badcaches were not caught or cleaned up on error paths
(cherry picked from commit 93776c4c81)
2018-11-15 00:15:29 +00:00
Mark AndrewsandEvan Hunt d7c484ac7a free tmpzonename and restart_master
(cherry picked from commit 50714a9b35)
2018-11-14 11:41:48 -08:00
Mark AndrewsandEvan Hunt 5f9fde54cc don't use 'typename' as it is reserved in C++ 2018-11-14 11:08:44 -08:00
Mark Andrews 97a108f00d remove lib/isc/tests/result_test as it is now cmocka
(cherry picked from commit 9024cf0c15)
2018-11-13 07:50:13 +11:00
Mark Andrews 433f77a5ef link in lib/isccc/tests/Kyuafile
(cherry picked from commit 9a59352b4c)
2018-11-13 07:49:11 +11:00
Mark Andrews 1e8cdc20f3 define CMOCKA_CFLAGS and CMOCKA_LIBS 2018-11-12 18:31:02 +11:00
Evan HuntandMark Andrews 0a2706b288 convert result tests to use CMocka instead of ATF
(cherry picked from commit 471110933a)
2018-11-12 15:10:52 +11:00
Mark Andrews 3bc66aa712 check result tables are complete
(cherry picked from commit 4f04a79250)
2018-11-12 15:09:37 +11:00
Ondřej SurýandMark Andrews 3223b1b540 Add support for cmocka assert testing by overriding REQUIRE/INSIST/... macros when UNIT_TESTING is defined
(cherry picked from commit 52731c000d)
2018-11-12 12:31:45 +11:00
Ondřej SurýandMark Andrews 3b2f9ceec6 Integrate cmocka unit testing framework to kyua
(cherry picked from commit 07910f0153)
2018-11-12 12:22:33 +11:00
Mark Andrews 4cc245abdc look in windows registry for nameservers, domainname and search list
(cherry picked from commit 6ead8c7be8)
2018-11-09 16:22:52 +11:00
Ondřej Surý a5e7901eb9 Properly use ATOMIC_*_LOCK_FREE preprocessor constants
The ATOMIC_*_LOCK_FREE can evalutate either 0, 1, or 2 which indicate the
lock-free property of the corresponding atomic types (both signed and unsigned).

	Value	Explanation
	-----	--------------------------------------
	  0	The atomic type is never lock-free
	  1	The atomic type is sometimes lock-free
	  2	The atomic type is always lock-free
	-----	--------------------------------------
2018-11-09 04:50:50 +07:00
Ondřej Surý 956d1bda02 isc_stdtime_t is always 32-bit now, so remove the always true macro STDTIME_ON_32BITS
(cherry picked from commit 6f5fe11f5a)
2018-11-09 02:56:49 +07:00
Ondřej Surý 8ffcef8435 Disable runtime detection of md5 and sha1 support for Utimaco HSM.
Utimaco HSM requires user to be logged in before executing DigestUpdate, thus
breaking dst_lib_init2 that ran isc_md5_check and isc_sha1_check before sending
PIN to the HSM.  Therefore isc_*_check needs to be disabled when Utimaco HSM is
being used as PKCS#11 library.

(cherry picked from commit 52784fc3cc)
2018-11-09 00:35:05 +07:00
Ondřej Surý 6610da90d1 Define PK11_UTIMACO_FLAVOR and add detection code to configure.ac
(cherry picked from commit 2079e44fb9)
2018-11-09 00:35:05 +07:00
Ondřej Surý bc7a1b00e9 fixup! Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached 2018-11-08 19:45:37 +07:00
Ondřej Surý 5ad72603a8 Remove dummy ISLOCKED macro
(cherry picked from commit 68ca987792)
2018-11-08 15:09:12 +07:00
Ondřej Surý 4568669807 Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached
(cherry picked from commit 23fff6c569)
2018-11-08 15:09:12 +07:00
Ondřej Surý ce6ef5b50e Modify the dbversion_test.c to detect disabled assertions
(cherry picked from commit b992b5b811)
2018-11-08 14:37:14 +07:00
Ondřej Surý 2a26189256 Add extra return failure after INSIST(0) in default branch
(cherry picked from commit 29c45200e7)
2018-11-08 14:37:14 +07:00
Ondřej Surý 65536fb10b Use larger buffers on snprintf buffer overflow false positives
(cherry picked from commit 4eaf927571)
2018-11-08 14:37:14 +07:00
Ondřej Surý 1e6329038b Don't assert on failed getrlimit call to allow called to handle this gracefully as it already does, just abort where we need to know the numbers
(cherry picked from commit e2e138a801)
2018-11-08 14:37:14 +07:00
Ondřej Surý 3d834566f1 When ISC assertions are disabled, still execute the condition to prevent unused variable warnings/errors from the compiler
(cherry picked from commit a831e0f72d)
2018-11-08 14:37:14 +07:00
Ondřej Surý fcd1569e2b Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool
(cherry picked from commit b2b43fd235)
2018-11-08 14:37:14 +07:00
Ondřej Surý b222783ae9 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 ==)

(cherry picked from commit fbd2e47f51)
2018-11-08 14:05:23 +07:00
Mark Andrews 5d1244a831 check requireservercookie even if rrl is configured
(cherry picked from commit d6f6eeda9d)
2018-11-06 10:20:43 +11:00
Evan Hunt d99a9db93a silence warning from missing print.h
(cherry picked from commit a0de6707c0)
2018-10-30 08:09:28 -07:00
Michał Kępień a21c1aacdf Fix isc_buffer_copyregion() for auto-reallocated buffers
While isc_buffer_copyregion() calls isc_buffer_reserve() to ensure the
target buffer will have enough available space to append the contents of
the source region to it, the variables used for subsequently checking
available space are not updated accordingly after that call.  This
prevents isc_buffer_copyregion() from working as expected for
auto-reallocated buffers: ISC_R_NOSPACE will be returned if enough space
is not already available in the target buffer before it is reallocated.
Fix by calling isc_buffer_used() and isc_buffer_availablelength()
directly instead of assigning their return values to local variables.

(cherry picked from commit e1f0aed034)
2018-10-30 13:33:42 +01:00
Michał Kępień 72caf33ffb Add unit tests for isc_buffer_copyregion()
Add some basic checks for isc_buffer_copyregion() to ensure it behaves
as expected for both fixed-size buffers and buffers which can be
automatically reallocated.  Adjust the list of headers included by
lib/isc/tests/buffer_test.c so that it matches what that test program
really uses.

(cherry picked from commit 15440d8027)
2018-10-30 13:33:42 +01:00
Witold Kręcicki c209bb1400 <stdlib.h> include in rpz.c for strtoul
(cherry picked from commit 8283cbabdc)
2018-10-30 06:51:47 +00:00
Michał KępieńandWitold Kręcicki 7258535655 Release all resources when shutting down an RPZ zone during an update
If an RPZ zone is to be freed during an update, canceling the
update_quantum() event is not enough because the resources released when
an update completes also need to be accounted for.  Failure to do this
results in a hang upon shutdown.  Fix by copying cleanup code from the
end of update_quantum() to rpz_detach().

(cherry picked from commit 139bc2c6ab)
2018-10-30 06:51:47 +00:00
Witold Kręcicki 384b3ef596 Fix a race in RPZ with min-update-interval set to 0
If another RPZ update is pending when processing the previous one nears
completion and min-update-interval is set to 0, isc_timer_reset() gets
called with 'interval' set to 0, which triggers an assertion failure.
To prevent such a scenario from causing a crash, queue the update event
directly instead of asking the timer thread to do it.

(cherry picked from commit faf2c7711a)
2018-10-30 06:51:40 +00:00
Mark Andrews 7074cbdacd compare_nxt compared records with identical next fields case insensitively
(cherry picked from commit cf83016682)
2018-10-30 15:09:45 +11:00
Mark Andrews bc53e5e5d4 move declaration of pending 2018-10-30 11:51:38 +11:00