summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2016-12-31 05:07:47 +0200
committerAlon Bar-Lev <alon.barlev@gmail.com>2017-01-20 13:38:07 +0200
commitdd2974919a7e8c125f5d1d79563301d84b9c0a4a (patch)
tree20074cdac9b270cdf84f91a7124bf69a8949ad62
parent0323e66a09641447ff2c94412df274b23a808dec (diff)
downloadgnutls-dd2974919a7e8c125f5d1d79563301d84b9c0a4a.tar.gz
tests: skip tests that requires tools if tools are disabled
building with --disable-tools should not cause test failure. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
-rwxr-xr-xtests/cert-tests/aki5
-rwxr-xr-xtests/cert-tests/certtool5
-rwxr-xr-xtests/cert-tests/certtool-long-cn4
-rwxr-xr-xtests/cert-tests/certtool-long-oids4
-rwxr-xr-xtests/cert-tests/crl6
-rwxr-xr-xtests/cert-tests/email5
-rwxr-xr-xtests/cert-tests/openpgp-certs13
-rwxr-xr-xtests/cert-tests/openpgp-selfsigs4
-rwxr-xr-xtests/cert-tests/pathlen6
-rwxr-xr-xtests/cert-tests/pem-decoding5
-rwxr-xr-xtests/cert-tests/pkcs125
-rwxr-xr-xtests/cert-tests/pkcs12-utf85
-rwxr-xr-xtests/cert-tests/pkcs7-broken-sigs6
-rwxr-xr-xtests/cert-tests/privkey-import5
-rwxr-xr-xtests/cert-tests/provable-dh4
-rwxr-xr-xtests/cert-tests/provable-dh-default4
-rwxr-xr-xtests/cert-tests/provable-privkey4
-rwxr-xr-xtests/cert-tests/provable-privkey-dsa20484
-rwxr-xr-xtests/cert-tests/provable-privkey-gen-default4
-rwxr-xr-xtests/cert-tests/provable-privkey-rsa20484
-rwxr-xr-xtests/cert-tests/sha2-dsa-test4
-rwxr-xr-xtests/cert-tests/sha2-test4
-rwxr-xr-xtests/cert-tests/userid4
-rwxr-xr-xtests/fastopen.sh12
-rwxr-xr-xtests/key-tests/dsa9
-rwxr-xr-xtests/key-tests/ecdsa4
-rwxr-xr-xtests/key-tests/key-id4
-rwxr-xr-xtests/key-tests/key-invalid4
-rwxr-xr-xtests/key-tests/pkcs84
-rwxr-xr-xtests/key-tests/pkcs8-decode4
-rwxr-xr-xtests/key-tests/pkcs8-invalid4
-rwxr-xr-xtests/rfc2253-escape-test5
-rwxr-xr-xtests/starttls.sh12
-rwxr-xr-xtests/suite/chain.sh8
-rwxr-xr-xtests/suite/crl-test6
-rwxr-xr-xtests/suite/eagain.sh8
-rwxr-xr-xtests/suite/invalid-cert.sh5
-rwxr-xr-xtests/suite/pkcs7-cat4
-rwxr-xr-xtests/suite/testdane.sh4
-rwxr-xr-xtests/suite/testpkcs11.sh19
-rwxr-xr-xtests/suite/testrandom.sh5
-rwxr-xr-xtests/suite/testsrn.sh12
42 files changed, 238 insertions, 9 deletions
diff --git a/tests/cert-tests/aki b/tests/cert-tests/aki
index 3933161bb9..1c72f0d433 100755
--- a/tests/cert-tests/aki
+++ b/tests/cert-tests/aki
@@ -26,6 +26,11 @@ srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
TMPFILE=aki-$$.tmp
DIFF="${DIFF:-diff -b -B}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/cert-tests/certtool b/tests/cert-tests/certtool
index 6a8bcc8b81..ad66d8ffe7 100755
--- a/tests/cert-tests/certtool
+++ b/tests/cert-tests/certtool
@@ -23,6 +23,11 @@
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff -b -B}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/cert-tests/certtool-long-cn b/tests/cert-tests/certtool-long-cn
index df430a2626..41e7a9740c 100755
--- a/tests/cert-tests/certtool-long-cn
+++ b/tests/cert-tests/certtool-long-cn
@@ -27,6 +27,10 @@ CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff -b -B}"
outfile="out.$$.pem"
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=3"
fi
diff --git a/tests/cert-tests/certtool-long-oids b/tests/cert-tests/certtool-long-oids
index 31ea796c84..c2e9559326 100755
--- a/tests/cert-tests/certtool-long-oids
+++ b/tests/cert-tests/certtool-long-oids
@@ -28,6 +28,10 @@ DIFF="${DIFF:-diff -b -B}"
OUTFILE="out.$$.pem"
TMPFILE1="out1.$$.pem"
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=3"
fi
diff --git a/tests/cert-tests/crl b/tests/cert-tests/crl
index 220c65660e..e9f1b68e28 100755
--- a/tests/cert-tests/crl
+++ b/tests/cert-tests/crl
@@ -25,9 +25,15 @@ export TZ="UTC"
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=15"
fi
+
OUTFILE=out-crl.$$.tmp
INFOFILE=out-crl-info.$$.tmp
OUTFILE2=out2-crl.$$.tmp
diff --git a/tests/cert-tests/email b/tests/cert-tests/email
index 8efe18edd1..a00281028e 100755
--- a/tests/cert-tests/email
+++ b/tests/cert-tests/email
@@ -23,6 +23,11 @@
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF=$"{DIFF:-diff}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/cert-tests/openpgp-certs b/tests/cert-tests/openpgp-certs
index 3cee344253..69ecc1a4ff 100755
--- a/tests/cert-tests/openpgp-certs
+++ b/tests/cert-tests/openpgp-certs
@@ -21,9 +21,18 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
srcdir="${srcdir:-.}"
-SERV="${SERV:-../../src/gnutls-serv} -q"
+SERV="${SERV:-../../src/gnutls-serv}"
CLI="${CLI:-../../src/gnutls-cli}"
DEBUG=""
+
+if ! test -x "${SERV}"; then
+ exit 77
+fi
+
+if ! test -x "${CLI}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=15"
fi
@@ -32,6 +41,8 @@ if test "${WINDIR}" != ""; then
exit 77
fi
+SERV="${SERV} -q"
+
. "${srcdir}/../scripts/common.sh"
echo "Checking OpenPGP certificate verification"
diff --git a/tests/cert-tests/openpgp-selfsigs b/tests/cert-tests/openpgp-selfsigs
index 7929e53cd6..1e7c50d09f 100755
--- a/tests/cert-tests/openpgp-selfsigs
+++ b/tests/cert-tests/openpgp-selfsigs
@@ -25,6 +25,10 @@ set -e
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
unset RETCODE || true
fail() {
diff --git a/tests/cert-tests/pathlen b/tests/cert-tests/pathlen
index 687ebc244c..7f250e03b4 100755
--- a/tests/cert-tests/pathlen
+++ b/tests/cert-tests/pathlen
@@ -25,9 +25,15 @@ set -e
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff -b -B}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
+
TMPFILE1=ca-no-pathlen-$$.tmp
TMPFILE2=no-ca-or-pathlen-$$.tmp
${VALGRIND} "${CERTTOOL}" --certificate-info --infile "${srcdir}/data/ca-no-pathlen.pem" \
diff --git a/tests/cert-tests/pem-decoding b/tests/cert-tests/pem-decoding
index 2977888aba..b4c2a44120 100755
--- a/tests/cert-tests/pem-decoding
+++ b/tests/cert-tests/pem-decoding
@@ -25,6 +25,11 @@
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff -b -B}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/cert-tests/pkcs12 b/tests/cert-tests/pkcs12
index c489d54354..f28bd8008d 100755
--- a/tests/cert-tests/pkcs12
+++ b/tests/cert-tests/pkcs12
@@ -23,6 +23,11 @@
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=1"
fi
diff --git a/tests/cert-tests/pkcs12-utf8 b/tests/cert-tests/pkcs12-utf8
index 58d7767925..1d70e95656 100755
--- a/tests/cert-tests/pkcs12-utf8
+++ b/tests/cert-tests/pkcs12-utf8
@@ -26,6 +26,11 @@
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=1"
fi
diff --git a/tests/cert-tests/pkcs7-broken-sigs b/tests/cert-tests/pkcs7-broken-sigs
index 913b2aa6eb..b9351a055a 100755
--- a/tests/cert-tests/pkcs7-broken-sigs
+++ b/tests/cert-tests/pkcs7-broken-sigs
@@ -23,9 +23,15 @@
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff -b -B}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=15"
fi
+
OUTFILE=out-pkcs7.$$.tmp
OUTFILE2=out2-pkcs7.$$.tmp
diff --git a/tests/cert-tests/privkey-import b/tests/cert-tests/privkey-import
index 084094c0f2..6eaa237836 100755
--- a/tests/cert-tests/privkey-import
+++ b/tests/cert-tests/privkey-import
@@ -23,6 +23,11 @@
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/cert-tests/provable-dh b/tests/cert-tests/provable-dh
index 452a725314..0676c0f5f0 100755
--- a/tests/cert-tests/provable-dh
+++ b/tests/cert-tests/provable-dh
@@ -25,6 +25,10 @@ CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff}"
OUTFILE=provable-dh$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/cert-tests/provable-dh-default b/tests/cert-tests/provable-dh-default
index 517e2267b0..43c2ed5aff 100755
--- a/tests/cert-tests/provable-dh-default
+++ b/tests/cert-tests/provable-dh-default
@@ -25,6 +25,10 @@ CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff}"
OUTFILE=provable-dh$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/cert-tests/provable-privkey b/tests/cert-tests/provable-privkey
index 4e11c61a9a..3f94f9ee24 100755
--- a/tests/cert-tests/provable-privkey
+++ b/tests/cert-tests/provable-privkey
@@ -25,6 +25,10 @@ CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff}"
OUTFILE=provable-privkey$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/cert-tests/provable-privkey-dsa2048 b/tests/cert-tests/provable-privkey-dsa2048
index fa65f091a4..f805ab3576 100755
--- a/tests/cert-tests/provable-privkey-dsa2048
+++ b/tests/cert-tests/provable-privkey-dsa2048
@@ -25,6 +25,10 @@ CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff}"
OUTFILE=provable-privkey.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/cert-tests/provable-privkey-gen-default b/tests/cert-tests/provable-privkey-gen-default
index d900c8c583..3edf3437d8 100755
--- a/tests/cert-tests/provable-privkey-gen-default
+++ b/tests/cert-tests/provable-privkey-gen-default
@@ -25,6 +25,10 @@ CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff}"
OUTFILE=provable-privkey$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/cert-tests/provable-privkey-rsa2048 b/tests/cert-tests/provable-privkey-rsa2048
index 3cd7aab441..f846476e7e 100755
--- a/tests/cert-tests/provable-privkey-rsa2048
+++ b/tests/cert-tests/provable-privkey-rsa2048
@@ -25,6 +25,10 @@ CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff}"
OUTFILE=provable-privkey$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/cert-tests/sha2-dsa-test b/tests/cert-tests/sha2-dsa-test
index 955d5ae84f..8632aefd31 100755
--- a/tests/cert-tests/sha2-dsa-test
+++ b/tests/cert-tests/sha2-dsa-test
@@ -31,6 +31,10 @@ TMPFILE=sha2-dsa.$$.tmp
USERFILE=user-dsa.$$.tmp
VERIFYFILE=verify-dsa.$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
echo ca > $TEMPLFILE
echo "cn = SHA 256 CA" >> $TEMPLFILE
diff --git a/tests/cert-tests/sha2-test b/tests/cert-tests/sha2-test
index 9447518b76..eca12fdf7c 100755
--- a/tests/cert-tests/sha2-test
+++ b/tests/cert-tests/sha2-test
@@ -32,6 +32,10 @@ TMPFILE=sha2.$$.tmp
USERFILE=user.$$.tmp
VERIFYFILE=verify.$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
echo ca > $TEMPLFILE
echo "cn = SHA 512 CA" >> $TEMPLFILE
diff --git a/tests/cert-tests/userid b/tests/cert-tests/userid
index 912e0c94ad..e3cdef1efa 100755
--- a/tests/cert-tests/userid
+++ b/tests/cert-tests/userid
@@ -23,6 +23,10 @@
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
"${CERTTOOL}" --certificate-info --infile "${srcdir}/data/userid.pem" >out 2>&1
RET=$?
if [ ${RET} != 0 ]; then
diff --git a/tests/fastopen.sh b/tests/fastopen.sh
index 2d0bd86182..fffc6493bc 100755
--- a/tests/fastopen.sh
+++ b/tests/fastopen.sh
@@ -21,10 +21,18 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
srcdir="${srcdir:-.}"
-SERV="${SERV:-../src/gnutls-serv${EXEEXT}} -q"
+SERV="${SERV:-../src/gnutls-serv${EXEEXT}}"
CLI="${CLI:-../src/gnutls-cli${EXEEXT}}"
unset RETCODE
+if ! test -x "${SERV}"; then
+ exit 77
+fi
+
+if ! test -x "${CLI}"; then
+ exit 77
+fi
+
if test "${WINDIR}" != ""; then
exit 77
fi
@@ -34,6 +42,8 @@ if ! test -z "${VALGRIND}"; then
fi
+SERV="${SERV} -q"
+
. "${srcdir}/scripts/common.sh"
echo "Checking Fast open"
diff --git a/tests/key-tests/dsa b/tests/key-tests/dsa
index 17a4472edf..9319b41a5f 100755
--- a/tests/key-tests/dsa
+++ b/tests/key-tests/dsa
@@ -21,12 +21,17 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
srcdir="${srcdir:-.}"
-SERV="${SERV:-../../src/gnutls-serv} -q"
+SERV="${SERV:-../../src/gnutls-serv}"
CLI="${CLI:-../../src/gnutls-cli}"
DEBUG=""
unset RETCODE
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
@@ -35,6 +40,8 @@ if test "${WINDIR}" != ""; then
exit 77
fi
+SERV="${SERV} -q"
+
. "${srcdir}/../scripts/common.sh"
size=`${VALGRIND} "${CERTTOOL}" -i --infile "${srcdir}/data/dsa-pubkey-1018.pem"|grep "Algorithm Secur"|cut -d '(' -f 2|cut -d ' ' -f 1`
diff --git a/tests/key-tests/ecdsa b/tests/key-tests/ecdsa
index c6e1bd8f7c..c593351b57 100755
--- a/tests/key-tests/ecdsa
+++ b/tests/key-tests/ecdsa
@@ -34,6 +34,10 @@ TMPTEMPL=template.$$.tmp
TMPUSER=user.$$.tmp
VERIFYOUT=verify.$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
echo ca > $TMPTEMPL
echo "cn = ECDSA SHA 256 CA" >> $TMPTEMPL
diff --git a/tests/key-tests/key-id b/tests/key-tests/key-id
index f5408b0982..4e600340f1 100755
--- a/tests/key-tests/key-id
+++ b/tests/key-tests/key-id
@@ -27,6 +27,10 @@ CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
TMPFILE=key-id.$$.tmp
TEMPLFILE=tmpl.$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=1"
fi
diff --git a/tests/key-tests/key-invalid b/tests/key-tests/key-invalid
index 43315a64e3..29d7f942b8 100755
--- a/tests/key-tests/key-invalid
+++ b/tests/key-tests/key-invalid
@@ -26,6 +26,10 @@ CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff -b -B}"
TMPFILE=key-invalid.$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/key-tests/pkcs8 b/tests/key-tests/pkcs8
index 0bf51a2340..7fee476e66 100755
--- a/tests/key-tests/pkcs8
+++ b/tests/key-tests/pkcs8
@@ -24,6 +24,10 @@ GREP="${GREP:-grep}"
TMPFILE=tmp-key-ca.$$.p8
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=1"
fi
diff --git a/tests/key-tests/pkcs8-decode b/tests/key-tests/pkcs8-decode
index b26ff4c983..9159d20f20 100755
--- a/tests/key-tests/pkcs8-decode
+++ b/tests/key-tests/pkcs8-decode
@@ -25,6 +25,10 @@ CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff -b -B}"
TMPFILE=pkcs8-decode.$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/key-tests/pkcs8-invalid b/tests/key-tests/pkcs8-invalid
index 13a4f3473a..0a02786822 100755
--- a/tests/key-tests/pkcs8-invalid
+++ b/tests/key-tests/pkcs8-invalid
@@ -25,6 +25,10 @@ CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff -b -B}"
TMPFILE=pkcs8-invalid.$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/rfc2253-escape-test b/tests/rfc2253-escape-test
index a2c64724f3..71a42504f4 100755
--- a/tests/rfc2253-escape-test
+++ b/tests/rfc2253-escape-test
@@ -23,6 +23,11 @@
set -e
CERTTOOL="${CERTTOOL:-../src/certtool${EXEEXT}}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=1"
fi
diff --git a/tests/starttls.sh b/tests/starttls.sh
index b342d5e024..3742964f9c 100755
--- a/tests/starttls.sh
+++ b/tests/starttls.sh
@@ -21,10 +21,18 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
srcdir="${srcdir:-.}"
-SERV="${SERV:-../src/gnutls-serv${EXEEXT}} -q"
+SERV="${SERV:-../src/gnutls-serv${EXEEXT}}"
CLI="${CLI:-../src/gnutls-cli${EXEEXT}}"
unset RETCODE
+if ! test -x "${SERV}"; then
+ exit 77
+fi
+
+if ! test -x "${CLI}"; then
+ exit 77
+fi
+
if test "${WINDIR}" != ""; then
exit 77
fi
@@ -52,6 +60,8 @@ then
exit 77
fi
+SERV="${SERV} -q"
+
. "${srcdir}/scripts/common.sh"
echo "Checking STARTTLS"
diff --git a/tests/suite/chain.sh b/tests/suite/chain.sh
index 10868f97b9..d179f4ea4b 100755
--- a/tests/suite/chain.sh
+++ b/tests/suite/chain.sh
@@ -20,8 +20,14 @@
# along with GnuTLS; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+cd x509paths
+
CERTTOOL="${CERTTOOL:-../../../src/certtool${EXEEXT}}"
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=15"
fi
@@ -30,8 +36,6 @@ SUCCESS=" 1 4 7 12 15 16 17 18 24 26 27 30 33 56 57 62 63 "
FAILURE=" 2 3 5 6 8 9 10 11 13 14 19 20 21 22 23 25 28 29 31 32 54 55 58 59 60 61 "
KNOWN_BUGS=" 15 16 17 18 19 31 32 "
-cd x509paths
-
test -d X509tests || tar xfz x509tests.tgz
mkdir -p chains
RET=0
diff --git a/tests/suite/crl-test b/tests/suite/crl-test
index a2b544c2a0..85c40e50fb 100755
--- a/tests/suite/crl-test
+++ b/tests/suite/crl-test
@@ -23,9 +23,15 @@
srcdir="${srcdir:-.}"
DIFF="${DIFF:-diff}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
+
TMPFILE=long.$$.pem.tmp
rm -f $TMPFILE
diff --git a/tests/suite/eagain.sh b/tests/suite/eagain.sh
index 1663e7e85b..afeb6e2fcb 100755
--- a/tests/suite/eagain.sh
+++ b/tests/suite/eagain.sh
@@ -21,7 +21,13 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
srcdir="${srcdir:-.}"
-SERV="${SERV:-../../src/gnutls-serv${EXEEXT}} -q"
+SERV="${SERV:-../../src/gnutls-serv${EXEEXT}}"
+
+if ! test -x "${SERV}"; then
+ exit 77
+fi
+
+SERV="${SERV} -q"
. "${srcdir}/../scripts/common.sh"
diff --git a/tests/suite/invalid-cert.sh b/tests/suite/invalid-cert.sh
index 00bf1e4e3b..a13bf883e2 100755
--- a/tests/suite/invalid-cert.sh
+++ b/tests/suite/invalid-cert.sh
@@ -22,6 +22,11 @@
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/suite/pkcs7-cat b/tests/suite/pkcs7-cat
index a034b0c487..1ddfd6bab1 100755
--- a/tests/suite/pkcs7-cat
+++ b/tests/suite/pkcs7-cat
@@ -28,6 +28,10 @@ if ! test -z "${VALGRIND}"; then
fi
OUTFILE=out-pkcs7.$$.tmp
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
. ${srcdir}/../scripts/common.sh
check_for_datefudge
diff --git a/tests/suite/testdane.sh b/tests/suite/testdane.sh
index 1dd2d90700..5bef05dfa7 100755
--- a/tests/suite/testdane.sh
+++ b/tests/suite/testdane.sh
@@ -22,6 +22,10 @@ srcdir="${srcdir:-.}"
DANETOOL="${DANETOOL:-../../src/danetool${EXEEXT}}"
unset RETCODE
+if ! test -x "${DANETOOL}"; then
+ exit 77
+fi
+
# Unfortunately it is extremely fragile and fails 99% of the
# time.
if test "${WINDIR}" != ""; then
diff --git a/tests/suite/testpkcs11.sh b/tests/suite/testpkcs11.sh
index f416957934..157f7282b1 100755
--- a/tests/suite/testpkcs11.sh
+++ b/tests/suite/testpkcs11.sh
@@ -22,10 +22,26 @@ srcdir="${srcdir:-.}"
P11TOOL="${P11TOOL:-../../src/p11tool${EXEEXT}}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
DIFF="${DIFF:-diff -b -B}"
-SERV="${SERV:-../../src/gnutls-serv${EXEEXT}} -q"
+SERV="${SERV:-../../src/gnutls-serv${EXEEXT}}"
CLI="${CLI:-../../src/gnutls-cli${EXEEXT}}"
RETCODE=0
+if ! test -x "${P11TOOL}"; then
+ exit 77
+fi
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
+if ! test -x "${SERV}"; then
+ exit 77
+fi
+
+if ! test -x "${CLI}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute valgrind --leak-check=full"
fi
@@ -38,6 +54,7 @@ if test "${WINDIR}" != ""; then
fi
P11TOOL="${VALGRIND} ${P11TOOL} --batch"
+SERV="${SERV} -q"
. ${srcdir}/../scripts/common.sh
diff --git a/tests/suite/testrandom.sh b/tests/suite/testrandom.sh
index 75e4a40786..7e68a713a6 100755
--- a/tests/suite/testrandom.sh
+++ b/tests/suite/testrandom.sh
@@ -22,6 +22,11 @@
srcdir="${srcdir:-.}"
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
diff --git a/tests/suite/testsrn.sh b/tests/suite/testsrn.sh
index 446a988282..b41dbb442f 100755
--- a/tests/suite/testsrn.sh
+++ b/tests/suite/testsrn.sh
@@ -21,10 +21,18 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
srcdir="${srcdir:-.}"
-SERV="${SERV:-../../src/gnutls-serv${EXEEXT}} -q"
+SERV="${SERV:-../../src/gnutls-serv${EXEEXT}}"
CLI="${CLI:-../../src/gnutls-cli${EXEEXT}}"
unset RETCODE
+if ! test -x "${SERV}"; then
+ exit 77
+fi
+
+if ! test -x "${CLI}"; then
+ exit 77
+fi
+
if test "${WINDIR}" != ""; then
exit 77
fi
@@ -34,6 +42,8 @@ if ! test -z "${VALGRIND}"; then
fi
+SERV="${SERV} -q"
+
. "${srcdir}/../scripts/common.sh"
echo "Checking Safe renegotiation"