HomeFreeBSD

libc/tests: add getaddrinfo test

Description

libc/tests: add getaddrinfo test

A test suite for getaddrinfo(3) written in C. Unlike NetBSD test, this
one will be mostly focused on what the API should return when something
isn't good with your DNS. Test emulates bad DNS servers in resolv.conf
intercepting fopen(2) and emulates downed network intercepting send(2).

Initial version covers three main scenarios: all good, server(s) timed
out, network down. For each scenario we test hostname with trailing dot
and without, since libc resolver uses quite different code paths,
sometimes even yielding with different error codes. All current error
codes in the test are what our libc returns right now, meaning the test
documents what we have, not what there should be.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D49410

Details

Provenance
glebiusAuthored on Fri, Mar 28, 9:34 PM
Reviewer
kib
Differential Revision
D49410: libc/tests: add getaddrinfo test
Parents
rG0b773a94ab9a: libc/tests: enable getaddrinfo(1) tests from NetBSD
Branches
Unknown
Tags
Unknown