30-test_defltfips.t 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #! /usr/bin/env perl
  2. # Copyright 2015-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. use strict;
  9. use warnings;
  10. use OpenSSL::Test qw/:DEFAULT srctop_file srctop_dir bldtop_file bldtop_dir/;
  11. use OpenSSL::Test::Utils;
  12. use Cwd qw(abs_path);
  13. BEGIN {
  14. setup("test_evp");
  15. }
  16. use lib srctop_dir('Configurations');
  17. use lib bldtop_dir('.');
  18. use platform;
  19. my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
  20. plan tests =>
  21. ($no_fips ? 1 : 3);
  22. unless ($no_fips) {
  23. my $infile = bldtop_file('providers', platform->dso('fips'));
  24. ok(run(app(['openssl', 'fipsinstall',
  25. '-out', bldtop_file('providers', 'fipsmodule.cnf'),
  26. '-module', $infile])),
  27. "fipsinstall");
  28. $ENV{OPENSSL_CONF} = abs_path(srctop_file("test", "fips.cnf"));
  29. ok(run(test(["defltfips_test", "fips"])), "running defltfips_test fips");
  30. }
  31. $ENV{OPENSSL_CONF} = abs_path(srctop_file("test", "default.cnf"));
  32. ok(run(test(["defltfips_test"])), "running defltfips_test");