]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test: get the LMS test recipe run non-FIPS tests
authorRichard Levitte <levitte@openssl.org>
Sun, 29 Jun 2025 08:41:33 +0000 (10:41 +0200)
committerPauli <ppzgs1@gmail.com>
Thu, 10 Jul 2025 09:04:37 +0000 (19:04 +1000)
This places the FIPS specific tests in a skippable block.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27885)

test/recipes/30-test_lms.t

index 7ab8a77199ba8b5bf203b6dce091baa259c4f7d8..ebe996352616a8fdd1a28ab987d6d702c16f2cde 100644 (file)
@@ -16,23 +16,29 @@ BEGIN {
     setup("test_lms");
 }
 
+plan skip_all => 'LMS is not supported in this build' if disabled('lms');
+
 my $provconf = srctop_file("test", "fips-and-base.cnf");
 my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
 
-run(test(["fips_version_test", "-config", $provconf, ">=3.6.0"]),
-         capture => 1, statusvar => \my $exit);
-
-plan skip_all => "FIPS provider does not support LMS" if !$exit;
-
 use lib srctop_dir('Configurations');
 use lib bldtop_dir('.');
 
 plan skip_all => 'LMS is not supported in this build' if disabled('lms');
-plan tests => 1 + + ($no_fips ? 0 : 1);
+plan tests => 2;
 
 ok(run(test(["lms_test"])), "running lms_test");
 
-unless ($no_fips) {
+SKIP: {
+    skip "Skipping FIPS tests", 1
+        if $no_fips;
+
+    # LMS is only present after OpenSSL 3.6
+    run(test(["fips_version_test", "-config", $provconf, ">=3.6.0"]),
+             capture => 1, statusvar => \my $exit);
+    skip "FIPS provider version is too old for LMS test", 1
+        if !$exit;
+
     ok(run(test(["lms_test", "-config",  $provconf])),
        "running lms_test with fips");
 }