Review Board 1.7.16


DNS core unit tests

Review Request #4462 - Created March 6, 2015 and submitted

Mark Michelson
/team/group/dns/
Reviewers
asterisk-dev
Asterisk
This provides unit tests for the DNS core as described here: https://wiki.asterisk.org/wiki/display/~jcolp/Asterisk+DNS+API

By "core" this means the bare-bones functionality, such as being able to set and retrieve data on DNS queries. This also includes a mock resolver, whose intention is to ensure that resolver methods are called into when expected.

If you have ideas for tests that have not been included here, please mention them in your reviews. Some things that are not covered here:

* Recurring asynchronous queries, query sets, NAPTR, SRV, and TLSA are not covered by these tests. These are higher-level APIs on top of the DNS core and will be covered in separate test files.
* Nominal asynchronous DNS cancellation is tested here, but off-nominal is not. Off-nominal asynchronous cancellation falls into two basic categories: canceling when there is no query in flight and canceling after a query has completed. You can't test canceling when there is no query in flight because putting the query in flight is what gives you the query object that you would attempt to cancel in the first place. Testing canceling after the query has completed does not test the DNS core as much as it does a specific resolver implementation. Since the resolver implementation is in charge of threading, the core does not try to make any determination of whether it makes sense to be canceling a query or not.
All tests pass consistently, and they do not leak memory (as evidenced by MALLOC_DEBUG)
Review request changed
Updated (March 16, 2015, 10:37 a.m.)
  • changed from pending to submitted

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.