summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2018-11-16 16:20:17 +0100
committerTim Rühsen <tim.ruehsen@gmx.de>2018-12-18 11:26:57 +0100
commit9f564d2286a8a484c1b1f45fe4f6d988d6652878 (patch)
tree2a9de034c2056d6e25d1c42e5d790ff94dd69bd3
parentd79dbf99e555abdcc79f1253976189efa892c0fc (diff)
downloadgnutls-9f564d2286a8a484c1b1f45fe4f6d988d6652878.tar.gz
tests/cert-tests/certtool: SKIP if --disable-bash-tests was given
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
-rw-r--r--configure.ac5
-rw-r--r--tests/cert-tests/Makefile.am4
-rwxr-xr-xtests/cert-tests/certtool13
3 files changed, 19 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index d44791bd91..21ab6bbe9d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,6 +60,11 @@ fi
AX_CODE_COVERAGE
AM_MAINTAINER_MODE([enable])
+AC_ARG_ENABLE(bash-tests,
+ AS_HELP_STRING([--disable-bash-tests], [skip some tests that badly need bash]),
+ enable_bash_tests=$enableval, enable_bash_tests=yes)
+AM_CONDITIONAL(DISABLE_BASH_TESTS, test "$enable_bash_tests" != "yes")
+
AC_ARG_ENABLE(doc,
AS_HELP_STRING([--disable-doc], [don't generate any documentation]),
enable_doc=$enableval, enable_doc=yes)
diff --git a/tests/cert-tests/Makefile.am b/tests/cert-tests/Makefile.am
index 26dd5b22bb..0e5692df6d 100644
--- a/tests/cert-tests/Makefile.am
+++ b/tests/cert-tests/Makefile.am
@@ -162,5 +162,9 @@ else
TESTS_ENVIRONMENT += ENABLE_GOST=0
endif
+if DISABLE_BASH_TESTS
+TESTS_ENVIRONMENT += DISABLE_BASH_TESTS=1
+endif
+
distclean-local:
rm -rf tmp-* *.tmp
diff --git a/tests/cert-tests/certtool b/tests/cert-tests/certtool
index 3c7c620dee..5f1276e60e 100755
--- a/tests/cert-tests/certtool
+++ b/tests/cert-tests/certtool
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
# Copyright (C) 2014-2018 Nikos Mavrogiannopoulos
# Copyright (C) 2018 Red Hat, Inc.
@@ -27,6 +27,10 @@ TMPFILE1=certtool-file1.$$.tmp
TMPFILE2=certtool-file2.$$.tmp
PASS="1234"
+if test -n "$DISABLE_BASH_TESTS"; then
+ exit 77
+fi
+
if ! test -x "${CERTTOOL}"; then
exit 77
fi
@@ -43,8 +47,11 @@ if test -n "${SETSID}";then
exit 1
fi
- #check whether ask-pass is being honoured
- ${SETSID} "${CERTTOOL}" --generate-self-signed --load-privkey ${TMPFILE1} --template "${srcdir}/templates/template-test.tmpl" --ask-pass >${TMPFILE2} 2>&1 <<<${PASS}
+ #check whether password is being honoured
+ #some CI runners need GNUTLS_PIN (GNUTLS_PIN=${PASS})
+ ${SETSID} "${CERTTOOL}" --generate-self-signed --load-privkey ${TMPFILE1} --template ${srcdir}/templates/template-test.tmpl --ask-pass >${TMPFILE2} 2>&1 <<EOF
+$PASS
+EOF
if test $? != 0;then
cat ${TMPFILE2}
echo "cert generation failed"