getaddrinfo tests: Skip when DNS resolution is unavailable

* tests/test-getaddrinfo.c (simple): Skip tests for unavailable DNS.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
This commit is contained in:
Zineb Zaadoud
2026-06-30 18:16:51 +02:00
committed by Simon Josefsson
parent 9567ff80cc
commit 48c984ad10
2 changed files with 15 additions and 0 deletions
+5
View File
@@ -1,3 +1,8 @@
2026-06-30 Zineb Zaadoud <zineb.zaadoud@canonical.com> (tiny change)
getaddrinfo: Skip when DNS resolution is unavailable
* tests/test-getaddrinfo.c (simple): Skip tests for unavailable DNS.
2026-06-26 Paul Eggert <eggert@cs.ucla.edu>
strfmon_l: be consistent about unsigned vs size_t
+10
View File
@@ -120,6 +120,16 @@ simple (int pass, char const *host, char const *service)
fprintf (stderr, "skipping getaddrinfo test: no network?\n");
return 77;
}
/* EAI_NONAME can be returned in sandboxed build environments where
DNS resolution is unavailable. Treat it like EAI_AGAIN and skip. */
if (res == EAI_NONAME)
{
skip++;
fprintf (stderr, "skipping getaddrinfo test: no DNS resolver?\n");
return 77;
}
/* Solaris reports EAI_SERVICE for "http" and "https". Don't
fail the test merely because of this. */
if (res == EAI_SERVICE)