From 55efe20df7f2cf594786e16e890382208a114f65 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 1 Mar 2011 16:36:44 -0800 Subject: tests: cleaner skipping for missing components --- test/test_linux_ipv6.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'test/test_linux_ipv6.rb') diff --git a/test/test_linux_ipv6.rb b/test/test_linux_ipv6.rb index e2886ac..bd24cab 100644 --- a/test/test_linux_ipv6.rb +++ b/test/test_linux_ipv6.rb @@ -4,17 +4,9 @@ require 'tempfile' require 'raindrops' require 'socket' require 'pp' +require "./test/ipv6_enabled" $stderr.sync = $stdout.sync = true -begin - tmp = TCPServer.new(ENV["TEST_HOST6"] || '::1', 0) - ipv6_enabled = true -rescue => e - warn "skipping IPv6 tests, host does not seem to be IPv6 enabled:" - warn " #{e.class}: #{e}" - ipv6_enabled = false -end - class TestLinuxIPv6 < Test::Unit::TestCase include Raindrops::Linux @@ -158,4 +150,4 @@ class TestLinuxIPv6 < Test::Unit::TestCase statuses = Process.waitall statuses.each { |(pid,status)| assert status.success?, status.inspect } end if ENV["STRESS"].to_i != 0 -end if RUBY_PLATFORM =~ /linux/ && ipv6_enabled +end if RUBY_PLATFORM =~ /linux/ && ipv6_enabled? -- cgit v1.2.3-24-ge0c7