From 7d7400c87f04aa780257785672735a2708cc9339 Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Thu, 22 Oct 2015 12:17:55 -0700 Subject: [PATCH] test: use FQDN in getaddrinfo_fail test For the getaddrinfo_fail test cases you want to use a fully qualified domain name so that in network configurations that have a search domain the test will still fail. To create a fully qualified domain add a period at the end, see http://www.dns-sd.org/trailingdotsindomainnames.html for an explanation. Fixes: https://github.com/libuv/libuv/issues/583 PR-URL: https://github.com/libuv/libuv/pull/586 Reviewed-By: Ben Noordhuis --- test/test-getaddrinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test-getaddrinfo.c b/test/test-getaddrinfo.c index 45813c31..6b644a8d 100644 --- a/test/test-getaddrinfo.c +++ b/test/test-getaddrinfo.c @@ -83,10 +83,11 @@ static void getaddrinfo_cuncurrent_cb(uv_getaddrinfo_t* handle, TEST_IMPL(getaddrinfo_fail) { uv_getaddrinfo_t req; + /* Use a FQDN by ending in a period */ ASSERT(0 == uv_getaddrinfo(uv_default_loop(), &req, getaddrinfo_fail_cb, - "xyzzy.xyzzy.xyzzy", + "xyzzy.xyzzy.xyzzy.", NULL, NULL)); ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); @@ -100,10 +101,11 @@ TEST_IMPL(getaddrinfo_fail) { TEST_IMPL(getaddrinfo_fail_sync) { uv_getaddrinfo_t req; + /* Use a FQDN by ending in a period */ ASSERT(0 > uv_getaddrinfo(uv_default_loop(), &req, NULL, - "xyzzy.xyzzy.xyzzy", + "xyzzy.xyzzy.xyzzy.", NULL, NULL)); uv_freeaddrinfo(req.addrinfo);