]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Convert test_rand to use our new p_ossltest provider
authorNeil Horman <nhorman@openssl.org>
Thu, 4 Sep 2025 17:44:30 +0000 (13:44 -0400)
committerPauli <paul.dale@oracle.com>
Wed, 17 Sep 2025 00:21:46 +0000 (10:21 +1000)
Replace ossltest engine with ossltest provider in test_rand

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28461)

test/recipes/05-test_rand.t

index 7462630127242b0416ec900f63becce02d4959ef..3a1bac872609859d8fe18a7318b8bf7e40527cc0 100644 (file)
@@ -10,7 +10,8 @@ use strict;
 use warnings;
 use OpenSSL::Test;
 use OpenSSL::Test::Utils;
-use OpenSSL::Test qw/:DEFAULT srctop_file/;
+use OpenSSL::Test qw/:DEFAULT srctop_file bldtop_dir/;
+use Cwd qw(abs_path);
 
 plan tests => 6;
 setup("test_rand");
@@ -34,11 +35,12 @@ SKIP: {
     my @randdata;
     my $expected = '0102030405060708090a0b0c0d0e0f10';
 
-    @randdata = run(app(['openssl', 'rand', '-engine', 'ossltest', '-hex', '16' ]),
+    $ENV{OPENSSL_MODULES} = abs_path(bldtop_dir("test"));
+    @randdata = run(app(['openssl', 'rand', '-provider', 'p_ossltest', '-provider', 'default', '-propquery', '?provider=p_ossltest', '-hex', '16' ]),
                     capture => 1, statusvar => \$success);
     chomp(@randdata);
     ok($success && $randdata[0] eq $expected,
-       "rand with ossltest: Check rand output is as expected");
+       "rand with ossltest provider: Check rand output is as expected");
 
     @randdata = run(app(['openssl', 'rand', '-hex', '2K' ]),
                     capture => 1, statusvar => \$success);