Enable cross tests for Ruby library
diff --git a/test/known_failures_Linux.json b/test/known_failures_Linux.json
index be623cb..3340656 100644
--- a/test/known_failures_Linux.json
+++ b/test/known_failures_Linux.json
@@ -1437,6 +1437,48 @@
"py-py_multij_framed-ip-ssl",
"py-py_multij_http-ip-ssl",
"py-py_multij_zlib-ip-ssl",
+ "py-rb_accel-binary_buffered-domain",
+ "py-rb_accel-binary_buffered-ip",
+ "py-rb_accel-binary_buffered-ip-ssl",
+ "py-rb_accel-binary_framed-domain",
+ "py-rb_accel-binary_framed-ip",
+ "py-rb_accel-binary_framed-ip-ssl",
+ "py-rb_accel_buffered-domain",
+ "py-rb_accel_buffered-ip",
+ "py-rb_accel_buffered-ip-ssl",
+ "py-rb_accel_framed-domain",
+ "py-rb_accel_framed-ip",
+ "py-rb_accel_framed-ip-ssl",
+ "py-rb_accelc-compact_buffered-domain",
+ "py-rb_accelc-compact_buffered-ip",
+ "py-rb_accelc-compact_buffered-ip-ssl",
+ "py-rb_accelc-compact_framed-domain",
+ "py-rb_accelc-compact_framed-ip",
+ "py-rb_accelc-compact_framed-ip-ssl",
+ "py-rb_binary-accel_buffered-domain",
+ "py-rb_binary-accel_buffered-ip",
+ "py-rb_binary-accel_buffered-ip-ssl",
+ "py-rb_binary-accel_framed-domain",
+ "py-rb_binary-accel_framed-ip",
+ "py-rb_binary-accel_framed-ip-ssl",
+ "py-rb_binary_buffered-domain",
+ "py-rb_binary_buffered-ip",
+ "py-rb_binary_buffered-ip-ssl",
+ "py-rb_binary_framed-domain",
+ "py-rb_binary_framed-ip",
+ "py-rb_binary_framed-ip-ssl",
+ "py-rb_compact_buffered-domain",
+ "py-rb_compact_buffered-ip",
+ "py-rb_compact_buffered-ip-ssl",
+ "py-rb_compact_framed-domain",
+ "py-rb_compact_framed-ip",
+ "py-rb_compact_framed-ip-ssl",
+ "py-rb_json_buffered-domain",
+ "py-rb_json_buffered-ip",
+ "py-rb_json_buffered-ip-ssl",
+ "py-rb_json_framed-domain",
+ "py-rb_json_framed-ip",
+ "py-rb_json_framed-ip-ssl",
"py-rs_accel-binary_buffered-domain",
"py-rs_accel-binary_buffered-ip",
"py-rs_accel-binary_framed-domain",
@@ -1507,6 +1549,20 @@
"rb-netstd_json_buffered-ip-ssl",
"rb-netstd_json_framed-ip",
"rb-netstd_json_framed-ip-ssl",
+ "rb-py_accel-binary_buffered-ip-ssl",
+ "rb-py_accel-binary_framed-ip-ssl",
+ "rb-py_accel_buffered-ip-ssl",
+ "rb-py_accel_framed-ip-ssl",
+ "rb-py_binary-accel_buffered-ip-ssl",
+ "rb-py_binary-accel_framed-ip-ssl",
+ "rb-py_binary_buffered-ip-ssl",
+ "rb-py_binary_framed-ip-ssl",
+ "rb-py_compact-accelc_buffered-ip-ssl",
+ "rb-py_compact-accelc_framed-ip-ssl",
+ "rb-py_compact_buffered-ip-ssl",
+ "rb-py_compact_framed-ip-ssl",
+ "rb-py_json_buffered-ip-ssl",
+ "rb-py_json_framed-ip-ssl",
"rs-netstd_binary_buffered-ip",
"rs-netstd_binary_framed-ip",
"rs-netstd_compact_buffered-ip",
diff --git a/test/rb/core/test_accelerated_binary_protocol.rb b/test/rb/core/test_accelerated_binary_protocol.rb
new file mode 100644
index 0000000..7e1d9d6
--- /dev/null
+++ b/test/rb/core/test_accelerated_binary_protocol.rb
@@ -0,0 +1,29 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+require File.join(File.dirname(__FILE__), '../test_helper')
+
+require 'thrift'
+
+class TestThriftTransport < Test::Unit::TestCase
+ def test_accelerated_protocol
+ return if ENV['SKIP_BUILD_EXT'] == '1'
+ assert defined?(Thrift::BinaryProtocolAccelerated)
+ end
+end
diff --git a/test/rb/core/transport/test_transport.rb b/test/rb/core/transport/test_transport.rb
index 37afa85..d5967cb 100644
--- a/test/rb/core/transport/test_transport.rb
+++ b/test/rb/core/transport/test_transport.rb
@@ -20,14 +20,15 @@
require File.join(File.dirname(__FILE__), '../../test_helper')
require 'thrift'
+require 'stringio'
class DummyTransport < Thrift::BaseTransport
def initialize(data)
- @data = data
+ @data = StringIO.new(data)
end
def read(size)
- @data.slice!(0, size)
+ @data.read(size)
end
end
diff --git a/test/rb/integration/TestServer.rb b/test/rb/integration/TestServer.rb
index 3debaa3..afa6c2d 100755
--- a/test/rb/integration/TestServer.rb
+++ b/test/rb/integration/TestServer.rb
@@ -133,7 +133,7 @@
elsif a.start_with?("--transport")
transport = a.split("=")[1]
elsif a.start_with?("--port")
- port = a.split("=")[1].to_i
+ port = a.split("=")[1].to_i
end
end
@@ -166,12 +166,11 @@
keysDir = File.join(File.dirname(File.dirname(Dir.pwd)), "keys")
ctx = OpenSSL::SSL::SSLContext.new
ctx.ca_file = File.join(keysDir, "CA.pem")
- ctx.cert = OpenSSL::X509::Certificate.new(File.open(File.join(keysDir, "server.crt")))
+ ctx.cert = OpenSSL::X509::Certificate.new(File.binread(File.join(keysDir, "server.crt")))
ctx.cert_store = OpenSSL::X509::Store.new
ctx.cert_store.add_file(File.join(keysDir, 'client.pem'))
- ctx.key = OpenSSL::PKey::RSA.new(File.open(File.join(keysDir, "server.key")))
- ctx.options = OpenSSL::SSL::OP_NO_SSLv2 | OpenSSL::SSL::OP_NO_SSLv3
- ctx.ssl_version = :SSLv23
+ ctx.key = OpenSSL::PKey::RSA.new(File.binread(File.join(keysDir, "server.key")))
+ ctx.min_version = :TLS1_2
ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER
@transport = Thrift::SSLServerSocket.new(nil, port, ctx)
else