summaryrefslogtreecommitdiffstats
path: root/test/recipes/30-test_evp.t
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-09-29 10:32:04 +0200
committerRichard Levitte <levitte@openssl.org>2019-09-29 16:37:21 +0200
commite0d952fccf5acddfbd29b1296bf17bec7fc28b86 (patch)
tree48b8000aeb4ab38c14532fa7ecc834c2da6188de /test/recipes/30-test_evp.t
parentFix a document description in apps/req (diff)
downloadopenssl-e0d952fccf5acddfbd29b1296bf17bec7fc28b86.tar.xz
openssl-e0d952fccf5acddfbd29b1296bf17bec7fc28b86.zip
Make relevant tests more sensitive to 'no-fips'
This applies to test/recipes/30-test_evp.t and test/recipes/30-test_evp_fetch_prov.t. Additionally, we make test/recipes/30-test_evp_fetch_prov.t data driven, to make test number planning more automated, and to separate what is unique from what is common to all the test cases. [extended tests] Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/10047)
Diffstat (limited to 'test/recipes/30-test_evp.t')
-rw-r--r--test/recipes/30-test_evp.t36
1 files changed, 23 insertions, 13 deletions
diff --git a/test/recipes/30-test_evp.t b/test/recipes/30-test_evp.t
index 52f9c2882a..e60f82415b 100644
--- a/test/recipes/30-test_evp.t
+++ b/test/recipes/30-test_evp.t
@@ -21,12 +21,15 @@ use lib srctop_dir('Configurations');
use lib bldtop_dir('.');
use platform;
+my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
+my $no_legacy = disabled('legacy') || ($ENV{NO_LEGACY} // 0);
+
# Default config depends on if the legacy module is built or not
-my $defaultcnf = disabled('legacy') ? 'default.cnf' : 'default-and-legacy.cnf';
+my $defaultcnf = $no_legacy ? 'default.cnf' : 'default-and-legacy.cnf';
my @configs = ( $defaultcnf );
# Only add the FIPS config if the FIPS module has been built
-push @configs, 'fips.cnf' unless disabled('fips');
+push @configs, 'fips.cnf' unless $no_fips;
my @files = qw( evpciph.txt evpdigest.txt );
my @defltfiles = qw( evpencod.txt evpkdf.txt evppkey_kdf.txt evpmac.txt
@@ -50,17 +53,24 @@ push @defltfiles, @desfiles unless disabled("des");
my @rc4files = qw( evpciph_rc4.txt );
push @defltfiles, @rc4files unless disabled("rc4");
-plan tests => (scalar(@configs) * scalar(@files)) + scalar(@defltfiles) + 1;
-
-my $infile = bldtop_file('providers', platform->dso('fips'));
-$ENV{OPENSSL_MODULES} = bldtop_dir("providers");
-$ENV{OPENSSL_CONF_INCLUDE} = bldtop_dir("providers");
-
-ok(run(app(['openssl', 'fipsinstall', '-out', bldtop_file('providers', 'fipsinstall.conf'),
- '-module', $infile,
- '-provider_name', 'fips', '-mac_name', 'HMAC',
- '-macopt', 'digest:SHA256', '-macopt', 'hexkey:00',
- '-section_name', 'fips_sect'])), "fipinstall");
+plan tests =>
+ ($no_fips ? 0 : 1) # FIPS install test
+ + (scalar(@configs) * scalar(@files))
+ + scalar(@defltfiles);
+
+unless ($no_fips) {
+ my $infile = bldtop_file('providers', platform->dso('fips'));
+ $ENV{OPENSSL_MODULES} = bldtop_dir("providers");
+ $ENV{OPENSSL_CONF_INCLUDE} = bldtop_dir("providers");
+
+ ok(run(app(['openssl', 'fipsinstall',
+ '-out', bldtop_file('providers', 'fipsinstall.conf'),
+ '-module', $infile,
+ '-provider_name', 'fips', '-mac_name', 'HMAC',
+ '-macopt', 'digest:SHA256', '-macopt', 'hexkey:00',
+ '-section_name', 'fips_sect'])),
+ "fipinstall");
+}
foreach (@configs) {
$ENV{OPENSSL_CONF} = srctop_file("test", $_);