summaryrefslogtreecommitdiffstats
path: root/test/evp_test.c
diff options
context:
space:
mode:
authorČestmír Kalina <ckalina@redhat.com>2022-07-20 13:07:46 -0400
committerPauli <pauli@openssl.org>2023-03-17 11:12:47 +1100
commitae1792e3d94bbd9f6c535f1784438011097adb4a (patch)
tree0779a60d6c8a3195cfb8d24e575d532630f343c1 /test/evp_test.c
parent786b9a8d3f8e203c5536e36b9a9bab83bde0311a (diff)
evp_test: add thread support
Signed-off-by: Čestmír Kalina <ckalina@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12256)
Diffstat (limited to 'test/evp_test.c')
-rw-r--r--test/evp_test.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/evp_test.c b/test/evp_test.c
index f22be43ed6..c154d89ab8 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -22,6 +22,7 @@
#include <openssl/params.h>
#include <openssl/core_names.h>
#include <openssl/fips_names.h>
+#include <openssl/thread.h>
#include "internal/numbers.h"
#include "internal/nelem.h"
#include "crypto/evp.h"
@@ -3570,6 +3571,10 @@ static void clear_test(EVP_TEST *t)
t->err = NULL;
t->skip = 0;
t->meth = NULL;
+
+#if !defined(OPENSSL_NO_DEFAULT_THREAD_POOL)
+ OSSL_set_max_threads(libctx, 0);
+#endif
}
/* Check for errors in the test structure; return 1 if okay, else 0. */
@@ -3955,6 +3960,12 @@ start:
return 0;
}
t->reason = take_value(pp);
+ } else if (strcmp(pp->key, "Threads") == 0) {
+ if (OSSL_set_max_threads(libctx, atoi(pp->value)) == 0) {
+ TEST_info("skipping, '%s' threads not available: %s:%d",
+ pp->value, t->s.test_file, t->s.start);
+ t->skip = 1;
+ }
} else {
/* Must be test specific line: try to parse it */
int rv = t->meth->parse(t, pp->key, pp->value);