]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Run scripts under valgrind.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 19 Apr 2014 16:44:37 +0000 (18:44 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 19 Apr 2014 16:44:37 +0000 (18:44 +0200)
tests/cert-tests/Makefile.am
tests/cert-tests/aki
tests/cert-tests/pathlen
tests/cert-tests/pem-decoding
tests/cert-tests/suppressions.valgrind [new file with mode: 0644]

index febd7431f6a41c49beaa74f02e9f528c5dc06383..2f27e5e150e86d31446b1aedae151efa4335379f 100644 (file)
@@ -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)"
 
index 33fc60e4bbd36a5668cc0da6fc43515e5a302750..3421fa96b8675bacfa2c4100f1a32e2122d38bc2 100755 (executable)
@@ -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=$?
index a3d50ab5cf01ee08a1b476b6a245cbb89d21301d..f815ba61bd3052ca3bdafab148737f676f6f15e6 100755 (executable)
@@ -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=$?
index 19e83ad59ae15555be2ca74ede62ea9dc855447f..881bd738562692b55af45d716bb38dffa87778e1 100755 (executable)
 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 (file)
index 0000000..e69de29