From: Milan Broz Date: Sat, 21 Mar 2026 12:50:37 +0000 (+0100) Subject: test: Fix test_rand to check output length (and run silently) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1630bfa1da0a1aa405d01e96e7dfbd738e15eb2;p=thirdparty%2Fopenssl.git test: Fix test_rand to check output length (and run silently) When running tests on Windows, the last test command in test_rand is mixed with test output. perl.exe ..\..\util\wrap.pl ..\..\apps\openssl.exe rand -hex 2K => 0[14:11:00] 05-test_rand.t ...... As there is also missing actual check for output length, fix both problems by adding simple check for expected length. Signed-off-by: Milan Broz Reviewed-by: Norbert Pocs Reviewed-by: Nikola Pajkovsky MergeDate: Tue Mar 24 17:04:22 2026 (Merged from https://github.com/openssl/openssl/pull/30521) --- diff --git a/test/recipes/05-test_rand.t b/test/recipes/05-test_rand.t index 73a163d4d10..d70b65c6492 100644 --- a/test/recipes/05-test_rand.t +++ b/test/recipes/05-test_rand.t @@ -13,7 +13,7 @@ use OpenSSL::Test::Utils; use OpenSSL::Test qw/:DEFAULT srctop_file bldtop_dir/; use Cwd qw(abs_path); -plan tests => 5; +plan tests => 6; setup("test_rand"); ok(run(test(["rand_test", srctop_file("test", "default.cnf")]))); @@ -41,8 +41,15 @@ SKIP: { chomp(@randdata); ok($success && $randdata[0] eq $expected, "rand with ossltest provider: Check rand output is as expected"); +} + +{ + my $success; + my @randdata; @randdata = run(app(['openssl', 'rand', '-hex', '2K' ]), capture => 1, statusvar => \$success); chomp(@randdata); + ok($success && length($randdata[0]) == 4096, + "rand: Check rand output is of expected length"); }