]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/recipes/90-test_threads.t
Add a multi-thread test for shared EVP_PKEYs
[thirdparty/openssl.git] / test / recipes / 90-test_threads.t
CommitLineData
596d6b7e 1#! /usr/bin/env perl
4333b89f 2# Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
596d6b7e 3#
909f1a2e 4# Licensed under the Apache License 2.0 (the "License"). You may not use
596d6b7e
RS
5# this file except in compliance with the License. You can obtain a copy
6# in the file LICENSE in the source distribution or at
7# https://www.openssl.org/source/license.html
8
71a04cfc
AG
9
10use OpenSSL::Test::Simple;
a0134d29 11use OpenSSL::Test qw/:DEFAULT srctop_file srctop_dir bldtop_dir bldtop_file data_dir/;
ae95a40e
MC
12use OpenSSL::Test::Utils;
13use Cwd qw(abs_path);
71a04cfc 14
ae95a40e
MC
15BEGIN {
16setup("test_threads");
17}
18
19use lib srctop_dir('Configurations');
20use lib bldtop_dir('.');
21use platform;
22
23my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
24
25
26plan tests => 1 + ($no_fips ? 0 : 1);
27
28if (!$no_fips) {
29 my $infile = bldtop_file('providers', platform->dso('fips'));
30 ok(run(app(['openssl', 'fipsinstall',
31 '-out', bldtop_file('providers', 'fipsmodule.cnf'),
32 '-module', $infile])),
33 "fipsinstall");
34}
35
36if ($no_fips) {
37 $ENV{OPENSSL_CONF} = abs_path(srctop_file("test", "default.cnf"));
a0134d29 38 ok(run(test(["threadstest", data_dir()])), "running test_threads");
ae95a40e
MC
39} else {
40 $ENV{OPENSSL_CONF} = abs_path(srctop_file("test", "default-and-fips.cnf"));
a0134d29 41 ok(run(test(["threadstest", "-fips", data_dir()])), "running test_threads");
ae95a40e 42}