Add a GOST test
[openssl.git] / test / recipes / 90-test_gost.t
1 #! /usr/bin/env perl
2 # Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
3 #
4 # Licensed under the OpenSSL license (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
9 use OpenSSL::Test::Utils;
10 use OpenSSL::Test qw/:DEFAULT srctop_file/;
11
12 setup("test_gost");
13
14 plan skip_all => "GOST support is disabled in this OpenSSL build"
15     if disabled("gost");
16
17 plan skip_all => "TLSv1.3 or TLSv1.2 are disabled in this OpenSSL build"
18     if disabled("tls1_3") || disabled("tls1_2");
19
20 plan skip_all => "No test GOST engine found"
21     if !$ENV{OPENSSL_GOST_ENGINE_SO};
22
23 plan tests => 1;
24
25 $ENV{OPENSSL_CONF} = srctop_file("test", "recipes", "90-test_gost_data",
26                                  "gost.conf");
27
28 ok(run(test(["gosttest",
29              srctop_file("test", "recipes", "90-test_gost_data",
30                          "server-cert2001.pem"),
31              srctop_file("test", "recipes", "90-test_gost_data",
32                          "server-key2001.pem"),
33              srctop_file("test", "recipes", "90-test_gost_data",
34                          "server-cert2012.pem"),
35              srctop_file("test", "recipes", "90-test_gost_data",
36                          "server-key2012.pem")])),
37              "running gosttest");