about summary refs log tree commit homepage
path: root/test/ipv6_enabled.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-03-01 16:36:44 -0800
committerEric Wong <normalperson@yhbt.net>2011-03-01 16:36:44 -0800
commit55efe20df7f2cf594786e16e890382208a114f65 (patch)
tree266f8ee2227617f7ade6a3be671bdd49782af274 /test/ipv6_enabled.rb
parent26558f816ecbe25955f549355aa57aef5959a22e (diff)
downloadraindrops-55efe20df7f2cf594786e16e890382208a114f65.tar.gz
Diffstat (limited to 'test/ipv6_enabled.rb')
-rw-r--r--test/ipv6_enabled.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ipv6_enabled.rb b/test/ipv6_enabled.rb
new file mode 100644
index 0000000..319fbef
--- /dev/null
+++ b/test/ipv6_enabled.rb
@@ -0,0 +1,10 @@
+def ipv6_enabled?
+  tmp = TCPServer.new(ENV["TEST_HOST6"] || '::1', 0)
+  tmp.close
+  true
+  rescue => e
+    warn "skipping IPv6 tests, host does not seem to be IPv6 enabled:"
+    warn "  #{e.class}: #{e}"
+    return false
+    ipv6_enabled = false
+end