about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-08-11 12:46:27 -0700
committerEric Wong <normalperson@yhbt.net>2011-08-11 12:46:27 -0700
commit60d60a6fa716e91651997d86e3cb9cda41475975 (patch)
tree97ec76a36f7c57aace54b497a66160f5b7dd5750
parentec8a8f32d257290aac377f1c7b1c496e1df75f73 (diff)
downloadunicorn-60d60a6fa716e91651997d86e3cb9cda41475975.tar.gz
I don't build IPv6 into all my kernels; maybe other testers do
not, either.
-rw-r--r--test/unit/test_socket_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/unit/test_socket_helper.rb b/test/unit/test_socket_helper.rb
index 8ce1023..f099391 100644
--- a/test/unit/test_socket_helper.rb
+++ b/test/unit/test_socket_helper.rb
@@ -179,7 +179,11 @@ class TestSocketHelper < Test::Unit::TestCase
   end if defined?(TCP_DEFER_ACCEPT)
 
   def test_ipv6only
-    port = unused_port "#@test6_addr"
+    port = begin
+      unused_port "#@test6_addr"
+    rescue Errno::EINVAL
+      return
+    end
     sock = bind_listen "[#@test6_addr]:#{port}", :ipv6only => true
     cur = sock.getsockopt(:IPPROTO_IPV6, :IPV6_V6ONLY).unpack('i')[0]
     assert_equal 1, cur