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

ruby-changes:40672

From: normal <ko1@a...>
Date: Thu, 26 Nov 2015 07:24:13 +0900 (JST)
Subject: [ruby-changes:40672] normal:r52751 (trunk): test/openssl/test_ssl.rb (test_copy_stream): new test

normal	2015-11-26 07:23:34 +0900 (Thu, 26 Nov 2015)

  New Revision: 52751

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

  Log:
    test/openssl/test_ssl.rb (test_copy_stream): new test
    
    I was worried r52750 would break IO.copy_stream with things like
    OpenSSL sockets which wrap IOs, but require data to be run through
    through encryption/decryption filters.  Apparently my worry
    was unfounded, but perhaps this test will ensure this case continues
    to work.

  Modified files:
    trunk/ChangeLog
    trunk/test/openssl/test_ssl.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52750)
+++ ChangeLog	(revision 52751)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Nov 26 07:22:55 2015  Eric Wong  <e@8...>
+
+	* test/openssl/test_ssl.rb (test_copy_stream): new test
+
 Wed Nov 25 21:23:39 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* io.c (copy_stream_body): try to_io conversion before read,
Index: test/openssl/test_ssl.rb
===================================================================
--- test/openssl/test_ssl.rb	(revision 52750)
+++ test/openssl/test_ssl.rb	(revision 52751)
@@ -178,6 +178,20 @@ class OpenSSL::TestSSL < OpenSSL::SSLTes https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl.rb#L178
     }
   end
 
+  def test_copy_stream
+    start_server(OpenSSL::SSL::VERIFY_NONE, true) do |server, port|
+      server_connect(port) do |ssl|
+        IO.pipe do |r, w|
+          str = "hello world\n"
+          w.write(str)
+          IO.copy_stream(r, ssl, str.bytesize)
+          IO.copy_stream(ssl, w, str.bytesize)
+          assert_equal str, r.read(str.bytesize)
+        end
+      end
+    end
+  end
+
   def test_client_auth_failure
     vflag = OpenSSL::SSL::VERIFY_PEER|OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT
     start_server(vflag, true, :ignore_listener_error => true){|server, port|

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

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