From 55cd1ddb2aca8a10a54314ac5537f605950e0e66 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Thu, 11 Dec 2014 12:41:16 +0000 Subject: Fixed DNS reverse lookups to use getnameinfo --- t/test-custodian-util-dns.rb | 14 +++++++------- 1 file 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. -- cgit v1.2.1