[前][次][番号順一覧][スレッド一覧]

ruby-changes:42299

From: naruse <ko1@a...>
Date: Tue, 29 Mar 2016 15:57:55 +0900 (JST)
Subject: [ruby-changes:42299] naruse:r54373 (ruby_2_3): merge revision(s) 54004: [Backport #12152]

naruse	2016-03-29 15:57:48 +0900 (Tue, 29 Mar 2016)

  New Revision: 54373

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54373

  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_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/test/rinda/test_rinda.rb
    branches/ruby_2_3/test/socket/test_basicsocket.rb
    branches/ruby_2_3/test/socket/test_sockopt.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 54372)
+++ ruby_2_3/version.h	(revision 54373)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.0"
 #define RUBY_RELEASE_DATE "2016-03-29"
-#define RUBY_PATCHLEVEL 30
+#define RUBY_PATCHLEVEL 31
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_3/test/socket/test_basicsocket.rb
===================================================================
--- ruby_2_3/test/socket/test_basicsocket.rb	(revision 54372)
+++ ruby_2_3/test/socket/test_basicsocket.rb	(revision 54373)
@@ -16,20 +16,28 @@ class TestSocket_BasicSocket < Test::Uni https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/socket/test_basicsocket.rb#L16
 
   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_3/test/socket/test_sockopt.rb
===================================================================
--- ruby_2_3/test/socket/test_sockopt.rb	(revision 54372)
+++ ruby_2_3/test/socket/test_sockopt.rb	(revision 54373)
@@ -25,12 +25,19 @@ class TestSocketOption < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/socket/test_sockopt.rb#L25
     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_3/test/rinda/test_rinda.rb
===================================================================
--- ruby_2_3/test/rinda/test_rinda.rb	(revision 54372)
+++ ruby_2_3/test/rinda/test_rinda.rb	(revision 54373)
@@ -625,10 +625,17 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/rinda/test_rinda.rb#L625
   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::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/rinda/test_rinda.rb#L667
     @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::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/rinda/test_rinda.rb#L769
     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
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 54372)
+++ ruby_2_3/ChangeLog	(revision 54373)
@@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Tue Mar 29 15:31:06 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 15:27:14 2016  Rei Odaira  <Rei.Odaira@g...>
 
 	* test/zlib/test_zlib.rb (test_adler32_combine, test_crc32_combine):

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r54004


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]