From: Nikos Mavrogiannopoulos Date: Mon, 9 Nov 2015 22:04:48 +0000 (+0100) Subject: tests: openpgp-certs: use valgrind X-Git-Tag: gnutls_3_5_0~587 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb61b696f7da1651d8c62bb96cd0d9ca45751e07;p=thirdparty%2Fgnutls.git tests: openpgp-certs: use valgrind --- diff --git a/tests/openpgp-certs/Makefile.am b/tests/openpgp-certs/Makefile.am index a3840548e1..8db8736000 100644 --- a/tests/openpgp-certs/Makefile.am +++ b/tests/openpgp-certs/Makefile.am @@ -22,7 +22,8 @@ EXTRA_DIST = ca-public.gpg srv-public-all-signed.gpg srv-secret.gpg \ srv-public-localhost-signed.gpg \ selfsigs/alice-mallory-badsig18.pub \ selfsigs/alice-mallory-irrelevantsig.pub \ - selfsigs/alice-mallory-nosig18.pub selfsigs/alice.pub + selfsigs/alice-mallory-nosig18.pub selfsigs/alice.pub \ + suppressions.valgrind dist_check_SCRIPTS = testselfsigs testcerts @@ -37,5 +38,6 @@ endif TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) \ LC_ALL="C" \ + VALGRIND="$(VALGRIND)" \ top_builddir="$(top_builddir)" \ srcdir="$(srcdir)" diff --git a/tests/openpgp-certs/suppressions.valgrind b/tests/openpgp-certs/suppressions.valgrind new file mode 100644 index 0000000000..59238ae876 --- /dev/null +++ b/tests/openpgp-certs/suppressions.valgrind @@ -0,0 +1,16 @@ +# suppressions -- Valgrind suppresion file for libgcrypt + +# Copyright (C) 2015 Red Hat, Inc. + +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. + +{ + + Memcheck:Addr4 + fun:idna_to_ascii_4z + fun:idna_to_ascii_8z + fun:gnutls_x509_crt_check_email + ... +} diff --git a/tests/openpgp-certs/testcerts b/tests/openpgp-certs/testcerts index 9ac5f5381d..54b9947571 100755 --- a/tests/openpgp-certs/testcerts +++ b/tests/openpgp-certs/testcerts @@ -24,6 +24,9 @@ srcdir="${srcdir:-.}" SERV="${SERV:-../../src/gnutls-serv} -q" CLI="${CLI:-../../src/gnutls-cli}" DEBUG="" +if ! test -z "${VALGRIND}"; then + VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=15" +fi if test "${WINDIR}" != ""; then exit 77 @@ -47,10 +50,10 @@ wait_server ${PID} #"${CLI}" -p "${PORT}" 127.0.0.1 --pgpkeyring ca-public.gpg /dev/null || \ # fail "Connection to verified IP address should have succeeded! (error code $?)" $? -"${CLI}" ${DEBUG} -p "${PORT}" 127.0.0.2 --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null 2>&1 && \ +${VALGRIND} "${CLI}" ${DEBUG} -p "${PORT}" 127.0.0.2 --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null 2>&1 && \ fail ${PID} "Connection to unrecognized IP address should have failed!" -"${CLI}" ${DEBUG} -p "${PORT}" localhost --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null 2>&1 && \ +${VALGRIND} "${CLI}" ${DEBUG} -p "${PORT}" localhost --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null 2>&1 && \ fail ${PID} "Connection to unverified (but present) 'localhost' should have failed!" kill ${PID} @@ -60,10 +63,10 @@ launch_server $$ --priority NORMAL:+CTYPE-OPENPGP --pgpcertfile "${srcdir}/srv-p PID=$! wait_server ${PID} -echo | "${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.1 --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null 2>&1 && \ +echo | ${VALGRIND} "${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.1 --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null 2>&1 && \ fail ${PID} "Connection to unverified IP address should have failed! (error code $?)" $? -"${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.2 --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null 2>&1 && \ +${VALGRIND} "${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.2 --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null 2>&1 && \ fail ${PID} "Connection to unrecognized IP address should have failed!" #see reason above @@ -78,10 +81,10 @@ PID=$! wait_server ${PID} # give the server a chance to initialize -echo | "${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.1 --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null || \ +echo | ${VALGRIND} "${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.1 --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null || \ fail ${PID} "Connection to signed PGP certificate should have succeeded! (error code $?)" $? -"${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.2 --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null 2>&1 && \ +${VALGRIND} "${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.2 --pgpkeyring "${srcdir}/ca-public.gpg" /dev/null 2>&1 && \ fail ${PID} "Connection to unrecognized IP address should have failed!" kill ${PID}