30-test_acvp.t 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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_acvp");
  14. }
  15. my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
  16. plan skip_all => "ACVP is not supported by this test"
  17. if $no_fips || disabled("acvp_tests");
  18. use lib srctop_dir('Configurations');
  19. use lib bldtop_dir('.');
  20. use platform;
  21. my $infile = bldtop_file('providers', platform->dso('fips'));
  22. plan tests => 2;
  23. ok(run(app(['openssl', 'fipsinstall',
  24. '-out', bldtop_file('providers', 'fipsmodule.cnf'),
  25. '-module', $infile])),
  26. "fipsinstall");
  27. ok(run(test(["acvp_test", "-config", srctop_file("test","fips.cnf")])),
  28. "running acvp_test");