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 <gmazyland@gmail.com>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Tue Mar 24 17:04:22 2026
(Merged from https://github.com/openssl/openssl/pull/30521)
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")])));
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");
}