summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2014-12-11 12:41:16 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2014-12-11 12:41:16 +0000
commit55cd1ddb2aca8a10a54314ac5537f605950e0e66 (patch)
tree2ebdc1de6a26c2078997cd2b113ac5e5239420a0 /t
parent0ea270705868ee1e849e32e28b30aa82caf25a0b (diff)
Fixed DNS reverse lookups to use getnameinfo
Diffstat (limited to 't')
-rwxr-xr-xt/test-custodian-util-dns.rb14
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.