From 93fba33b47524f24b018c09b79a01712a5605093 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Mon, 27 Sep 2010 06:57:39 +0000 Subject: * test/net/http/test_https.rb: As always, localhost is not guaranteed to be resolved as 127.0.0.1. But a SSL certificate needs a socket to listen on a specific address where a CN resolves to. On situations where localhost is not 127.0.0.1, these tests are not possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ test/net/http/test_https.rb | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 34ec875b1f..93d2e40cfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Sep 27 15:54:03 2010 URABE Shyouhei + + * test/net/http/test_https.rb: As always, localhost is not + guaranteed to be resolved as 127.0.0.1. But a SSL + certificate needs a socket to listen on a specific address + where a CN resolves to. On situations where localhost is + not 127.0.0.1, these tests are not possible. + Mon Sep 27 15:25:05 2010 URABE Shyouhei * test/net/imap/test_imap.rb: resurrection of r29259. diff --git a/test/net/http/test_https.rb b/test/net/http/test_https.rb index f66f99ed41..95c63da750 100644 --- a/test/net/http/test_https.rb +++ b/test/net/http/test_https.rb @@ -40,6 +40,8 @@ class TestNetHTTPS < Test::Unit::TestCase http.request_get("/") {|res| assert_equal($test_net_http_data, res.body) } + rescue SystemCallError + skip $! end def test_post @@ -52,6 +54,8 @@ class TestNetHTTPS < Test::Unit::TestCase http.request_post("/", data) {|res| assert_equal(data, res.body) } + rescue SystemCallError + skip $! end if ENV["RUBY_OPENSSL_TEST_ALL"] @@ -72,13 +76,19 @@ class TestNetHTTPS < Test::Unit::TestCase http.request_get("/") {|res| assert_equal($test_net_http_data, res.body) } + rescue SystemCallError + skip $! end def test_certificate_verify_failure http = Net::HTTP.new("localhost", config("port")) http.use_ssl = true ex = assert_raise(OpenSSL::SSL::SSLError){ - http.request_get("/") {|res| } + begin + http.request_get("/") {|res| } + rescue SystemCallError + skip $! + end } assert_match(/certificate verify failed/, ex.message) end -- cgit v1.2.3