From 9f564d2286a8a484c1b1f45fe4f6d988d6652878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Fri, 16 Nov 2018 16:20:17 +0100 Subject: tests/cert-tests/certtool: SKIP if --disable-bash-tests was given MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim Rühsen --- configure.ac | 5 +++++ tests/cert-tests/Makefile.am | 4 ++++ tests/cert-tests/certtool | 13 ++++++++++--- 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 <