From 9a38264f2065ae97ef3307f47c67bbee2313cb1c Mon Sep 17 00:00:00 2001 From: Alon Bar-Lev Date: Sat, 31 Dec 2016 05:07:47 +0200 Subject: 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 --- tests/cert-tests/aki | 5 +++++ tests/cert-tests/certtool | 5 +++++ tests/cert-tests/certtool-long-cn | 4 ++++ tests/cert-tests/certtool-long-oids | 4 ++++ tests/cert-tests/crl | 6 ++++++ tests/cert-tests/email | 5 +++++ tests/cert-tests/openpgp-cert-parser | 4 ++++ tests/cert-tests/openpgp-certs | 13 ++++++++++++- tests/cert-tests/openpgp-selfsigs | 4 ++++ tests/cert-tests/pathlen | 6 ++++++ tests/cert-tests/pem-decoding | 5 +++++ tests/cert-tests/pkcs12 | 5 +++++ tests/cert-tests/pkcs12-utf8 | 5 +++++ tests/cert-tests/pkcs7-broken-sigs | 6 ++++++ tests/cert-tests/privkey-import | 5 +++++ tests/cert-tests/provable-dh | 4 ++++ tests/cert-tests/provable-dh-default | 4 ++++ tests/cert-tests/provable-privkey | 4 ++++ tests/cert-tests/provable-privkey-dsa2048 | 4 ++++ tests/cert-tests/provable-privkey-gen-default | 4 ++++ tests/cert-tests/provable-privkey-rsa2048 | 4 ++++ tests/cert-tests/sha2-dsa-test | 4 ++++ tests/cert-tests/sha2-test | 4 ++++ tests/cert-tests/userid | 4 ++++ tests/fastopen.sh | 12 +++++++++++- tests/key-tests/dsa | 9 ++++++++- tests/key-tests/ecdsa | 4 ++++ tests/key-tests/key-id | 4 ++++ tests/key-tests/key-invalid | 4 ++++ tests/key-tests/pkcs8 | 4 ++++ tests/key-tests/pkcs8-decode | 4 ++++ tests/key-tests/pkcs8-invalid | 4 ++++ tests/rfc2253-escape-test | 5 +++++ tests/starttls.sh | 12 +++++++++++- tests/suite/certtool-pkcs11.sh | 19 ++++++++++++++++++- tests/suite/chain.sh | 8 ++++++-- tests/suite/crl-test | 6 ++++++ tests/suite/eagain.sh | 8 +++++++- tests/suite/invalid-cert.sh | 5 +++++ tests/suite/pkcs7-cat | 4 ++++ tests/suite/testdane.sh | 4 ++++ tests/suite/testpkcs11.sh | 19 ++++++++++++++++++- tests/suite/testrandom.sh | 5 +++++ tests/suite/testsrn.sh | 12 +++++++++++- 44 files changed, 260 insertions(+), 10 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-cert-parser b/tests/cert-tests/openpgp-cert-parser index 2cd843cc66..800a2038c6 100755 --- a/tests/cert-tests/openpgp-cert-parser +++ b/tests/cert-tests/openpgp-cert-parser @@ -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/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/certtool-pkcs11.sh b/tests/suite/certtool-pkcs11.sh index 7bc0784249..6a083bced3 100755 --- a/tests/suite/certtool-pkcs11.sh +++ b/tests/suite/certtool-pkcs11.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/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 2f5ad2242e..414a5ae89b 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" -- cgit v1.2.1