[asterisk-dev] [Code Review] 4462: DNS core unit tests

Mark Michelson reviewboard at asterisk.org
Fri Mar 6 15:02:42 CST 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4462/
-----------------------------------------------------------

Review request for Asterisk Developers.


Repository: Asterisk


Description
-------

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.


Diffs
-----

  /trunk/tests/test_dns.c PRE-CREATION 

Diff: https://reviewboard.asterisk.org/r/4462/diff/


Testing
-------

All tests pass consistently, and they do not leak memory (as evidenced by MALLOC_DEBUG)


Thanks,

Mark Michelson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150306/c3918c75/attachment.html>


More information about the asterisk-dev mailing list