diff options
author | Neil Horman <nhorman@openssl.org> | 2024-04-04 15:39:17 -0400 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-04-18 18:39:48 +0200 |
commit | 3630199af4e08afd873a53f399d4b0eba6756242 (patch) | |
tree | bbae3ebade564b9813f806228d553af5ad0a76ee | |
parent | a15b30ec0bd7bcc9503ef1d201fdbc55332bf80e (diff) |
Update modulepath test for provider config to skip if not present
If the p_test.so library isn't present, don't run the test
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24025)
(cherry picked from commit b80fed3f27ebe156b17246f7c12c5178cbe6834e)
-rw-r--r-- | test/prov_config_test.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/test/prov_config_test.c b/test/prov_config_test.c index d59a954667..2fac741a3d 100644 --- a/test/prov_config_test.c +++ b/test/prov_config_test.c @@ -7,6 +7,7 @@ * https://www.openssl.org/source/license.html */ +#include <sys/stat.h> #include <openssl/evp.h> #include <openssl/conf.h> #include "testutil.h" @@ -71,15 +72,20 @@ static int test_recursive_config(void) return testresult; } -#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACOSX) && !defined(NO_PROVIDER_MODULE) static int test_path_config(void) { - OSSL_LIB_CTX *ctx = OSSL_LIB_CTX_new(); + OSSL_LIB_CTX *ctx = NULL; OSSL_PROVIDER *prov; int testresult = 0; + struct stat sbuf; + + if (stat("../test/p_test.so", &sbuf) == -1) + return TEST_skip("Skipping modulepath test as provider not present"); if (!TEST_ptr(pathedconfig)) return 0; + + ctx = OSSL_LIB_CTX_new(); if (!TEST_ptr(ctx)) return 0; @@ -97,7 +103,6 @@ static int test_path_config(void) OSSL_LIB_CTX_free(ctx); return testresult; } -#endif OPT_TEST_DECLARE_USAGE("configfile\n") @@ -119,15 +124,6 @@ int setup_tests(void) ADD_TEST(test_recursive_config); ADD_TEST(test_double_config); -#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACOSX) && !defined(NO_PROVIDER_MODULE) - /* - * This test has to specify a module path to a file - * Which is setup as ../test/p_test.so - * Since windows/macos doesn't build with that extension - * just skip the test here - * Additionally skip it if we're not building provider modules - */ ADD_TEST(test_path_config); -#endif return 1; } |