diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2014-12-11 12:41:16 +0000 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2014-12-11 12:41:16 +0000 |
commit | 38f6cfd44c2df433dbcaf85a7395589f4f09b8b5 (patch) | |
tree | d1ba7bea64d5cd9da477a13224773fa2a9be6523 /t | |
parent | b0b13535196a8746ee0a938dd9fd9c5a0dbcfca2 (diff) |
Fixed DNS reverse lookups to use getnameinfo
Diffstat (limited to 't')
-rwxr-xr-x | t/test-custodian-util-dns.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/t/test-custodian-util-dns.rb b/t/test-custodian-util-dns.rb index 40ebb99..a6db253 100755 --- a/t/test-custodian-util-dns.rb +++ b/t/test-custodian-util-dns.rb @@ -3,7 +3,7 @@ require 'custodian/util/dns' require 'test/unit' - +require 'pp' # @@ -34,13 +34,13 @@ class TestDNSUtil < Test::Unit::TestCase # IPv6 lookup # details = Custodian::Util::DNS.hostname_to_ip( "bytemark.co.uk" ) - assert( details == "212.110.161.236" ) + assert( details == "80.68.81.80" ) # # IPv4 lookup # details = Custodian::Util::DNS.hostname_to_ip( "www.bytemark.co.uk" ) - assert( details == "212.110.161.236" ) + assert( details == "80.68.81.80" ) # # Failure case @@ -59,14 +59,14 @@ class TestDNSUtil < Test::Unit::TestCase # # IPv6 lookup # - details = Custodian::Util::DNS.ip_to_hostname( "2001:41c8:2::5" ) - assert( details =~ /bytemark.co.uk/i ) + details = Custodian::Util::DNS.ip_to_hostname( "2001:41c9:0:1019:81::80" ) + assert( details =~ /bytemark(-?hosting)?\.(com|eu|co\.uk)$/i ) # # IPv4 lookup # - details = Custodian::Util::DNS.ip_to_hostname( "212.110.161.236" ) - assert( details =~ /bytemark.co.uk/i ) + details = Custodian::Util::DNS.ip_to_hostname( "80.68.81.80" ) + assert( details =~ /bytemark(-?hosting)?\.(com|eu|co\.uk)$/i ) # # Bogus lookup - should return nil. |