summaryrefslogtreecommitdiff
path: root/test/internet/test-dns.js
diff options
context:
space:
mode:
authorJulien Gilli <julien.gilli@joyent.com>2014-07-29 18:06:47 -0700
committerTrevor Norris <trev.norris@gmail.com>2014-07-30 15:10:05 -0700
commit0381cf5698825a7e72de850bae0616e1108f21d3 (patch)
treede6590cc42b10cccc07e16296aea3735210c04ec /test/internet/test-dns.js
parent7166b55015261de8ab69758320f3d9159b3eaadd (diff)
downloadandroid-node-v8-0381cf5698825a7e72de850bae0616e1108f21d3.tar.gz
android-node-v8-0381cf5698825a7e72de850bae0616e1108f21d3.tar.bz2
android-node-v8-0381cf5698825a7e72de850bae0616e1108f21d3.zip
tests: fix internet/test-dns.js
internet/test-dns.js assumes that ::1 always resolves to "localhost" on all platforms. This is not what happens in reality. Some platforms resolve it to "ip6-localhost" too. There doesn't seem to be any consensus on what's the right thing to do. However, most sane platforms will use either one of these two values. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'test/internet/test-dns.js')
-rw-r--r--test/internet/test-dns.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/internet/test-dns.js b/test/internet/test-dns.js
index 0c5e436502..6165b30a3a 100644
--- a/test/internet/test-dns.js
+++ b/test/internet/test-dns.js
@@ -447,7 +447,14 @@ TEST(function test_lookupservice_ip_ipv4(done) {
TEST(function test_lookupservice_ip_ipv6(done) {
var req = dns.lookupService('::1', 80, function(err, host, service) {
if (err) throw err;
- assert.strictEqual(host, 'localhost');
+ /*
+ * On some systems, ::1 can be set to "localhost", on others it
+ * can be set to "ip6-localhost". There does not seem to be
+ * a consensus on that. Ultimately, it could be set to anything
+ * else just by changing /etc/hosts for instance, but it seems
+ * that most sane platforms use either one of these two by default.
+ */
+ assert(host === 'localhost' || host === 'ip6-localhost');
assert.strictEqual(service, 'http');
done();