tests: Use standard function name

The test used a name macros on most (but not all, OSX is an exception)
platforms unroll to. It's better to use the name that's normally in the
header.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
tests: Fix test_res_init on platforms with no v6 nsaddrs

On platforms that don't support IPv6, the v6 address is skipped and we
end up reading three v4 addresses.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
rwrap: OS X uses a different symbol prefix

Most platforms use __res_ as a prefix. Mac OS X uses res_9_. This
patch makes resolv_wrapper compilable on Mac OS X.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
tests: Add a simple DNS server

This DNS server will be usable for testing. Currently only supports A
records.

The server responds to any A query with the value of RWRAP_TEST_A_REC
environment variable. If undefined, the server always replies with
127.0.10.10.

Please note the server does *not* perform many security checks and is
completely unsuitable outside a test suite! Check out servers like
dnsmasq for anything more complex.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
tests: Add torture library from socket_wrapper

Pretty much a blatant copy of the torture library from socket_wrapper,
just s/echo_srv/dns_srv/

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
tests: Add generating resolv.conf to torture
tests: Add a unit test for res_query
torture fix