ruby-changes:42194
From: usa <ko1@a...>
Date: Fri, 25 Mar 2016 17:41:15 +0900 (JST)
Subject: [ruby-changes:42194] usa:r54268 (ruby_2_1): merge revision(s) 54004: [Backport #12152]
usa 2016-03-25 17:41:11 +0900 (Fri, 25 Mar 2016) New Revision: 54268 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54268 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_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/test/rinda/test_rinda.rb branches/ruby_2_1/test/socket/test_basicsocket.rb branches/ruby_2_1/test/socket/test_sockopt.rb branches/ruby_2_1/version.h Index: ruby_2_1/test/socket/test_basicsocket.rb =================================================================== --- ruby_2_1/test/socket/test_basicsocket.rb (revision 54267) +++ ruby_2_1/test/socket/test_basicsocket.rb (revision 54268) @@ -14,20 +14,28 @@ class TestSocket_BasicSocket < Test::Uni https://github.com/ruby/ruby/blob/trunk/ruby_2_1/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_1/test/socket/test_sockopt.rb =================================================================== --- ruby_2_1/test/socket/test_sockopt.rb (revision 54267) +++ ruby_2_1/test/socket/test_sockopt.rb (revision 54268) @@ -23,12 +23,19 @@ class TestSocketOption < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/ruby_2_1/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_1/test/rinda/test_rinda.rb =================================================================== --- ruby_2_1/test/rinda/test_rinda.rb (revision 54267) +++ ruby_2_1/test/rinda/test_rinda.rb (revision 54268) @@ -610,10 +610,17 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/rinda/test_rinda.rb#L610 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) @@ -644,10 +651,17 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/rinda/test_rinda.rb#L651 @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) @@ -735,6 +749,13 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/rinda/test_rinda.rb#L749 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 def test_make_socket_ipv4_multicast Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 54267) +++ ruby_2_1/ChangeLog (revision 54268) @@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Fri Mar 25 17:36:24 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. + Fri Mar 25 17:35:06 2016 Rei Odaira <Rei.Odaira@g...> * test/zlib/test_zlib.rb (test_adler32_combine, test_crc32_combine): Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 54267) +++ ruby_2_1/version.h (revision 54268) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.9" #define RUBY_RELEASE_DATE "2016-03-25" -#define RUBY_PATCHLEVEL 465 +#define RUBY_PATCHLEVEL 466 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 3 Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r54004 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/