From f8152df5e815c98be702fe58753258b58f02c4ad Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 6 Sep 2015 20:47:41 -0700 Subject: [PATCH] test: expect error for test_lookup_ipv6_hint on FreeBSD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FreeBSD does not support the V4MAPPED flag so expect an error. This is a partial fix for https://github.com/nodejs/node/issues/2468. It only fixes it on FreeBSD. Failures on other platforms are due to other reasons and need to be fixed separately. PR-URL: https://github.com/nodejs/node/pull/2724 Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Johan Bergström Fixes: https://github.com/nodejs/node/issues/2468 --- test/internet/test-dns.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/internet/test-dns.js b/test/internet/test-dns.js index 796fd26c0a..1059a3239e 100644 --- a/test/internet/test-dns.js +++ b/test/internet/test-dns.js @@ -394,7 +394,19 @@ TEST(function test_lookup_ipv6_hint(done) { family: 6, hints: dns.V4MAPPED }, function(err, ip, family) { - if (err) throw err; + if (err) { + // FreeBSD does not support V4MAPPED + if (process.platform === 'freebsd') { + assert(err instanceof Error); + assert.strictEqual(err.code, 'EAI_BADFLAGS'); + assert.strictEqual(err.hostname, 'www.google.com'); + assert.ok(/getaddrinfo EAI_BADFLAGS/.test(err.message)); + done(); + return; + } else { + throw err; + } + } assert.ok(net.isIPv6(ip)); assert.strictEqual(family, 6);