test/recipes/30-test_evp.t: Modify to test with different providers

Different providers will give different results, and we need to test
them all.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9398)
This commit is contained in:
Richard Levitte 2019-07-17 14:26:26 +02:00
parent 3b5d61f472
commit e2f72313cc
5 changed files with 57 additions and 8 deletions

View file

@ -0,0 +1,14 @@
openssl_conf = openssl_init
[openssl_init]
providers = provider_sect
[provider_sect]
default = default_sect
legacy = legacy_sect
[default_sect]
activate = 1
[legacy_sect]
activate = 1

10
test/default.cnf Normal file
View file

@ -0,0 +1,10 @@
openssl_conf = openssl_init
[openssl_init]
providers = provider_sect
[provider_sect]
default = default_sect
[default_sect]
activate = 1

10
test/fips.cnf Normal file
View file

@ -0,0 +1,10 @@
openssl_conf = openssl_init
[openssl_init]
providers = provider_sect
[provider_sect]
fips = fips_sect
[fips_sect]
activate = 1

10
test/legacy.cnf Normal file
View file

@ -0,0 +1,10 @@
openssl_conf = openssl_init
[openssl_init]
providers = provider_sect
[provider_sect]
legacy = legacy_sect
[legacy_sect]
activate = 1

View file

@ -10,19 +10,24 @@
use strict;
use warnings;
use OpenSSL::Test qw(:DEFAULT data_file bldtop_dir);
use OpenSSL::Test qw(:DEFAULT data_file bldtop_dir srctop_file);
setup("test_evp");
my @files = ( "evpciph.txt", "evpdigest.txt", "evpencod.txt", "evpkdf.txt",
"evppkey_kdf.txt", "evpmac.txt", "evppbe.txt", "evppkey.txt",
"evppkey_ecc.txt", "evpcase.txt", "evpaessiv.txt", "evpccmcavs.txt" );
my @configs = qw( default-and-legacy.cnf fips.cnf );
my @files = qw( evpciph.txt evpdigest.txt evpencod.txt evpkdf.txt
evppkey_kdf.txt evpmac.txt evppbe.txt evppkey.txt
evppkey_ecc.txt evpcase.txt evpaessiv.txt evpccmcavs.txt );
plan tests => scalar(@files);
plan tests => scalar(@configs) * scalar(@files);
$ENV{OPENSSL_MODULES} = bldtop_dir("providers");
foreach (@configs) {
$ENV{OPENSSL_CONF} = srctop_file("test", $_);
foreach my $f ( @files ) {
ok(run(test(["evp_test", data_file("$f")])),
"running evp_test $f");
}
}