From: Nikos Mavrogiannopoulos Date: Wed, 4 Jan 2017 13:31:26 +0000 (+0100) Subject: tests: openpgp-cert-parser: simplified X-Git-Tag: gnutls_3_6_0~1089 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=94a8d00a6bf96305543317de0ce4bb42da0327ab;p=thirdparty%2Fgnutls.git tests: openpgp-cert-parser: simplified --- diff --git a/tests/cert-tests/openpgp-cert-parser b/tests/cert-tests/openpgp-cert-parser index 800a2038c6..f30f1d6d83 100755 --- a/tests/cert-tests/openpgp-cert-parser +++ b/tests/cert-tests/openpgp-cert-parser @@ -20,11 +20,13 @@ # along with GnuTLS; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -set -e - srcdir="${srcdir:-.}" CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}" +if ! test -z "${VALGRIND}"; then + VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}" +fi + if ! test -x "${CERTTOOL}"; then exit 77 fi @@ -38,16 +40,22 @@ fail() { echo "Checking OpenPGP certificate parsing" -("${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/truncated.pub" 2>&1 \ - | grep "^import error: Error in parsing" > /dev/null) || \ +${VALGRIND} "${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/truncated.pub" 2>&1 +rc=$? +if test $rc != 1;then fail "Parsing should have errored" +fi -("${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/attribute-leak-1.pub" 2>&1 \ - | grep "^import error:" > /dev/null) || \ +${VALGRIND} "${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/attribute-leak-1.pub" 2>&1 +rc=$? +if test $rc != 1;then fail "Parsing should have errored" +fi -("${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/subpkt-leak.pub" 2>&1 \ - | grep "^import error:" > /dev/null) || \ +${VALGRIND} "${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/subpkt-leak.pub" 2>&1 +rc=$? +if test $rc != 1;then fail "Parsing should have errored" +fi exit ${RETCODE:-0}