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

ruby-changes:45237

From: normal <ko1@a...>
Date: Thu, 12 Jan 2017 08:53:09 +0900 (JST)
Subject: [ruby-changes:45237] normal:r57310 (trunk): test/rinda/test_rinda: skip multicast tests for unsupported systems

normal	2017-01-12 08:53:05 +0900 (Thu, 12 Jan 2017)

  New Revision: 57310

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

  Log:
    test/rinda/test_rinda: skip multicast tests for unsupported systems
    
    This allows "test-all" to pass on systems without multicast
    support.  I leave CONFIG_IP_MULTICAST unset in my Linux kernel
    .config, nowadays.

  Modified files:
    trunk/test/rinda/test_rinda.rb
Index: test/rinda/test_rinda.rb
===================================================================
--- test/rinda/test_rinda.rb	(revision 57309)
+++ test/rinda/test_rinda.rb	(revision 57310)
@@ -643,7 +643,11 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L643
   end
 
   def test_make_socket_ipv4_multicast
-    v4mc = @rs.make_socket('239.0.0.1')
+    begin
+      v4mc = @rs.make_socket('239.0.0.1')
+    rescue Errno::ENOBUFS => e
+      skip "Missing multicast support in OS: #{e.message}"
+    end
 
     begin
       if Socket.const_defined?(:SO_REUSEPORT) then
@@ -670,6 +674,8 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L674
       v6mc = @rs.make_socket('ff02::1')
     rescue Errno::EADDRNOTAVAIL
       return # IPv6 address for multicast not available
+    rescue Errno::ENOBUFS => e
+      skip "Missing multicast support in OS: #{e.message}"
     end
 
     if Socket.const_defined?(:SO_REUSEPORT) then
@@ -684,7 +690,12 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L690
 
   def test_ring_server_ipv4_multicast
     @rs.shutdown
-    @rs = Rinda::RingServer.new(@ts, [['239.0.0.1', '0.0.0.0']], @port)
+    begin
+      @rs = Rinda::RingServer.new(@ts, [['239.0.0.1', '0.0.0.0']], @port)
+    rescue Errno::ENOBUFS => e
+      skip "Missing multicast support in OS: #{e.message}"
+    end
+
     v4mc = @rs.instance_variable_get('@sockets').first
 
     begin

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

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