Add 'on demand self test' and status test to providers
[openssl.git] / test / recipes / 30-test_provider_status.t
1 #! /usr/bin/env perl
2 # Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
3 #
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
8
9
10 use strict;
11 use warnings;
12
13 use OpenSSL::Test qw(:DEFAULT data_file bldtop_dir srctop_file srctop_dir bldtop_file);
14 use OpenSSL::Test::Utils;
15
16 BEGIN {
17 setup("test_provider_status");
18 }
19
20 use lib srctop_dir('Configurations');
21 use lib bldtop_dir('.');
22 use platform;
23
24 my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
25
26 plan skip_all => "provider_status is not supported by this test"
27     if $no_fips;
28
29 plan tests => 2;
30
31 my $infile = bldtop_file('providers', platform->dso('fips'));
32
33 ok(run(app(['openssl', 'fipsinstall',
34             '-out', bldtop_file('providers', 'fipsmodule.cnf'),
35             '-module', $infile])),
36    "fipsinstall");
37
38 ok(run(test(["provider_status_test", "-config", srctop_file("test","fips.cnf"),
39              "-provider_name", "fips"])),
40    "running provider_status_test");