summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2023-08-31 21:34:50 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-09-06 19:20:57 +0900
commit912f1cda0d2ddfb4e6a52d43952a0562cb0fb46d (patch)
treea2888d1fdc717919a912c67e70faa9515cf95854 /test
parent779cab66552af44fcd709af633e1a8d68ccd7740 (diff)
[ruby/openssl] Remove OSSL_DEBUG compile-time option
Remove the OSSL_DEBUG flag and OpenSSL.mem_check_start which is only compiled when the flag is given. They are meant purely for development of Ruby/OpenSSL. OpenSSL.mem_check_start helped us find memory leak bugs in past, but it is no longer working with the recent OpenSSL versions. Let's just remove it now. https://github.com/ruby/openssl/commit/8c7a6a17e2
Diffstat (limited to 'test')
-rw-r--r--test/openssl/test_engine.rb2
-rw-r--r--test/openssl/test_fips.rb6
-rw-r--r--test/openssl/test_provider.rb2
-rw-r--r--test/openssl/utils.rb20
4 files changed, 5 insertions, 25 deletions
diff --git a/test/openssl/test_engine.rb b/test/openssl/test_engine.rb
index 15434218d9..b6025f915b 100644
--- a/test/openssl/test_engine.rb
+++ b/test/openssl/test_engine.rb
@@ -82,7 +82,7 @@ class OpenSSL::TestEngine < OpenSSL::TestCase
# this is required because OpenSSL::Engine methods change global state
def with_openssl(code, **opts)
- assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;", **opts)
+ assert_separately(["-ropenssl"], <<~"end;", **opts)
#{code}
end;
end
diff --git a/test/openssl/test_fips.rb b/test/openssl/test_fips.rb
index dfc1729b35..43042beab8 100644
--- a/test/openssl/test_fips.rb
+++ b/test/openssl/test_fips.rb
@@ -9,7 +9,7 @@ class OpenSSL::TestFIPS < OpenSSL::TestCase
omit "Only for FIPS mode environment"
end
- assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;")
+ assert_separately(["-ropenssl"], <<~"end;")
assert OpenSSL.fips_mode == true, ".fips_mode should return true on FIPS mode enabled"
end;
end
@@ -19,7 +19,7 @@ class OpenSSL::TestFIPS < OpenSSL::TestCase
omit "Only for non-FIPS mode environment"
end
- assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;")
+ assert_separately(["-ropenssl"], <<~"end;")
message = ".fips_mode should return false on FIPS mode disabled. " \
"If you run the test on FIPS mode, please set " \
"TEST_RUBY_OPENSSL_FIPS_ENABLED=true"
@@ -35,7 +35,7 @@ class OpenSSL::TestFIPS < OpenSSL::TestCase
def test_fips_mode_get_with_fips_mode_set
omit('OpenSSL is not FIPS-capable') unless OpenSSL::OPENSSL_FIPS
- assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;")
+ assert_separately(["-ropenssl"], <<~"end;")
begin
OpenSSL.fips_mode = true
assert OpenSSL.fips_mode == true, ".fips_mode should return true when .fips_mode=true"
diff --git a/test/openssl/test_provider.rb b/test/openssl/test_provider.rb
index 3040a4be9f..d0e6678587 100644
--- a/test/openssl/test_provider.rb
+++ b/test/openssl/test_provider.rb
@@ -58,7 +58,7 @@ class OpenSSL::TestProvider < OpenSSL::TestCase
# this is required because OpenSSL::Provider methods change global state
def with_openssl(code, **opts)
- assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;", **opts)
+ assert_separately(["-ropenssl"], <<~"end;", **opts)
#{code}
end;
end
diff --git a/test/openssl/utils.rb b/test/openssl/utils.rb
index 3d4d05fe02..269a111dbf 100644
--- a/test/openssl/utils.rb
+++ b/test/openssl/utils.rb
@@ -4,26 +4,6 @@ begin
rescue LoadError
end
-# Compile OpenSSL with crypto-mdebug and run this test suite with OSSL_MDEBUG=1
-# environment variable to enable memory leak check.
-if ENV["OSSL_MDEBUG"] == "1"
- if OpenSSL.respond_to?(:print_mem_leaks)
- OpenSSL.mem_check_start
-
- END {
- GC.start
- case OpenSSL.print_mem_leaks
- when nil
- warn "mdebug: check what is printed"
- when true
- raise "mdebug: memory leaks detected"
- end
- }
- else
- warn "OSSL_MDEBUG=1 is specified but OpenSSL is not built with crypto-mdebug"
- end
-end
-
require "test/unit"
require "tempfile"
require "socket"