]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: openpgp-certs: use valgrind
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 9 Nov 2015 22:04:48 +0000 (23:04 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 9 Nov 2015 22:04:48 +0000 (23:04 +0100)
tests/openpgp-certs/Makefile.am
tests/openpgp-certs/suppressions.valgrind [new file with mode: 0644]
tests/openpgp-certs/testcerts

index a3840548e1a766945ec5e82ec560349e47277770..8db8736000f150295149b4093d2405e6f705ca7b 100644 (file)
@@ -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 (file)
index 0000000..59238ae
--- /dev/null
@@ -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.
+
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Addr4
+   fun:idna_to_ascii_4z
+   fun:idna_to_ascii_8z
+   fun:gnutls_x509_crt_check_email
+   ...
+}
index 9ac5f5381dae69342752419119c8248750e013bb..54b9947571872167abe639704ec0293203ae2cca 100755 (executable)
@@ -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 >/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 >/dev/null 2>&1 && \
+${VALGRIND} "${CLI}" ${DEBUG} -p "${PORT}" 127.0.0.2 --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring "${srcdir}/ca-public.gpg" </dev/null >/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 >/dev/null 2>&1 && \
+${VALGRIND} "${CLI}" ${DEBUG} -p "${PORT}" localhost --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring "${srcdir}/ca-public.gpg" </dev/null >/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 >/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 >/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 >/dev/null 2>&1 && \
+${VALGRIND} "${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.2 --pgpkeyring "${srcdir}/ca-public.gpg" </dev/null >/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 >/dev/null || \
+echo | ${VALGRIND} "${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.1 --pgpkeyring "${srcdir}/ca-public.gpg" </dev/null >/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 >/dev/null 2>&1 && \
+${VALGRIND} "${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.2 --pgpkeyring "${srcdir}/ca-public.gpg" </dev/null >/dev/null 2>&1 && \
        fail ${PID} "Connection to unrecognized IP address should have failed!"
 
 kill ${PID}