summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--test/rinda/test_rinda.rb16
2 files changed, 22 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d0e10ec3f54..837207ad312 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Mar 25 06:59:01 2013 Eric Hodel <drbrain@segment7.net>
+
+ * 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@gmail.com>
* addr2line.c (putce): suppress unused return value warning.
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index d8eca04ed8b..82eb34568cc 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -479,6 +479,7 @@ class TupleSpaceProxyTest < Test::Unit::TestCase
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::TestCase
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::TestCase
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::TestCase
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::TestCase
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)