]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/recipes/90-test_sslprovider.t
Teach ssl_test_new how to test the FIPS module
[thirdparty/openssl.git] / test / recipes / 90-test_sslprovider.t
CommitLineData
9aa78c36
MC
1#! /usr/bin/env perl
2# Copyright 2016-2018 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
10use OpenSSL::Test::Utils;
beb958cc 11use OpenSSL::Test qw/:DEFAULT srctop_file srctop_dir bldtop_file bldtop_dir/;
9aa78c36 12
beb958cc 13BEGIN {
9aa78c36 14setup("test_sslprovider");
beb958cc
MC
15}
16
17use lib srctop_dir('Configurations');
18use lib bldtop_dir('.');
19use platform;
9aa78c36
MC
20
21plan skip_all => "No TLS/SSL protocols are supported by this OpenSSL build"
22 if alldisabled(grep { $_ ne "ssl3" } available_protocols("tls"));
23
beb958cc
MC
24plan tests => 3;
25
26$ENV{OPENSSL_MODULES} = bldtop_dir("providers");
27$ENV{OPENSSL_CONF_INCLUDE} = bldtop_dir("providers");
28
29SKIP: {
30 skip "Skipping FIPS installation", 1
31 if disabled("fips");
9aa78c36 32
ae6b654b 33 ok(run(perltest(['fipsinstall.pl', bldtop_dir()])),
beb958cc
MC
34 "fipsinstall");
35}
36
37ok(run(test(["sslprovidertest", srctop_dir("test", "certs"), "default",
38 srctop_file("test", "default.cnf")])),
9aa78c36 39 "running sslprovidertest");
beb958cc
MC
40
41SKIP: {
42 skip "Skipping FIPS provider test", 1
43 if disabled("fips");
44
45 ok(run(test(["sslprovidertest", srctop_dir("test", "certs"), "fips",
46 srctop_file("test", "fips.cnf")])),
47 "running sslprovidertest");
48}