ruby-changes:27870
From: drbrain <ko1@a...>
Date: Mon, 25 Mar 2013 07:02:06 +0900 (JST)
Subject: [ruby-changes:27870] drbrain:r39922 (trunk): * test/rinda/test_rinda.rb: Skip IPv6 tests if no IPv6 addresses
drbrain 2013-03-25 07:01:56 +0900 (Mon, 25 Mar 2013) New Revision: 39922 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39922 Log: * test/rinda/test_rinda.rb: Skip IPv6 tests if no IPv6 addresses exist. Skip fork-dependent test if fork is not available. [ruby-trunk - Bug #8159] Modified files: trunk/ChangeLog trunk/test/rinda/test_rinda.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 39921) +++ ChangeLog (revision 39922) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Mar 25 06:59:01 2013 Eric Hodel <drbrain@s...> + + * test/rinda/test_rinda.rb: Skip IPv6 tests if no IPv6 addresses + exist. Skip fork-dependent test if fork is not available. + [ruby-trunk - Bug #8159] + Sun Mar 24 10:38:24 2013 KOSAKI Motohiro <kosaki.motohiro@g...> * addr2line.c (putce): suppress unused return value warning. Index: test/rinda/test_rinda.rb =================================================================== --- test/rinda/test_rinda.rb (revision 39921) +++ test/rinda/test_rinda.rb (revision 39922) @@ -479,6 +479,7 @@ class TupleSpaceProxyTest < Test::Unit:: https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L479 end def test_take_bug_8215 + skip 'missing fork' unless have_fork? service = DRb.start_service(nil, @ts_base) uri = service.uri @@ -514,6 +515,13 @@ class TupleSpaceProxyTest < Test::Unit:: https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L515 Process.kill("TERM", take) if take end + def have_fork? + Process.fork {} + return true + rescue NotImplementedError + return false + end + @server = DRb.primary_server || DRb.start_service end @@ -552,6 +560,9 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L560 end def test_make_socket_ipv6_multicast + skip 'IPv6 not available' unless + Socket.ip_address_list.any? { |addrinfo| addrinfo.ipv6? } + begin v6mc = @rs.make_socket('ff02::1') rescue Errno::EADDRNOTAVAIL @@ -609,6 +620,9 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L620 end def test_make_socket_ipv6_multicast + skip 'IPv6 not available' unless + Socket.ip_address_list.any? { |addrinfo| addrinfo.ipv6? } + v6mc = @rf.make_socket('ff02::1') assert_equal(1, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_LOOP).int) @@ -622,6 +636,8 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L636 assert_equal(2, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).int) + return unless Socket.ip_address_list.any? { |addrinfo| addrinfo.ipv6? } + v6mc = @rf.make_socket('ff02::1') assert_equal(2, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_HOPS).int) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/