From 7473d89d4cb01a50921b9edcd262838b1adff437 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 9 Mar 2015 13:01:13 +0000 Subject: Added more tests. --- t/test-custodian-util-dns.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 't/test-custodian-util-dns.rb') diff --git a/t/test-custodian-util-dns.rb b/t/test-custodian-util-dns.rb index e5a83a6..f226efe 100755 --- a/t/test-custodian-util-dns.rb +++ b/t/test-custodian-util-dns.rb @@ -30,17 +30,21 @@ class TestDNSUtil < Test::Unit::TestCase # def test_lookup - # - # IPv6 lookup - # details = Custodian::Util::DNS.hostname_to_ip( "bytemark.co.uk" ) - assert( details == "80.68.81.80" ) + assert( ( details == "2001:41c9:0:1019:81::80" ) || + ( details == "80.68.81.80" ) ) - # - # IPv4 lookup - # details = Custodian::Util::DNS.hostname_to_ip( "www.bytemark.co.uk" ) - assert( details == "80.68.81.80" ) + assert( ( details == "2001:41c9:0:1019:81::80" ) || + ( details == "80.68.81.80" ) ) + + + details = Custodian::Util::DNS.hostname_to_ip( "ipv4.steve.org.uk" ) + assert( details == "80.68.84.103" ) + + details = Custodian::Util::DNS.hostname_to_ip( "ipv6.steve.org.uk" ) + assert( details == "2001:41c8:10b:103::10" ) + # # Failure case -- cgit v1.2.1