30-test_evp_libctx.t 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. use strict;
  9. use warnings;
  10. use OpenSSL::Test qw(:DEFAULT bldtop_dir srctop_dir srctop_file bldtop_file);
  11. use OpenSSL::Test::Utils;
  12. BEGIN {
  13. setup("test_evp_libctx");
  14. }
  15. my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
  16. use lib srctop_dir('Configurations');
  17. use lib bldtop_dir('.');
  18. use platform;
  19. my $infile = bldtop_file('providers', platform->dso('fips'));
  20. # If no fips then run the test with no extra arguments.
  21. my @test_args = ( );
  22. plan tests =>
  23. ($no_fips ? 0 : 2) # FIPS install test
  24. + 1;
  25. unless ($no_fips) {
  26. @test_args = ("-config", srctop_file("test","fips-and-base.cnf"),
  27. "-provider", "fips");
  28. ok(run(app(['openssl', 'fipsinstall',
  29. '-out', bldtop_file('providers', 'fipsmodule.cnf'),
  30. '-module', $infile])),
  31. "fipsinstall");
  32. ok(run(test(["evp_libctx_test", @test_args])), "running fips evp_libctx_test");
  33. }
  34. ok(run(test(["evp_libctx_test",
  35. "-config", srctop_file("test","default-and-legacy.cnf"),])),
  36. "running default-and-legacy evp_libctx_test");