b1065d1bdbbc4799e9089af2b4ef2db3c5cf7b0b
[openssl.git] / test / recipes / 03-test_ui.t
1 #! /usr/bin/env perl
2 # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
3 #
4 # Licensed under the OpenSSL license (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
8
9 use strict;
10 use warnings;
11 use OpenSSL::Test;
12
13 setup("test_ui");
14
15 plan tests => 1;
16
17 note <<"EOF";
18 The best way to test the UI interface is currently by using an openssl
19 command that uses password_callback.  The only one that does this is
20 'genrsa'.
21 Since password_callback uses a UI method derived from UI_OpenSSL(), it
22 ensures that one gets tested well enough as well.
23 EOF
24
25 my $outfile = "rsa_$$.pem";
26 ok(run(app(["openssl", "genrsa", "-passout", "pass:password", "-aes128",
27             "-out", $outfile])),
28    "Checking that genrsa with a password works properly");
29
30 unlink $outfile;