1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2025-10-05 14:59:30 +00:00
Commit Graph

1678 Commits

Author SHA1 Message Date
f4fe7371fb configure: run configure in 'test' too
Having the test dir completely stand-alone causes too many issues for
users and devs. It still needs to be built specifically.
2016-02-13 10:58:51 +01:00
18eeb34989 configure: build silently by default 2016-02-13 10:57:38 +01:00
85c865e655 buildconf: run test/buildconf too if present 2016-02-13 10:56:55 +01:00
f0d04b2909 test/configure: build silently by default 2016-02-13 10:56:28 +01:00
8d023b7d96 dist: Distribute README.md
Closes #42
2016-02-13 10:35:31 +01:00
4ef6817c76 Makefile.am: distribute the test dir too cares-1_11_0-rc1 2016-02-11 15:09:13 +01:00
80bda0e9a0 RELEASE-NOTES: synced with 385582bd14 2016-02-11 14:49:48 +01:00
385582bd14 ares_win32_init: make LoadLibrary work when using UNICODE too
Closes #17
2016-02-11 12:24:22 +01:00
7e17c22b0f Use "resolve" as synonym of "dns" in nsswitch.conf
Modern Linux systems may have libnss_resolve from systemd as the
resolver, which is then configured in /etc/nsswitch.conf with
the "resolve" keyword rather than "dns".

Fixes #33
2016-02-11 11:14:40 +00:00
ed7df969cd ares_set_socket_callback: make manpage match code
The code in ares_process.c that invokes the socket creation/connection
callback only checks for rc < 0, not for standard ares error codes.
2016-02-11 11:14:27 +00:00
d8a0182af5 Merge pull request #36 from AGWA-forks/master
Add ares_set_socket_configure_callback()
2016-02-11 09:53:23 +00:00
56cd98b9e4 test: Update init tests to match behaviour
Unreadable config files are now treated the same way
as absent config files.
2016-02-11 09:29:31 +00:00
e514088f96 Ignore fopen errors to use default values
After 46bb820be3 `init_by_resolv_conf`
errors are no longer swallowed in `ares_init_options`. This has exposed
a previously unknown bug in `lookups` initialization code.

If there is no lookup configuration in `resolv.conf`,
`init_by_resolv_conf` will attempt to read it from other files available
on the system. However, some of these files may have restricted
permissions (like `600`), which will lead to `EACCESS` errno, which in
turn is handled like a fatal error by `init_by_resolv_conf`.

However, it sounds illogical that this error should be handled as a
fatal. There is a `init_by_defaults` call that overrides `lookups` with
default value, and certainly possible absence of lookup information is
the reason why this function exists in a first place!

I suggest handling any `fopen` errors as non-fatal ones, allowing to
pick up the `lookups` value from different config files, or to pick up
default value.
2016-02-11 08:38:02 +00:00
2b6a1fbee7 Document callback type in man page for ares_set_socket_callback 2016-02-09 10:08:23 -08:00
11e37a92ef Add ares_set_socket_configure_callback()
This function sets a callback that is invoked after the socket is
created, but before the connection is established.  This is an ideal
time to customize various socket options.
2016-02-09 10:05:04 -08:00
87d641a907 test: ares_set_socket_callback failure behaviour 2016-02-09 16:14:37 +00:00
2bae2d56d7 test: Check ares_parse_txt_reply_ext() entrypoint 2016-02-04 10:09:22 +00:00
53c2186e18 txt: introduce ares_parse_txt_reply_ext
Introduce `ares_txt_ext` structure with an extra `record_start`
field, which indicates a start of a new TXT record, thus allowing to
differentiate the chunks in the same record, from a chunks in a
different record.

Introduce a new API method: `ares_parse_txt_reply_ext` that works with
this kind of struct.
2016-02-04 10:00:59 +00:00
0c4c1ca9bc doc: Update missed repo references 2016-02-02 11:33:16 +00:00
adc95e6bd6 doc: Update docs on contributing 2016-02-02 11:31:13 +00:00
03ba16fe7a test: Run command line tools in Travis
Do a quick execution of each of the command line tools
in the continuous integration build, so that any (say)
sanitizer failures show up.
2016-02-02 11:02:28 +00:00
3f301a6fe3 acountry: drop inert test
If ver_1 is true, then z0 and z1 must both be 'z', and so
(z0 != 'z' && z1 != 'z') can never be true.

CID 56879, pointed out by Coverity.
2016-02-02 10:56:54 +00:00
d4a549c78b doc: update badge locations to master repo 2016-02-02 10:48:15 +00:00
6f1862f884 test: Enable maintainer mode + debug in Travis 2016-02-02 10:33:27 +00:00
31ca57671e test: Add an iOS build target 2016-02-02 10:13:49 +00:00
c9579872c8 test: Ignore SIGPIPE in tests 2016-02-02 10:13:49 +00:00
86beb81892 test: More initialization tests 2016-02-02 10:13:49 +00:00
ff1f7a1c3c test: Improve containerized test mechanism
Aim is to ensure that code coverage information can escape the
container.  To do this:
 - Enter a new mount namespace too, so that we can...
 - Bind mount the expected source directory into the container
 - Share memory with the sub-process so coverage information is
   shared too.
2016-02-02 10:13:49 +00:00
b644412a66 test: Make contained tests easier to write 2016-02-02 10:13:49 +00:00
5dc450a4b3 test: Add framework for containerized testing
On Linux we can potentially use user and UTS namespaces to run  a test
in a pseudo-container with:
 - arbitrary filesystem (e.g. /etc/resolv.conf, /etc/nsswitch.conf, /etc/hosts)
 - arbitrary hostname/domainname.

Include a first pass at the framework code to allow this, along with a
first test case that uses the container.
2016-02-02 10:13:49 +00:00
439eb45cc0 test: Use a longer timeout for less flakiness
Having occasional test failures from timeout before multiple
queries can complete, so up the default timeout for the test
from 100ms to 1500ms.
2016-02-02 10:13:49 +00:00
78f9ec5515 test: Make failure tests more robust
Different platforms will do different numbers of allocations
in the processing of a given API call; just check that the
return code is either success or ENOMEM, and free off any
returned state in the former case.

Also cope with ECONNREFUSED as well as ENOTFOUND.
2016-02-02 10:13:48 +00:00
3478963873 test: Get test code building under Windows
- Initial nmake file based off library nmake file
 - Cast socket call arguments to (char *)
 - Use wrapper sclose() that maps to closesocket() or close()
 - Build a config.h indicating presence of headers
 - Conditionally include netdb.h
 - Remove unnecessary include of sys/socket.h
 - Force longer bitmask for allocation failure tracking
 - Call WSAStartup() / WSACleanup() in main()
 - Set TCP_NODELAY for mock server
 - Turn on tests in AppVeyor build
2016-02-02 10:13:48 +00:00
830e8fe2b3 test: Disable tests that manipulate env on Windows 2016-02-02 10:13:48 +00:00
d3bccff740 test: Move file lists into Makefile.inc
In preparation for a Win32 build of the test suite.
2016-02-02 10:13:48 +00:00
9edf9411c7 test: Add a simple multi-server test
Check rotate option does something
2016-02-02 10:13:48 +00:00
d448d6604f test: Allow for multiple mock servers
- Update the MockServer to allow separate specification of
   UDP and TCP ports
 - Have an array of mock servers listening on consecutive
   sets of ports.
 - Rename Process(fd) to ProcessFD(fd) to avoid confusion.
 - Initialize channel by using the new ares_set_servers_ports()
   entrypoint, so multiple ports on the same loopback address
   can be used.
2016-02-02 10:13:48 +00:00
92656bcc82 test: Update test for set/get_servers variants
Ports are significant in the _ports_ variant functions, so update test to cope.
2016-02-02 10:13:48 +00:00
3231480a85 test: Make GetNameServers() utility function port-aware
Also make it generally available.
2016-02-02 10:13:48 +00:00
e26a678f26 test: more testing, including of internal static functions 2016-02-02 10:13:48 +00:00
25adcc413e test: more tests, especially fallback processing
- Make mock server listen on UDP + TCP in parallel.
 - Test UDP->TCP fallback on truncation
 - Test EDNS->no-EDNS fallback
 - Test some environment init options
 - Test nonsense reply

test: short response
2016-02-02 10:13:48 +00:00
a05f240dea test: more tests, particularly of initialization 2016-02-02 10:13:48 +00:00
83839fde7a test: Run mock tests over both TCP and UDP
With the exception of a few tests that make use of the timed
retry aspect of UDP.
2016-02-02 10:13:48 +00:00
0c423efd78 test: Run mock tests over both IPv4 and IPv6 2016-02-02 10:13:48 +00:00
0ef56333a0 test: Add more tests for edge cases 2016-02-02 10:13:48 +00:00
ce3f896572 test: more nooks and crannies of pton functions 2016-02-02 10:13:48 +00:00
f939efe7df test: More tests for PTR parsing 2016-02-02 10:13:48 +00:00
a2c5b1d378 test: Use of HOSTALIAS environment variable 2016-02-02 10:13:48 +00:00
834c98e9d9 test: Add RAII utility classes for testing
- TempFile holds specific contents
 - EnvValue sets an environment variable
2016-02-02 10:13:48 +00:00
693e566b66 test: More search domain scenarios 2016-02-02 10:13:47 +00:00