2 # Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
12 use OpenSSL::Test::Utils;
17 ok(run(test(["rand_test"])));
18 ok(run(test(["drbgtest"])));
19 ok(run(test(["rand_status_test"])));
22 skip "engine is not supported by this OpenSSL build", 2
23 if disabled("engine") || disabled("dynamic-engine");
27 my $expected = '0102030405060708090a0b0c0d0e0f10';
29 @randdata = run(app(['openssl', 'rand', '-engine', 'ossltest', '-hex', '16' ]),
30 capture => 1, statusvar => \$success);
32 ok($success and $randdata[0] eq $expected,
33 "rand with ossltest: Check rand output is as expected");
35 @randdata = run(app(['openssl', 'rand', '-engine', 'dasync', '-hex', '16' ]),
36 capture => 1, statusvar => \$success);
38 ok($success and length($randdata[0]) == 32,
39 "rand with dasync: Check rand output is of expected length");