From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS12876 195.154.0.0/16 X-Spam-Status: No, score=-2.0 required=3.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_XBL shortcircuit=no autolearn=no version=3.3.2 X-Original-To: spew@80x24.org Received: from 80x24.org (tor-exit.gansta93.com [195.154.56.44]) by dcvr.yhbt.net (Postfix) with ESMTP id 50DF020469 for ; Wed, 25 Nov 2015 21:52:21 +0000 (UTC) From: Eric Wong To: spew@80x24.org Subject: [PATCH] test/openssl/test_ssl.rb (test_copy_stream): new test Date: Wed, 25 Nov 2015 21:52:19 +0000 Message-Id: <20151125215219.3102-1-e@80x24.org> List-Id: 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. --- test/openssl/test_ssl.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb index 9e98a21..06e8d96 100644 --- a/test/openssl/test_ssl.rb +++ b/test/openssl/test_ssl.rb @@ -178,6 +178,20 @@ def test_read_and_write } 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| -- EW