summaryrefslogtreecommitdiffstats
path: root/test/recipes
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2020-05-11 17:08:48 +0300
committerDmitry Belyavskiy <beldmit@gmail.com>2020-05-23 22:04:21 +0300
commitaa2cb51da03bc8fc40d785042b35fe0c253846bf (patch)
tree5d132154e7120272a0e972264ea5d639f82bc796 /test/recipes
parent712e8debb5b2238450b303acb5f24298382c63a5 (diff)
GOST external tests
[extended tests] Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11792)
Diffstat (limited to 'test/recipes')
-rw-r--r--test/recipes/95-test_external_gost_engine.t26
-rwxr-xr-xtest/recipes/95-test_external_gost_engine_data/gost_engine.sh45
2 files changed, 71 insertions, 0 deletions
diff --git a/test/recipes/95-test_external_gost_engine.t b/test/recipes/95-test_external_gost_engine.t
new file mode 100644
index 0000000000..e7522e7032
--- /dev/null
+++ b/test/recipes/95-test_external_gost_engine.t
@@ -0,0 +1,26 @@
+#! /usr/bin/env perl
+# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You may not use
+# this file except in compliance with the License. You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+
+use OpenSSL::Test;
+use OpenSSL::Test::Utils;
+use OpenSSL::Test qw/:DEFAULT bldtop_file data_file srctop_file cmdstr/;
+
+setup("test_external");
+
+plan skip_all => "No external tests in this configuration"
+ if disabled("external-tests");
+plan skip_all => "GOST engine tests not available on Windows or VMS"
+ if $^O =~ /^(VMS|MSWin32)$/;
+plan skip_all => "GOST engine tests only available in a shared build"
+ if disabled("shared");
+
+plan tests => 1;
+
+ok(run(cmd(["sh", data_file("gost_engine.sh")])),
+ "running GOST engine tests");
diff --git a/test/recipes/95-test_external_gost_engine_data/gost_engine.sh b/test/recipes/95-test_external_gost_engine_data/gost_engine.sh
new file mode 100755
index 0000000000..498825bad7
--- /dev/null
+++ b/test/recipes/95-test_external_gost_engine_data/gost_engine.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You may not use
+# this file except in compliance with the License. You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+#
+# OpenSSL external testing using the GOST engine
+#
+set -e
+
+O_EXE=`pwd`/$BLDTOP/apps
+O_BINC=`pwd`/$BLDTOP/include
+O_SINC=`pwd`/$SRCTOP/include
+O_LIB=`pwd`/$BLDTOP
+
+export PATH=$O_EXE:$PATH
+export LD_LIBRARY_PATH=$O_LIB:$LD_LIBRARY_PATH
+export OPENSSL_ROOT_DIR=$O_LIB
+
+# Check/Set openssl version
+OPENSSL_VERSION=`openssl version | cut -f 2 -d ' '`
+
+echo "------------------------------------------------------------------"
+echo "Testing OpenSSL using GOST engine:"
+echo " CWD: $PWD"
+echo " SRCTOP: $SRCTOP"
+echo " BLDTOP: $BLDTOP"
+echo " OPENSSL_ROOT_DIR: $OPENSSL_ROOT_DIR"
+echo " OpenSSL version: $OPENSSL_VERSION"
+echo "------------------------------------------------------------------"
+
+cd $SRCTOP/gost-engine
+rm -rf build
+mkdir -p build
+cd build
+cmake ..
+make
+CTEST_OUTPUT_ON_FAILURE=1 HARNESS_OSSL_PREFIX='' OPENSSL_ENGINES=$OPENSSL_ROOT_DIR/gost-engine/build/bin make test
+
+exit 0
+