test: expect error for test_lookup_ipv6_hint on FreeBSD

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 <thechargingvolcano@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Fixes: https://github.com/nodejs/node/issues/2468
pull/2775/head
Rich Trott 2015-09-06 20:47:41 -07:00
parent 380a3d89c3
commit f8152df5e8
1 changed files with 13 additions and 1 deletions

View File

@ -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);