[前][次][番号順一覧][スレッド一覧]

ruby-changes:17345

From: shyouhei <ko1@a...>
Date: Mon, 27 Sep 2010 15:58:01 +0900 (JST)
Subject: [ruby-changes:17345] Ruby:r29350 (trunk): * test/net/http/test_https.rb: As always, localhost is not

shyouhei	2010-09-27 15:57:39 +0900 (Mon, 27 Sep 2010)

  New Revision: 29350

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29350

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/test/net/http/test_https.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29349)
+++ ChangeLog	(revision 29350)
@@ -1,3 +1,11 @@
+Mon Sep 27 15:54:03 2010  URABE Shyouhei  <shyouhei@r...>
+
+	* 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  <shyouhei@r...>
 
 	* test/net/imap/test_imap.rb: resurrection of r29259.
Index: test/net/http/test_https.rb
===================================================================
--- test/net/http/test_https.rb	(revision 29349)
+++ test/net/http/test_https.rb	(revision 29350)
@@ -40,6 +40,8 @@
     http.request_get("/") {|res|
       assert_equal($test_net_http_data, res.body)
     }
+  rescue SystemCallError
+    skip $!
   end
 
   def test_post
@@ -52,6 +54,8 @@
     http.request_post("/", data) {|res|
       assert_equal(data, res.body)
     }
+  rescue SystemCallError
+    skip $!
   end
 
   if ENV["RUBY_OPENSSL_TEST_ALL"]
@@ -72,13 +76,19 @@
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]