mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
adde0a94a2
commit
1874524d42
4 changed files with 70 additions and 24 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
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.
|
||||||
|
|
||||||
Sat Mar 5 07:36:27 2016 Rei Odaira <Rei.Odaira@gmail.com>
|
Sat Mar 5 07:36:27 2016 Rei Odaira <Rei.Odaira@gmail.com>
|
||||||
|
|
||||||
* test/-ext-/float/test_nextafter.rb: In AIX,
|
* test/-ext-/float/test_nextafter.rb: In AIX,
|
||||||
|
|
|
@ -625,11 +625,18 @@ class TestRingServer < Test::Unit::TestCase
|
||||||
def test_make_socket_ipv4_multicast
|
def test_make_socket_ipv4_multicast
|
||||||
v4mc = @rs.make_socket('239.0.0.1')
|
v4mc = @rs.make_socket('239.0.0.1')
|
||||||
|
|
||||||
|
begin
|
||||||
if Socket.const_defined?(:SO_REUSEPORT) then
|
if Socket.const_defined?(:SO_REUSEPORT) then
|
||||||
assert(v4mc.getsockopt(:SOCKET, :SO_REUSEPORT).bool)
|
assert(v4mc.getsockopt(:SOCKET, :SO_REUSEPORT).bool)
|
||||||
else
|
else
|
||||||
assert(v4mc.getsockopt(:SOCKET, :SO_REUSEADDR).bool)
|
assert(v4mc.getsockopt(:SOCKET, :SO_REUSEADDR).bool)
|
||||||
end
|
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)
|
assert_equal('0.0.0.0', v4mc.local_address.ip_address)
|
||||||
assert_equal(@port, v4mc.local_address.ip_port)
|
assert_equal(@port, v4mc.local_address.ip_port)
|
||||||
|
@ -660,11 +667,18 @@ class TestRingServer < Test::Unit::TestCase
|
||||||
@rs = Rinda::RingServer.new(@ts, [['239.0.0.1', '0.0.0.0']], @port)
|
@rs = Rinda::RingServer.new(@ts, [['239.0.0.1', '0.0.0.0']], @port)
|
||||||
v4mc = @rs.instance_variable_get('@sockets').first
|
v4mc = @rs.instance_variable_get('@sockets').first
|
||||||
|
|
||||||
|
begin
|
||||||
if Socket.const_defined?(:SO_REUSEPORT) then
|
if Socket.const_defined?(:SO_REUSEPORT) then
|
||||||
assert(v4mc.getsockopt(:SOCKET, :SO_REUSEPORT).bool)
|
assert(v4mc.getsockopt(:SOCKET, :SO_REUSEPORT).bool)
|
||||||
else
|
else
|
||||||
assert(v4mc.getsockopt(:SOCKET, :SO_REUSEADDR).bool)
|
assert(v4mc.getsockopt(:SOCKET, :SO_REUSEADDR).bool)
|
||||||
end
|
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)
|
assert_equal('0.0.0.0', v4mc.local_address.ip_address)
|
||||||
assert_equal(@port, v4mc.local_address.ip_port)
|
assert_equal(@port, v4mc.local_address.ip_port)
|
||||||
|
@ -755,6 +769,11 @@ class TestRingFinger < Test::Unit::TestCase
|
||||||
v4 = @rf.make_socket('127.0.0.1')
|
v4 = @rf.make_socket('127.0.0.1')
|
||||||
|
|
||||||
assert(v4.getsockopt(:SOL_SOCKET, :SO_BROADCAST).bool)
|
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
|
ensure
|
||||||
v4.close if v4
|
v4.close if v4
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,6 +16,7 @@ class TestSocket_BasicSocket < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_getsockopt
|
def test_getsockopt
|
||||||
inet_stream do |s|
|
inet_stream do |s|
|
||||||
|
begin
|
||||||
n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_TYPE)
|
n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_TYPE)
|
||||||
assert_equal([Socket::SOCK_STREAM].pack("i"), n.data)
|
assert_equal([Socket::SOCK_STREAM].pack("i"), n.data)
|
||||||
|
|
||||||
|
@ -30,6 +31,13 @@ class TestSocket_BasicSocket < Test::Unit::TestCase
|
||||||
|
|
||||||
n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR)
|
n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR)
|
||||||
assert_equal([0].pack("i"), n.data)
|
assert_equal([0].pack("i"), n.data)
|
||||||
|
rescue Minitest::Assertion
|
||||||
|
s.close
|
||||||
|
if /aix/ =~ RUBY_PLATFORM
|
||||||
|
skip "Known bug in getsockopt(2) on AIX"
|
||||||
|
end
|
||||||
|
raise $!
|
||||||
|
end
|
||||||
|
|
||||||
val = Object.new
|
val = Object.new
|
||||||
class << val; self end.send(:define_method, :to_int) {
|
class << val; self end.send(:define_method, :to_int) {
|
||||||
|
|
|
@ -25,12 +25,19 @@ class TestSocketOption < Test::Unit::TestCase
|
||||||
assert_equal(true, opt.bool)
|
assert_equal(true, opt.bool)
|
||||||
opt = Socket::Option.int(:INET, :SOCKET, :KEEPALIVE, 2)
|
opt = Socket::Option.int(:INET, :SOCKET, :KEEPALIVE, 2)
|
||||||
assert_equal(true, opt.bool)
|
assert_equal(true, opt.bool)
|
||||||
|
begin
|
||||||
Socket.open(:INET, :STREAM) {|s|
|
Socket.open(:INET, :STREAM) {|s|
|
||||||
s.setsockopt(Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, true))
|
s.setsockopt(Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, true))
|
||||||
assert_equal(true, s.getsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE).bool)
|
assert_equal(true, s.getsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE).bool)
|
||||||
s.setsockopt(Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, false))
|
s.setsockopt(Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, false))
|
||||||
assert_equal(false, s.getsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE).bool)
|
assert_equal(false, s.getsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE).bool)
|
||||||
}
|
}
|
||||||
|
rescue TypeError
|
||||||
|
if /aix/ =~ RUBY_PLATFORM
|
||||||
|
skip "Known bug in getsockopt(2) on AIX"
|
||||||
|
end
|
||||||
|
raise $!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_ipv4_multicast_loop
|
def test_ipv4_multicast_loop
|
||||||
|
|
Loading…
Reference in a new issue