ruby-changes:42252
From: nagachika <ko1@a...>
Date: Tue, 29 Mar 2016 00:52:30 +0900 (JST)
Subject: [ruby-changes:42252] nagachika:r54326 (ruby_2_2): merge revision(s) 54004: [Backport #12152]
nagachika 2016-03-29 00:52:25 +0900 (Tue, 29 Mar 2016) New Revision: 54326 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54326 Log: merge revision(s) 54004: [Backport #12152] * 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. Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/test/rinda/test_rinda.rb branches/ruby_2_2/test/socket/test_basicsocket.rb branches/ruby_2_2/test/socket/test_sockopt.rb branches/ruby_2_2/version.h Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 54325) +++ ruby_2_2/version.h (revision 54326) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.5" #define RUBY_RELEASE_DATE "2016-03-29" -#define RUBY_PATCHLEVEL 268 +#define RUBY_PATCHLEVEL 269 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 3 Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 54325) +++ ruby_2_2/ChangeLog (revision 54326) @@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Tue Mar 29 00:44:55 2016 Rei Odaira <Rei.Odaira@g...> + + * 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. + Tue Mar 29 00:43:40 2016 Rei Odaira <Rei.Odaira@g...> * test/zlib/test_zlib.rb (test_adler32_combine, test_crc32_combine): Index: ruby_2_2/test/socket/test_basicsocket.rb =================================================================== --- ruby_2_2/test/socket/test_basicsocket.rb (revision 54325) +++ ruby_2_2/test/socket/test_basicsocket.rb (revision 54326) @@ -14,20 +14,28 @@ class TestSocket_BasicSocket < Test::Uni https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/socket/test_basicsocket.rb#L14 def test_getsockopt inet_stream do |s| - n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_TYPE) - assert_equal([Socket::SOCK_STREAM].pack("i"), n.data) - - n = s.getsockopt("SOL_SOCKET", "SO_TYPE") - assert_equal([Socket::SOCK_STREAM].pack("i"), n.data) - - n = s.getsockopt(:SOL_SOCKET, :SO_TYPE) - assert_equal([Socket::SOCK_STREAM].pack("i"), n.data) - - n = s.getsockopt(:SOCKET, :TYPE) - assert_equal([Socket::SOCK_STREAM].pack("i"), n.data) - - n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR) - assert_equal([0].pack("i"), n.data) + begin + n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_TYPE) + assert_equal([Socket::SOCK_STREAM].pack("i"), n.data) + + n = s.getsockopt("SOL_SOCKET", "SO_TYPE") + assert_equal([Socket::SOCK_STREAM].pack("i"), n.data) + + n = s.getsockopt(:SOL_SOCKET, :SO_TYPE) + assert_equal([Socket::SOCK_STREAM].pack("i"), n.data) + + n = s.getsockopt(:SOCKET, :TYPE) + assert_equal([Socket::SOCK_STREAM].pack("i"), n.data) + + n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR) + 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 class << val; self end.send(:define_method, :to_int) { Index: ruby_2_2/test/socket/test_sockopt.rb =================================================================== --- ruby_2_2/test/socket/test_sockopt.rb (revision 54325) +++ ruby_2_2/test/socket/test_sockopt.rb (revision 54326) @@ -23,12 +23,19 @@ class TestSocketOption < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/socket/test_sockopt.rb#L23 assert_equal(true, opt.bool) opt = Socket::Option.int(:INET, :SOCKET, :KEEPALIVE, 2) assert_equal(true, opt.bool) - Socket.open(:INET, :STREAM) {|s| - s.setsockopt(Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, true)) - assert_equal(true, s.getsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE).bool) - s.setsockopt(Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, false)) - assert_equal(false, s.getsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE).bool) - } + begin + Socket.open(:INET, :STREAM) {|s| + s.setsockopt(Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, true)) + assert_equal(true, s.getsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE).bool) + s.setsockopt(Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, false)) + 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 def test_ipv4_multicast_loop Index: ruby_2_2/test/rinda/test_rinda.rb =================================================================== --- ruby_2_2/test/rinda/test_rinda.rb (revision 54325) +++ ruby_2_2/test/rinda/test_rinda.rb (revision 54326) @@ -624,10 +624,17 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/rinda/test_rinda.rb#L624 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) @@ -659,10 +666,17 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/rinda/test_rinda.rb#L666 @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) @@ -754,6 +768,11 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/rinda/test_rinda.rb#L768 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 Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r54004 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/