00-prep_fipsmodule_cnf.t 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #! /usr/bin/env perl
  2. # Copyright 2021 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. use strict;
  9. use warnings;
  10. use OpenSSL::Test qw/:DEFAULT srctop_dir bldtop_dir bldtop_file srctop_file data_file/;
  11. use OpenSSL::Test::Utils;
  12. BEGIN {
  13. setup("prep_fipsmodule");
  14. }
  15. use lib srctop_dir('Configurations');
  16. use lib bldtop_dir('.');
  17. use platform;
  18. my $no_check = disabled("fips");
  19. plan skip_all => "FIPS module config file only supported in a fips build"
  20. if $no_check;
  21. my $fipsmodule = bldtop_file('providers', platform->dso('fips'));
  22. my $fipsmoduleconf = bldtop_file('test', 'fipsmodule.cnf');
  23. plan tests => 1;
  24. # Create the $fipsmoduleconf file
  25. ok(run(app(['openssl', 'fipsinstall',
  26. '-module', $fipsmodule, '-provider_name', 'fips',
  27. '-section_name', 'fips_sect', '-out', $fipsmoduleconf])),
  28. "fips install");