summaryrefslogtreecommitdiff
path: root/test/rinda
diff options
context:
space:
mode:
authorodaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-05 00:29:39 +0000
committerodaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-05 00:29:39 +0000
commit1874524d4269ccebafe6825373a19b1df16d7f38 (patch)
tree59009188eafd2a387261af7db6e7e1ab0008b677 /test/rinda
parentadde0a94a2828df8a28207a0d4c90ae97c7df9f2 (diff)
Sat Mar 5 09:17:54 2016 Rei Odaira <Rei.Odaira@gmail.com>
* test/rinda/test_rinda.rb (test_make_socket_ipv4_multicast): The fifth argument to getsockopt(2) should be modified to indicate the actual size of the value on return, but not in AIX. This is a know bug. Skip related tests. * test/rinda/test_rinda.rb (test_ring_server_ipv4_multicast): ditto. * test/rinda/test_rinda.rb (test_make_socket_unicast): ditto. * test/socket/test_basicsocket.rb (test_getsockopt): ditto. * test/socket/test_sockopt.rb (test_bool): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rinda')
-rw-r--r--test/rinda/test_rinda.rb35
1 files changed, 27 insertions, 8 deletions
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index 07de61438a8..d41276e8ec7 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -625,10 +625,17 @@ class TestRingServer < Test::Unit::TestCase
def test_make_socket_ipv4_multicast
v4mc = @rs.make_socket('239.0.0.1')
- if Socket.const_defined?(:SO_REUSEPORT) then
- assert(v4mc.getsockopt(:SOCKET, :SO_REUSEPORT).bool)
- else
- assert(v4mc.getsockopt(:SOCKET, :SO_REUSEADDR).bool)
+ begin
+ if Socket.const_defined?(:SO_REUSEPORT) then
+ assert(v4mc.getsockopt(:SOCKET, :SO_REUSEPORT).bool)
+ else
+ assert(v4mc.getsockopt(:SOCKET, :SO_REUSEADDR).bool)
+ end
+ rescue TypeError
+ if /aix/ =~ RUBY_PLATFORM
+ skip "Known bug in getsockopt(2) on AIX"
+ end
+ raise $!
end
assert_equal('0.0.0.0', v4mc.local_address.ip_address)
@@ -660,10 +667,17 @@ class TestRingServer < Test::Unit::TestCase
@rs = Rinda::RingServer.new(@ts, [['239.0.0.1', '0.0.0.0']], @port)
v4mc = @rs.instance_variable_get('@sockets').first
- if Socket.const_defined?(:SO_REUSEPORT) then
- assert(v4mc.getsockopt(:SOCKET, :SO_REUSEPORT).bool)
- else
- assert(v4mc.getsockopt(:SOCKET, :SO_REUSEADDR).bool)
+ begin
+ if Socket.const_defined?(:SO_REUSEPORT) then
+ assert(v4mc.getsockopt(:SOCKET, :SO_REUSEPORT).bool)
+ else
+ assert(v4mc.getsockopt(:SOCKET, :SO_REUSEADDR).bool)
+ end
+ rescue TypeError
+ if /aix/ =~ RUBY_PLATFORM
+ skip "Known bug in getsockopt(2) on AIX"
+ end
+ raise $!
end
assert_equal('0.0.0.0', v4mc.local_address.ip_address)
@@ -755,6 +769,11 @@ class TestRingFinger < Test::Unit::TestCase
v4 = @rf.make_socket('127.0.0.1')
assert(v4.getsockopt(:SOL_SOCKET, :SO_BROADCAST).bool)
+ rescue TypeError
+ if /aix/ =~ RUBY_PLATFORM
+ skip "Known bug in getsockopt(2) on AIX"
+ end
+ raise $!
ensure
v4.close if v4
end