From: Azat Khuzhin Date: Sun, 21 Oct 2018 00:03:25 +0000 (+0300) Subject: Do not rely on getservbyname() for most of the dns regression tests X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2cb8eae7958fd9adceba32e67a146925880d8571;p=libevent Do not rely on getservbyname() for most of the dns regression tests There is only one test that uses service name getaddrinfo_async, which manually check whether it works or not, other should not assume that it is available and works. There was already an attempt to overcome some possible limitations, like lack of "http" in /etc/services in d6bafbbeb27ff3943d6f3b6783bcded76384c31e ("test/dns: replace servname since solaris does not have "http"") --- diff --git a/test/regress_dns.c b/test/regress_dns.c index fbdf827b..9a3f88dc 100644 --- a/test/regress_dns.c +++ b/test/regress_dns.c @@ -2112,7 +2112,7 @@ dns_client_fail_requests_getaddrinfo_test(void *arg) tt_assert(!evdns_base_nameserver_ip_add(dns, buf)); for (i = 0; i < 20; ++i) - tt_assert(evdns_getaddrinfo(dns, "foof.example.com", "ssh", NULL, getaddrinfo_cb, &r[i])); + tt_assert(evdns_getaddrinfo(dns, "foof.example.com", "80", NULL, getaddrinfo_cb, &r[i])); n_replies_left = 20; exit_base = base; @@ -2236,7 +2236,7 @@ getaddrinfo_race_gotresolve_test(void *arg) rp.locked = 1; for (i = 0; i < n_reqs; ++i) { - tt_assert(evdns_getaddrinfo(rp.dns, "foof.example.com", "ssh", NULL, race_gai_cb, &rp)); + tt_assert(evdns_getaddrinfo(rp.dns, "foof.example.com", "80", NULL, race_gai_cb, &rp)); // This magic along with busy-wait threads make this thread yield frequently if (i % 100 == 0) { tv.tv_sec = 0;