summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2014-04-19 18:44:37 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2014-04-19 18:44:37 +0200
commit474e9c927abe27c4e62f18d8eb7023908ba1c42c (patch)
tree6427fba60860fd79d100fab49c6673ce3a58f17e
parent9b8271f0015526f017aa70b8d1f3a8fa1f8d3a62 (diff)
downloadgnutls-474e9c927abe27c4e62f18d8eb7023908ba1c42c.tar.gz
Run scripts under valgrind.
-rw-r--r--tests/cert-tests/Makefile.am5
-rwxr-xr-xtests/cert-tests/aki12
-rwxr-xr-xtests/cert-tests/pathlen20
-rwxr-xr-xtests/cert-tests/pem-decoding11
-rw-r--r--tests/cert-tests/suppressions.valgrind0
5 files changed, 39 insertions, 9 deletions
diff --git a/tests/cert-tests/Makefile.am b/tests/cert-tests/Makefile.am
index febd7431f6..2f27e5e150 100644
--- a/tests/cert-tests/Makefile.am
+++ b/tests/cert-tests/Makefile.am
@@ -41,7 +41,8 @@ TESTS += dane
endif
TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) \
- LC_ALL="C" \
- top_builddir="$(top_builddir)" \
+ LC_ALL="C" \
+ VALGRIND="$(VALGRIND)" \
+ top_builddir="$(top_builddir)" \
srcdir="$(srcdir)"
diff --git a/tests/cert-tests/aki b/tests/cert-tests/aki
index 33fc60e4bb..3421fa96b8 100755
--- a/tests/cert-tests/aki
+++ b/tests/cert-tests/aki
@@ -25,9 +25,19 @@ set -e
srcdir=${srcdir:-.}
CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
DIFF=${DIFF:-diff}
+if ! test -z "${VALGRIND}";then
+VALGRIND="libtool --mode=execute ${VALGRIND}"
+fi
-$CERTTOOL --certificate-info --infile $srcdir/aki-cert.pem \
+$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/aki-cert.pem \
|grep -v "Algorithm Security Level" > tmp-aki.pem
+rc=$?
+
+if test "$rc" != "0"; then
+ echo "info failed"
+ exit $rc
+fi
+
$DIFF $srcdir/aki-cert.pem tmp-aki.pem
rc=$?
diff --git a/tests/cert-tests/pathlen b/tests/cert-tests/pathlen
index a3d50ab5cf..f815ba61bd 100755
--- a/tests/cert-tests/pathlen
+++ b/tests/cert-tests/pathlen
@@ -25,11 +25,27 @@ set -e
srcdir=${srcdir:-.}
CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
DIFF=${DIFF:-diff}
+if ! test -z "${VALGRIND}";then
+VALGRIND="libtool --mode=execute ${VALGRIND}"
+fi
-$CERTTOOL --certificate-info --infile $srcdir/ca-no-pathlen.pem \
+$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/ca-no-pathlen.pem \
|grep -v "Algorithm Security Level" > new-ca-no-pathlen.pem
-$CERTTOOL --certificate-info --infile $srcdir/no-ca-or-pathlen.pem \
+rc=$?
+
+if test "$rc" != "0"; then
+ echo "info 1 failed"
+ exit $rc
+fi
+
+$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/no-ca-or-pathlen.pem \
|grep -v "Algorithm Security Level" > new-no-ca-or-pathlen.pem
+rc=$?
+
+if test "$rc" != "0"; then
+ echo "info 2 failed"
+ exit $rc
+fi
$DIFF $srcdir/ca-no-pathlen.pem new-ca-no-pathlen.pem
rc1=$?
diff --git a/tests/cert-tests/pem-decoding b/tests/cert-tests/pem-decoding
index 19e83ad59a..881bd73856 100755
--- a/tests/cert-tests/pem-decoding
+++ b/tests/cert-tests/pem-decoding
@@ -25,9 +25,12 @@
srcdir=${srcdir:-.}
CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
DIFF=${DIFF:-diff}
+if ! test -z "${VALGRIND}";then
+VALGRIND="libtool --mode=execute ${VALGRIND}"
+fi
#check whether "funny" spaces can be interpreted
-$CERTTOOL --certificate-info --infile $srcdir/funny-spacing.pem >/dev/null 2>&1
+$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/funny-spacing.pem >/dev/null 2>&1
rc=$?
# We're done.
@@ -37,7 +40,7 @@ if test "$rc" != "0"; then
fi
#check whether a BMPString attribute can be properly decoded
-$CERTTOOL --certificate-info --infile $srcdir/bmpstring.pem >tmp-pem.pem
+$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/bmpstring.pem >tmp-pem.pem
rc=$?
if test "$rc" != "0"; then
@@ -56,7 +59,7 @@ if test "$rc" != "0"; then
fi
#check whether complex-cert is decoded as expected
-$CERTTOOL --certificate-info --infile $srcdir/complex-cert.pem >tmp-pem.pem
+$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/complex-cert.pem >tmp-pem.pem
rc=$?
if test "$rc" != "0"; then
@@ -75,7 +78,7 @@ if test "$rc" != "0"; then
fi
#check whether the cert with many othernames is decoded as expected
-$CERTTOOL --certificate-info --infile $srcdir/xmpp-othername.pem >tmp-pem.pem
+$VALGRIND $CERTTOOL --certificate-info --infile $srcdir/xmpp-othername.pem >tmp-pem.pem
rc=$?
if test "$rc" != "0"; then
diff --git a/tests/cert-tests/suppressions.valgrind b/tests/cert-tests/suppressions.valgrind
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/cert-tests/suppressions.valgrind