From dccd1d2d31a84dbce6584c5dd8e8cf5909d577ef Mon Sep 17 00:00:00 2001 From: Brian White Date: Sat, 27 May 2017 20:32:17 -0400 Subject: [PATCH] test: improve dns internet test case 0.0.0.0 is more common than other special ipv4 addresses, so it is possible that we may not get ENOTFOUND for such addresses. Instead, this commit uses a less common address that is reserved for documentation (RFC) use only. PR-URL: https://github.com/nodejs/node/pull/13261 Reviewed-By: Roman Reiss Reviewed-By: James M Snell --- test/internet/test-dns.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/internet/test-dns.js b/test/internet/test-dns.js index fc001ff96533fc..3096fda5b1ee75 100644 --- a/test/internet/test-dns.js +++ b/test/internet/test-dns.js @@ -492,11 +492,12 @@ TEST(function test_lookupservice_invalid(done) { TEST(function test_reverse_failure(done) { - const req = dns.reverse('0.0.0.0', function(err) { + // 203.0.113.0/24 are addresses reserved for (RFC) documentation use only + const req = dns.reverse('203.0.113.0', function(err) { assert(err instanceof Error); assert.strictEqual(err.code, 'ENOTFOUND'); // Silly error code... - assert.strictEqual(err.hostname, '0.0.0.0'); - assert.ok(/0\.0\.0\.0/.test(err.message)); + assert.strictEqual(err.hostname, '203.0.113.0'); + assert.ok(/203\.0\.113\.0/.test(err.message)); done(); });