Report information
The Basics
Id:
46173
Status:
resolved
Priority:
Low/Low
Queue:

BugTracker
Version Fixed:
9.12.0
Version Found:
(no value)
Versions Affected:
(no value)
Versions Planned:
(no value)
Priority:
P3 Low
Severity:
S3 Low
CVSS Score:
(no value)
CVE ID:
(no value)
Component:
BIND Server
Area:
test

Dates
Created:Tue, 03 Oct 2017 15:57:44 -0400
Updated:Fri, 29 Jun 2018 03:58:56 -0400
Closed:Fri, 29 Jun 2018 03:58:55 -0400



This bug tracker is no longer active.

Please go to our Gitlab to submit issues (both feature requests and bug reports) for active projects maintained by Internet Systems Consortium (ISC).

Due to security and confidentiality requirements, full access is limited to the primary maintainers.

To: bind9-public@isc.org
Date: Tue, 03 Oct 2017 21:57:43 +0200
From: michal@isc.org
Subject: Add libns unit tests
Code refactoring carried out in RT #43929 and RT #45186 needs to be thoroughly unit tested to ensure no bugs were introduced in the process.
Branch rt46173: - extends lib/ns/tests/nstest.c with a few convenience functions, one of which allows easy creation of mock query contexts for specified query parameters, - implements a basic hook architecture for libns; while the primary objective of doing this was limiting unit test scope, implementation attempts to be as generic as possible due to Evan's suggestion from Jabber that such a concept might be useful in a wider context in the future, - uses the mechanisms mentioned above to implement unit tests for query_sfcache() and query_start(), - extends code comments for these two functions. I would personally recommend to review this commit by commit as these are laid out in a way which attempts to convey the process of putting all the involved parts together and most commits have log messages attached that provide additional context for introducing any given change. Code is also heavily commented. While only two functions are covered by the unit tests currently present in rt46173, the sheer amount of helper code added in that branch strongly indicates that a review is due, at least to sign off on the high-level approach to unit testing libns. If anyone finds the proposed techniques faulty, it will be better to make the necessary course correction now, before the line count for code that performs actual unit testing increases even more. Any thoughts on this are welcome.
It just occurred to me I should update status in the ticket... I reviewed this work via jabber the other evening. By and large I think it's excellent and should be merged. Sometime soon I'd like us to have a longer conversation about how this could be developed into the general-purpose hook architecture we had tentatively envisioned for 9.13. We may need to tweak the interface to allow for future uses and it would be better to do that now rather than later, when there may be many more unit tests that would need to be changed. However, that needn't prevent us from committing it now as it is. I made some specific suggestions for clarifications to the comments and am waiting for Michal to do those. Otherwise this is ok to merge.
Again, because we wanted to get this done in time for code freeze, I've gone ahead and merged. The comment revisions will have to be done later. One modification: NS_HOOKS_ENABLE is now set for both --with-atf and --enable-developer. 4772. [test] Expanded unit testing framework for libns, using hooks to interrupt query flow and inspect state at specified locations. [RT #46173] 9.12.0
Evan, I just pushed rt46173_addendum which extends hook documentation according to your review comments. Could you please take a look? Also, feel free to push any corrections you deem necessary to the branch. Once reviewed, I plan to commit these changes without a CHANGES note. Thanks!
> I just pushed rt46173_addendum which extends hook documentation > according to your review comments. Could you please take a look? Also, > feel free to push any corrections you deem necessary to the branch. > Once reviewed, I plan to commit these changes without a CHANGES note. This looks fine, please go ahead and commit.
Thanks, I merged rt46173_addendum into master without adding a CHANGES note, as announced before.