90-test_sslapi.t 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #! /usr/bin/env perl
  2. # Copyright 2016-2022 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 OpenSSL::Test::Utils;
  9. use OpenSSL::Test qw/:DEFAULT srctop_file srctop_dir bldtop_dir bldtop_file/;
  10. use File::Temp qw(tempfile);
  11. BEGIN {
  12. setup("test_sslapi");
  13. }
  14. use lib srctop_dir('Configurations');
  15. use lib bldtop_dir('.');
  16. my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
  17. plan skip_all => "No TLS/SSL protocols are supported by this OpenSSL build"
  18. if alldisabled(grep { $_ ne "ssl3" } available_protocols("tls"));
  19. plan tests =>
  20. ($no_fips ? 0 : 1) # sslapitest with fips
  21. + 1; # sslapitest with default provider
  22. (undef, my $tmpfilename) = tempfile();
  23. ok(run(test(["sslapitest", srctop_dir("test", "certs"),
  24. srctop_file("test", "recipes", "90-test_sslapi_data",
  25. "passwd.txt"), $tmpfilename, "default",
  26. srctop_file("test", "default.cnf"),
  27. srctop_file("test",
  28. "recipes",
  29. "90-test_sslapi_data",
  30. "dhparams.pem")])),
  31. "running sslapitest");
  32. unless ($no_fips) {
  33. ok(run(test(["sslapitest", srctop_dir("test", "certs"),
  34. srctop_file("test", "recipes", "90-test_sslapi_data",
  35. "passwd.txt"), $tmpfilename, "fips",
  36. srctop_file("test", "fips-and-base.cnf"),
  37. srctop_file("test",
  38. "recipes",
  39. "90-test_sslapi_data",
  40. "dhparams.pem")])),
  41. "running sslapitest");
  42. }
  43. unlink $tmpfilename;