Skip to content

Commit 779e14f

Browse files
Trottrvagg
authored andcommitted
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 #2468. It only fixes it on FreeBSD. Failures on other platforms are due to other reasons and need to be fixed separately. PR-URL: #2724 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Johan Bergström <[email protected]> Fixes: #2468
1 parent 1d75012 commit 779e14f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/internet/test-dns.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,19 @@ TEST(function test_lookup_ipv6_hint(done) {
394394
family: 6,
395395
hints: dns.V4MAPPED
396396
}, function(err, ip, family) {
397-
if (err) throw err;
397+
if (err) {
398+
// FreeBSD does not support V4MAPPED
399+
if (process.platform === 'freebsd') {
400+
assert(err instanceof Error);
401+
assert.strictEqual(err.code, 'EAI_BADFLAGS');
402+
assert.strictEqual(err.hostname, 'www.google.com');
403+
assert.ok(/getaddrinfo EAI_BADFLAGS/.test(err.message));
404+
done();
405+
return;
406+
} else {
407+
throw err;
408+
}
409+
}
398410
assert.ok(net.isIPv6(ip));
399411
assert.strictEqual(family, 6);
400412

0 commit comments

Comments
 (0)