aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-13 05:18:49 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-13 05:18:49 +0000
commiteeb036c4e9861b4677c1806b944cba274adfd816 (patch)
treeecc753002cf6dc817b5b241b11b1c164bbcc222b /test
parent50eaa6b7a03370282811a2ef6712884b04d45ac7 (diff)
downloadruby-eeb036c4e9861b4677c1806b944cba274adfd816.tar.gz
tests: support Linux kernels with CONFIG_IPV6=n
Detecting the presence of constants in C headers is insufficient, as a Linux kernel can be built with CONFIG_IPV6=n git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/socket/test_udp.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/socket/test_udp.rb b/test/socket/test_udp.rb
index bec2181918..f060b65f2c 100644
--- a/test/socket/test_udp.rb
+++ b/test/socket/test_udp.rb
@@ -20,9 +20,13 @@ class TestSocket_UDPSocket < Test::Unit::TestCase
assert_match(/AF_INET\b/, sock.inspect)
}
if Socket.const_defined?(:AF_INET6)
- UDPSocket.open(Socket::AF_INET6) {|sock|
- assert_match(/AF_INET6\b/, sock.inspect)
- }
+ begin
+ UDPSocket.open(Socket::AF_INET6) {|sock|
+ assert_match(/AF_INET6\b/, sock.inspect)
+ }
+ rescue Errno::EAFNOSUPPORT
+ skip 'AF_INET6 not supported by kernel'
+ end
end
end