]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Exclude some tests from valgrind
authorNeil Horman <nhorman@openssl.org>
Thu, 15 Jan 2026 18:27:34 +0000 (13:27 -0500)
committerNeil Horman <nhorman@openssl.org>
Thu, 29 Jan 2026 16:37:17 +0000 (11:37 -0500)
Some tests (liek the mem_alloc and abort tests do things with malloc
intentionally as sanity checks that valgrind complains about, and so we
just shouldn't run those tests under valgrind at all

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Thu Jan 29 16:37:30 2026
(Merged from https://github.com/openssl/openssl/pull/29573)

test/recipes/01-test_abort.t
test/recipes/02-test_mem_alloc.t
test/recipes/02-test_mem_alloc_custom_fns.t
test/recipes/90-test_memleak.t
test/recipes/90-test_threads.t

index f7e066bd478622c89bbc6546290849e17beb70b9..55c8c27be22bea8022c0379d22298e0608ab8d57 100644 (file)
@@ -8,9 +8,14 @@
 
 
 use OpenSSL::Test;
+use OpenSSL::Test::Utils;
+use OpenSSL::Test::Simple;
 
 setup("test_abort");
 
+plan skip_all => "This test should not be run under valgrind"
+    if ( defined $ENV{OSSL_USE_VALGRIND} );
+
 plan tests => 1;
 
 is(run(test(["aborttest"])), 0, "Testing that abort is caught correctly");
index 89a3eceeb79fc27551bf00d8d3aaadadf81157fd..99b9c1584021c2ae4d3db4e051099548959e99eb 100644 (file)
@@ -6,8 +6,13 @@
 # in the file LICENSE in the source distribution or at
 # https://www.openssl.org/source/license.html
 
+use OpenSSL::Test;
+use OpenSSL::Test::Utils;
 use OpenSSL::Test::Simple;
 
+plan skip_all => "This test should not be run under valgrind"
+    if ( defined $ENV{OSSL_USE_VALGRIND} );
+
 {
     local $ENV{"ASAN_OPTIONS"} = "allocator_may_return_null=true";
     local $ENV{"MSAN_OPTIONS"} = "allocator_may_return_null=true";
index 06667f0d64f62927a7400c9506d54689d7d8a2a2..edff4057a8c139a056ae9f4c642e32ececfa2cfe 100644 (file)
@@ -6,8 +6,13 @@
 # in the file LICENSE in the source distribution or at
 # https://www.openssl.org/source/license.html
 
+use OpenSSL::Test;
+use OpenSSL::Test::Utils;
 use OpenSSL::Test::Simple;
 
+plan skip_all => "This test should not be run under valgrind"
+    if ( defined $ENV{OSSL_USE_VALGRIND} );
+
 {
     local $ENV{"ASAN_OPTIONS"} = "allocator_may_return_null=true";
     local $ENV{"MSAN_OPTIONS"} = "allocator_may_return_null=true";
index 76f1dcb06d926c4ef519ba7650ab3a3902fb12a5..38d45c9f0f22e4280808ce353e536faabe36fcb7 100644 (file)
@@ -8,9 +8,13 @@
 
 
 use OpenSSL::Test;
+use OpenSSL::Test::Utils;
 
 setup("test_memleak");
 
+plan skip_all => "This test should not be run under valgrind"
+    if (defined ($ENV{OSSL_USE_VALGRIND}));
+
 plan skip_all => "MacOS currently doesn't support leak sanitizer"
     if $^O eq 'darwin';
 
index 8033ad10c64950d55f2b39377bf3ba4328cc4d0f..048b46e1c5211f7780599258da9a29678888df8d 100644 (file)
@@ -23,6 +23,9 @@ my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
 my $config_path = abs_path(srctop_file("test", $no_fips ? "default.cnf"
                                                         : "default-and-fips.cnf"));
 
+plan skip_all => "This test should not be run under valgrind"
+    if (defined $ENV{OSSL_USE_VALGRIND});
+
 plan tests => 3;
 
 if ($no_fips) {