about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--test/unit/test_socket_helper.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unit/test_socket_helper.rb b/test/unit/test_socket_helper.rb
index abc177b..8992757 100644
--- a/test/unit/test_socket_helper.rb
+++ b/test/unit/test_socket_helper.rb
@@ -190,6 +190,8 @@ class TestSocketHelper < Test::Unit::TestCase
     name = "#@test_addr:#{port}"
     sock = bind_listen(name, :reuseport => true)
     cur = sock.getsockopt(Socket::SOL_SOCKET, SO_REUSEPORT).unpack('i')[0]
-    assert_equal 1, cur
-  end if defined?(SO_REUSEPORT)
+    assert_operator cur, :>, 0
+  rescue Errno::ENOPROTOOPT
+    # kernel does not support SO_REUSEPORT (older Linux)
+  end
 end