summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:01:13 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:01:13 +0000
commit7473d89d4cb01a50921b9edcd262838b1adff437 (patch)
tree3db5a748047e3f1cf205c152a2df6ce026ab717b
parent5c3c1293fb00653166a01c20bad3fb1842f48e5b (diff)
Added more tests.
-rwxr-xr-xt/test-custodian-util-dns.rb20
1 files changed, 12 insertions, 8 deletions
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