summaryrefslogtreecommitdiff
path: root/test/internet
diff options
context:
space:
mode:
Diffstat (limited to 'test/internet')
-rw-r--r--test/internet/test-dns-ipv4.js21
-rw-r--r--test/internet/test-dns-ipv6.js19
2 files changed, 3 insertions, 37 deletions
diff --git a/test/internet/test-dns-ipv4.js b/test/internet/test-dns-ipv4.js
index 0781496392..06c1056a26 100644
--- a/test/internet/test-dns-ipv4.js
+++ b/test/internet/test-dns-ipv4.js
@@ -1,5 +1,5 @@
'use strict';
-const common = require('../common');
+require('../common');
const assert = require('assert');
const dns = require('dns');
const net = require('net');
@@ -173,24 +173,7 @@ TEST(function test_lookupservice_ip_ipv4(done) {
if (err) throw err;
assert.equal(typeof host, 'string');
assert(host);
-
- /*
- * Retrieve the actual HTTP service name as setup on the host currently
- * running the test by reading it from /etc/services. This is not ideal,
- * as the service name lookup could use another mechanism (e.g nscd), but
- * it's already better than hardcoding it.
- */
- var httpServiceName = common.getServiceName(80, 'tcp');
- if (!httpServiceName) {
- /*
- * Couldn't find service name, reverting to the most sensible default
- * for port 80.
- */
- httpServiceName = 'http';
- }
-
- assert.strictEqual(service, httpServiceName);
-
+ assert(['http', 'www', '80'].includes(service));
done();
});
diff --git a/test/internet/test-dns-ipv6.js b/test/internet/test-dns-ipv6.js
index 2929361f16..a9e46c8478 100644
--- a/test/internet/test-dns-ipv6.js
+++ b/test/internet/test-dns-ipv6.js
@@ -182,24 +182,7 @@ TEST(function test_lookupservice_ip_ipv6(done) {
if (err) throw err;
assert.equal(typeof host, 'string');
assert(host);
-
- /*
- * Retrieve the actual HTTP service name as setup on the host currently
- * running the test by reading it from /etc/services. This is not ideal,
- * as the service name lookup could use another mechanism (e.g nscd), but
- * it's already better than hardcoding it.
- */
- var httpServiceName = common.getServiceName(80, 'tcp');
- if (!httpServiceName) {
- /*
- * Couldn't find service name, reverting to the most sensible default
- * for port 80.
- */
- httpServiceName = 'http';
- }
-
- assert.strictEqual(service, httpServiceName);
-
+ assert(['http', 'www', '80'].includes(service));
done();
});