summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-24 22:01:56 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-24 22:01:56 +0000
commit77b885264bda990e13fe385199f31c90e0ae668a (patch)
treea88e6dafd872d521dd2a4f17e34a1598f25f5370
parentb95336b2fe56585ab585ca7c17fbad4c145e9e2b (diff)
* 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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 d0e10ec3f5..837207ad31 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 d8eca04ed8..82eb34568c 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)