summaryrefslogtreecommitdiff
path: root/test/rinda
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-25 20:49:36 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-25 20:49:36 +0000
commit7f6ef1f3d6fbf17801be8ab1111bfdf7208a616c (patch)
tree1ebe0094ef61b6660cd52a8914649f14ab3cbc3f /test/rinda
parent14dfb46b5f3b8f6c076701303400003baf7ed394 (diff)
Somehow Debian 6.0.7 needs ifname for IPv6 multicast connect
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rinda')
-rw-r--r--test/rinda/test_rinda.rb18
1 files changed, 14 insertions, 4 deletions
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index 25288d4..b275f7e 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -533,7 +533,7 @@ module RingIPv6
next unless ifaddr.addr.ipv6_linklocal?
next if ifaddr.name[0, 2] == "lo"
r.multicast_interface = ifaddr.ifindex
- return
+ return ifaddr
end
rescue NotImplementedError
# ifindex() function may not be implemented on Windows.
@@ -663,8 +663,13 @@ class TestRingFinger < Test::Unit::TestCase
end
def test_make_socket_ipv6_multicast
- prepare_ipv6(@rf)
- v6mc = @rf.make_socket('ff02::1')
+ ifaddr = prepare_ipv6(@rf)
+ begin
+ v6mc = @rf.make_socket("ff02::1")
+ rescue Errno::EINVAL
+ # somehow Debian 6.0.7 needs ifname
+ v6mc = @rf.make_socket("ff02::1%#{ifaddr.name}")
+ end
assert_equal(1, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_LOOP).int)
assert_equal(1, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_HOPS).int)
@@ -679,7 +684,12 @@ class TestRingFinger < Test::Unit::TestCase
def test_make_socket_ipv6_multicast_hops
prepare_ipv6(@rf)
@rf.multicast_hops = 2
- v6mc = @rf.make_socket('ff02::1')
+ begin
+ v6mc = @rf.make_socket("ff02::1")
+ rescue Errno::EINVAL
+ # somehow Debian 6.0.7 needs ifname
+ v6mc = @rf.make_socket("ff02::1%#{ifaddr.name}")
+ end
assert_equal(2, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_HOPS).int)
end