The attached patch adds various tests for res_init and other initialization functions. Bugs 21474 (already fixed) and 21475 were discovered while writing these tests. I did not bother to fix bug 21475 (search path truncation) because it will be gone with a larger resolv.conf parser rewrite anyway. The tests use various namespace kludges to be able to test unmodified binaries, which have a hardcoded /etc/resolv.conf path. On current Fedora, no root privileges are required, which is why didn't make this an xtest. The patch as written depends on the subprocess capture functionality in the dynarray patch https://sourceware.org/ml/libc-alpha/2017-04/msg00498.html but I could cherry-pick the support functionality from there before committing (or use a different mechanism to capture the deserialized resolv.conf data, such as the new shared memory allocator). Comments? Thanks, Florian