This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

test: internet/test-dns handle ESERVFAIL

ESERVFAIL is also an acceptable error code when failing to resolve a
domain.
  • Loading branch information...
1 parent 78a854f commit 265fdc8e91b5670c4ee57f7f641b9e2741c7ddc6 @tjfontaine tjfontaine committed Feb 25, 2014
Showing with 10 additions and 1 deletion.
  1. +10 −1 test/internet/test-dns.js
View
@@ -456,7 +456,16 @@ TEST(function test_lookup_failure(done) {
TEST(function test_resolve_failure(done) {
var req = dns.resolve4('nosuchhostimsure', function(err) {
assert(err instanceof Error);
- assert.strictEqual(err.code, 'ENOTFOUND'); // Silly error code...
+
+ switch(err.code) {
+ case 'ENOTFOUND':
+ case 'ESERVFAIL':
+ break;
+ default:
+ assert.strictEqual(err.code, 'ENOTFOUND'); // Silly error code...
+ break;
+ }
+
assert.strictEqual(err.hostname, 'nosuchhostimsure');
done();

0 comments on commit 265fdc8

Please sign in to comment.