summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2020-06-09 10:41:18 +0200
committerDaiki Ueno <ueno@gnu.org>2020-06-12 08:01:27 +0200
commitc06de1e19b5446bae5cb8e982746a547dd4061b4 (patch)
tree29cc941f2756ffad1adb26c8ace5d0b38e463e4b
parent1270e81b944e1672f89d8a8b1db986535cf5b072 (diff)
downloadgnutls-c06de1e19b5446bae5cb8e982746a547dd4061b4.tar.gz
tests: check_for_datefudge: don't exit the test programs
This makes check_for_datefudge not to immediately exit the program, but to return non-zero to allow the tests by themselves to control the behavior when "datefudge" is not found. Signed-off-by: Daiki Ueno <ueno@gnu.org>
-rwxr-xr-xtests/cert-reencoding.sh2
-rwxr-xr-xtests/cert-tests/alt-chain2
-rwxr-xr-xtests/cert-tests/cert-critical2
-rwxr-xr-xtests/cert-tests/cert-non-digits-time2
-rwxr-xr-xtests/cert-tests/certtool2
-rwxr-xr-xtests/cert-tests/certtool-eddsa2
-rwxr-xr-xtests/cert-tests/certtool-rsa-pss2
-rwxr-xr-xtests/cert-tests/certtool-verify-profiles2
-rwxr-xr-xtests/cert-tests/crl2
-rwxr-xr-xtests/cert-tests/crq2
-rwxr-xr-xtests/cert-tests/inhibit-anypolicy2
-rwxr-xr-xtests/cert-tests/krb5-test2
-rwxr-xr-xtests/cert-tests/md5-test2
-rwxr-xr-xtests/cert-tests/name-constraints2
-rwxr-xr-xtests/cert-tests/othername-test2
-rwxr-xr-xtests/cert-tests/pkcs1-pad2
-rwxr-xr-xtests/cert-tests/pkcs72
-rwxr-xr-xtests/cert-tests/pkcs7-cat2
-rwxr-xr-xtests/cert-tests/pkcs7-constraints2
-rwxr-xr-xtests/cert-tests/pkcs7-constraints22
-rwxr-xr-xtests/cert-tests/pkcs7-eddsa2
-rwxr-xr-xtests/cert-tests/pkcs7-list-sign2
-rwxr-xr-xtests/cert-tests/rsa-pss-pad2
-rwxr-xr-xtests/cert-tests/sha3-test2
-rwxr-xr-xtests/cert-tests/smime2
-rwxr-xr-xtests/cert-tests/template-exts-test2
-rwxr-xr-xtests/cert-tests/template-test2
-rwxr-xr-xtests/cert-tests/tlsfeature-test2
-rwxr-xr-xtests/certtool-pkcs11.sh2
-rwxr-xr-xtests/gnutls-cli-debug.sh2
-rwxr-xr-xtests/gnutls-cli-invalid-crl.sh2
-rwxr-xr-xtests/gnutls-cli-self-signed.sh2
-rwxr-xr-xtests/ocsp-tests/ocsp-load-chain2
-rwxr-xr-xtests/ocsp-tests/ocsp-must-staple-connection2
-rwxr-xr-xtests/ocsp-tests/ocsp-test2
-rwxr-xr-xtests/ocsp-tests/ocsp-tls-connection2
-rwxr-xr-xtests/pkcs7-cat.sh2
-rwxr-xr-xtests/rsa-md5-collision/rsa-md5-collision.sh2
-rw-r--r--tests/scripts/common.sh7
-rwxr-xr-xtests/server-multi-keys.sh2
-rwxr-xr-xtests/server-weak-keys.sh2
-rwxr-xr-xtests/suite/testcompat-oldgnutls.sh2
-rwxr-xr-xtests/suite/testcompat-openssl.sh2
-rwxr-xr-xtests/suite/testcompat-polarssl.sh2
-rwxr-xr-xtests/suite/testcompat-tls13-openssl.sh2
-rwxr-xr-xtests/system-override-profiles.sh2
-rwxr-xr-xtests/system-override-tls.sh2
-rwxr-xr-xtests/tls13/prf-early.sh2
48 files changed, 53 insertions, 48 deletions
diff --git a/tests/cert-reencoding.sh b/tests/cert-reencoding.sh
index aadd6fd1bd..240d336778 100755
--- a/tests/cert-reencoding.sh
+++ b/tests/cert-reencoding.sh
@@ -57,7 +57,7 @@ export TZ="UTC"
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
eval "${GETPORT}"
# Port for gnutls-serv
diff --git a/tests/cert-tests/alt-chain b/tests/cert-tests/alt-chain
index b715416cc0..a2261b3809 100755
--- a/tests/cert-tests/alt-chain
+++ b/tests/cert-tests/alt-chain
@@ -36,7 +36,7 @@ OUTFILE=out-pkcs7.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
OLD_CA_FILE="${srcdir}/data/alt-chain-old-ca.pem"
NEW_CA_FILE="${srcdir}/data/alt-chain-new-ca.pem"
diff --git a/tests/cert-tests/cert-critical b/tests/cert-tests/cert-critical
index 74f335cb87..f923b29fa4 100755
--- a/tests/cert-tests/cert-critical
+++ b/tests/cert-tests/cert-critical
@@ -36,7 +36,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
datefudge "2017-2-28" \
${VALGRIND} "${CERTTOOL}" --verify-chain --infile ${srcdir}/data/chain-with-critical-on-root.pem
diff --git a/tests/cert-tests/cert-non-digits-time b/tests/cert-tests/cert-non-digits-time
index 28880b87ac..9c25c396de 100755
--- a/tests/cert-tests/cert-non-digits-time
+++ b/tests/cert-tests/cert-non-digits-time
@@ -32,7 +32,7 @@ if ! test -z "${VALGRIND}"; then
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
-check_for_datefudge
+skip_if_no_datefudge
# Check whether certificates with non-digits time fields are accepted
datefudge -s "2019-12-19" \
diff --git a/tests/cert-tests/certtool b/tests/cert-tests/certtool
index 3494aaacbe..0fd29beea9 100755
--- a/tests/cert-tests/certtool
+++ b/tests/cert-tests/certtool
@@ -171,7 +171,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
cat "${srcdir}/../certs/cert-ecc256.pem" "${srcdir}/../certs/ca-cert-ecc.pem"|datefudge "2012-11-22" \
${VALGRIND} "${CERTTOOL}" --verify-chain
diff --git a/tests/cert-tests/certtool-eddsa b/tests/cert-tests/certtool-eddsa
index c097fbf6c6..7e07822507 100755
--- a/tests/cert-tests/certtool-eddsa
+++ b/tests/cert-tests/certtool-eddsa
@@ -124,7 +124,7 @@ rm -f "${TMPFILE}" "${TMPFILE2}"
rm -f "${KEYFILE}"
-check_for_datefudge
+skip_if_no_datefudge
# Test certificate chain using Ed25519
datefudge "2017-7-6" \
diff --git a/tests/cert-tests/certtool-rsa-pss b/tests/cert-tests/certtool-rsa-pss
index aed79ff2e2..654bf34869 100755
--- a/tests/cert-tests/certtool-rsa-pss
+++ b/tests/cert-tests/certtool-rsa-pss
@@ -210,7 +210,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
datefudge "2012-11-22" \
${VALGRIND} "${CERTTOOL}" --verify --load-ca-certificate "${srcdir}/data/cert-rsa-pss.pem" --infile "${srcdir}/data/cert-rsa-pss.pem"
diff --git a/tests/cert-tests/certtool-verify-profiles b/tests/cert-tests/certtool-verify-profiles
index a7ebd711ea..a4d738627e 100755
--- a/tests/cert-tests/certtool-verify-profiles
+++ b/tests/cert-tests/certtool-verify-profiles
@@ -36,7 +36,7 @@ OUTFILE=out-pkcs7.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
echo "Checking chain with insecure leaf"
datefudge -s "2019-12-19" \
diff --git a/tests/cert-tests/crl b/tests/cert-tests/crl
index 62b320b2bf..f4f97d757b 100755
--- a/tests/cert-tests/crl
+++ b/tests/cert-tests/crl
@@ -171,7 +171,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
datefudge -s "2020-01-20 10:00:00" ${VALGRIND} \
"${CERTTOOL}" --generate-crl --load-ca-privkey "${srcdir}/data/template-test.key" \
diff --git a/tests/cert-tests/crq b/tests/cert-tests/crq
index 89099cfc0a..1d64dee27e 100755
--- a/tests/cert-tests/crq
+++ b/tests/cert-tests/crq
@@ -40,7 +40,7 @@ OUTFILE2=out2.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
${VALGRIND} "${CERTTOOL}" --inder --crq-info --infile "${srcdir}/data/csr-invalid.der" >"${OUTFILE}" 2>&1
rc=$?
diff --git a/tests/cert-tests/inhibit-anypolicy b/tests/cert-tests/inhibit-anypolicy
index 7e82a20014..ba5e1100f6 100755
--- a/tests/cert-tests/inhibit-anypolicy
+++ b/tests/cert-tests/inhibit-anypolicy
@@ -36,7 +36,7 @@ SUBCAFILE=inhibit-subca.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
datefudge -s "2017-04-22" \
"${CERTTOOL}" --generate-self-signed \
diff --git a/tests/cert-tests/krb5-test b/tests/cert-tests/krb5-test
index 3eca7d7e31..a6e092cc90 100755
--- a/tests/cert-tests/krb5-test
+++ b/tests/cert-tests/krb5-test
@@ -34,7 +34,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
if ! test -z "${VALGRIND}"; then
ORIG_VALGRIND=${VALGRIND}
diff --git a/tests/cert-tests/md5-test b/tests/cert-tests/md5-test
index a9635cc1d8..15d6280b1c 100755
--- a/tests/cert-tests/md5-test
+++ b/tests/cert-tests/md5-test
@@ -34,7 +34,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
# Test MD5 signatures
diff --git a/tests/cert-tests/name-constraints b/tests/cert-tests/name-constraints
index f23462117e..3b2370d49a 100755
--- a/tests/cert-tests/name-constraints
+++ b/tests/cert-tests/name-constraints
@@ -36,7 +36,7 @@ TMPFILE=constraints.$$.pem.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
datefudge -s "2016-04-22" \
${VALGRIND} "${CERTTOOL}" --verify-allow-broken -e --infile "${srcdir}/data/name-constraints-ip.pem"
diff --git a/tests/cert-tests/othername-test b/tests/cert-tests/othername-test
index 38032fee1c..00f93b22dd 100755
--- a/tests/cert-tests/othername-test
+++ b/tests/cert-tests/othername-test
@@ -33,7 +33,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
# Note that in rare cases this test may fail because the
# time set using datefudge could have changed since the generation
diff --git a/tests/cert-tests/pkcs1-pad b/tests/cert-tests/pkcs1-pad
index 33663a6a0b..c75ab9e09d 100755
--- a/tests/cert-tests/pkcs1-pad
+++ b/tests/cert-tests/pkcs1-pad
@@ -34,7 +34,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
TMPFILE1=pkcs1-pad.$$.tmp
TMPFILE2=pkcs1-pad-2.$$.tmp
diff --git a/tests/cert-tests/pkcs7 b/tests/cert-tests/pkcs7
index 35d438107e..23db9e017e 100755
--- a/tests/cert-tests/pkcs7
+++ b/tests/cert-tests/pkcs7
@@ -38,7 +38,7 @@ TMPFILE=tmp-pkcs7.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
if test "${ENABLE_GOST}" = "1" && test "${GNUTLS_FORCE_FIPS_MODE}" != "1"
then
diff --git a/tests/cert-tests/pkcs7-cat b/tests/cert-tests/pkcs7-cat
index 0f5b82df12..6543397431 100755
--- a/tests/cert-tests/pkcs7-cat
+++ b/tests/cert-tests/pkcs7-cat
@@ -36,7 +36,7 @@ OUTFILE=out-pkcs7.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
datefudge -s "2016-10-1" \
${VALGRIND} "${CERTTOOL}" --verify-allow-broken --p7-verify --inder --infile "${srcdir}/data/pkcs7-cat.p7" --load-ca-certificate "${srcdir}/data/pkcs7-cat-ca.pem"
rc=$?
diff --git a/tests/cert-tests/pkcs7-constraints b/tests/cert-tests/pkcs7-constraints
index 8e5b5345d1..6964d26f09 100755
--- a/tests/cert-tests/pkcs7-constraints
+++ b/tests/cert-tests/pkcs7-constraints
@@ -36,7 +36,7 @@ OUTFILE=out-pkcs7.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
FILE="signing"
diff --git a/tests/cert-tests/pkcs7-constraints2 b/tests/cert-tests/pkcs7-constraints2
index 389071e27b..7d1816a33a 100755
--- a/tests/cert-tests/pkcs7-constraints2
+++ b/tests/cert-tests/pkcs7-constraints2
@@ -36,7 +36,7 @@ OUTFILE=out-pkcs7.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
FILE="signing"
diff --git a/tests/cert-tests/pkcs7-eddsa b/tests/cert-tests/pkcs7-eddsa
index 1fd767bd73..6f235c512b 100755
--- a/tests/cert-tests/pkcs7-eddsa
+++ b/tests/cert-tests/pkcs7-eddsa
@@ -36,7 +36,7 @@ OUTFILE2=out2-pkcs7.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
KEY="${srcdir}/../certs/ed25519.pem"
CERT="${srcdir}/../certs/cert-ed25519.pem"
diff --git a/tests/cert-tests/pkcs7-list-sign b/tests/cert-tests/pkcs7-list-sign
index 1c4e930e5b..5ca04d8005 100755
--- a/tests/cert-tests/pkcs7-list-sign
+++ b/tests/cert-tests/pkcs7-list-sign
@@ -37,7 +37,7 @@ OUTFILE2=out2-pkcs7.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
# Test signing
FILE="signing-with-cert-list"
${VALGRIND} "${CERTTOOL}" --p7-sign --load-certificate "${srcdir}/data/pkcs7-chain.pem" --load-privkey "${srcdir}/data/pkcs7-chain-endcert-key.pem" --infile "${srcdir}/data/pkcs7-detached.txt" >"${OUTFILE}"
diff --git a/tests/cert-tests/rsa-pss-pad b/tests/cert-tests/rsa-pss-pad
index d9a05e4e0f..2c87c750fc 100755
--- a/tests/cert-tests/rsa-pss-pad
+++ b/tests/cert-tests/rsa-pss-pad
@@ -33,7 +33,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
# Note that in rare cases this test may fail because the
# time set using datefudge could have changed since the generation
diff --git a/tests/cert-tests/sha3-test b/tests/cert-tests/sha3-test
index dc3cf8f6ba..a4300672c3 100755
--- a/tests/cert-tests/sha3-test
+++ b/tests/cert-tests/sha3-test
@@ -33,7 +33,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
# Note that in rare cases this test may fail because the
# time set using datefudge could have changed since the generation
diff --git a/tests/cert-tests/smime b/tests/cert-tests/smime
index dd5514f687..f5e68401cf 100755
--- a/tests/cert-tests/smime
+++ b/tests/cert-tests/smime
@@ -36,7 +36,7 @@ OUTFILE=out-pkcs7.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
# test the --smime-to-p7 functionality
${VAGRLIND} "${CERTTOOL}" --smime-to-p7 --infile "${srcdir}/data/pkcs7.smime" --outfile ${OUTFILE}
diff --git a/tests/cert-tests/template-exts-test b/tests/cert-tests/template-exts-test
index 32e90f91e3..276ba2f798 100755
--- a/tests/cert-tests/template-exts-test
+++ b/tests/cert-tests/template-exts-test
@@ -33,7 +33,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
datefudge -s "2007-04-22" \
"${CERTTOOL}" --generate-self-signed \
diff --git a/tests/cert-tests/template-test b/tests/cert-tests/template-test
index f7ebefb664..091021315b 100755
--- a/tests/cert-tests/template-test
+++ b/tests/cert-tests/template-test
@@ -34,7 +34,7 @@ TMPFILE=tmp-tt.pem.$$.tmp
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
echo "Running test for ${ac_cv_sizeof_time_t}-byte time_t"
diff --git a/tests/cert-tests/tlsfeature-test b/tests/cert-tests/tlsfeature-test
index aadbffc26a..fb26f6225b 100755
--- a/tests/cert-tests/tlsfeature-test
+++ b/tests/cert-tests/tlsfeature-test
@@ -34,7 +34,7 @@ export TZ="UTC"
. ${srcdir}/../scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
#
# Test certificate generation
diff --git a/tests/certtool-pkcs11.sh b/tests/certtool-pkcs11.sh
index 9a599e6146..daba535a4d 100755
--- a/tests/certtool-pkcs11.sh
+++ b/tests/certtool-pkcs11.sh
@@ -68,7 +68,7 @@ exit_error () {
exit 1
}
-check_for_datefudge
+skip_if_no_datefudge
# $1: token
# $2: PIN
diff --git a/tests/gnutls-cli-debug.sh b/tests/gnutls-cli-debug.sh
index 0ab6069b8f..3351764216 100755
--- a/tests/gnutls-cli-debug.sh
+++ b/tests/gnutls-cli-debug.sh
@@ -48,7 +48,7 @@ SERV="${SERV} -q"
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
KEY1=${srcdir}/../doc/credentials/x509/key-rsa.pem
diff --git a/tests/gnutls-cli-invalid-crl.sh b/tests/gnutls-cli-invalid-crl.sh
index d7383a555b..1a82bfafd3 100755
--- a/tests/gnutls-cli-invalid-crl.sh
+++ b/tests/gnutls-cli-invalid-crl.sh
@@ -47,7 +47,7 @@ SERV="${SERV} -q"
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
echo "Checking whether connecting to a server but with an invalid CRL provided, returns the expected error"
diff --git a/tests/gnutls-cli-self-signed.sh b/tests/gnutls-cli-self-signed.sh
index 07cd5824b8..fbb5375bf0 100755
--- a/tests/gnutls-cli-self-signed.sh
+++ b/tests/gnutls-cli-self-signed.sh
@@ -45,7 +45,7 @@ SERV="${SERV} -q"
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
echo "Checking whether connecting to a self signed certificate returns the expected error"
diff --git a/tests/ocsp-tests/ocsp-load-chain b/tests/ocsp-tests/ocsp-load-chain
index 04de48f7ed..0822bc3d99 100755
--- a/tests/ocsp-tests/ocsp-load-chain
+++ b/tests/ocsp-tests/ocsp-load-chain
@@ -31,7 +31,7 @@ export TZ="UTC"
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
datefudge -s "2017-06-19" \
"${OCSPTOOL}" -e --load-chain "${srcdir}/ocsp-tests/certs/chain-amazon.com.pem" --infile "${srcdir}/ocsp-tests/certs/ocsp-amazon.com.der" --verify-allow-broken
diff --git a/tests/ocsp-tests/ocsp-must-staple-connection b/tests/ocsp-tests/ocsp-must-staple-connection
index 490cc032f0..49c355dda3 100755
--- a/tests/ocsp-tests/ocsp-must-staple-connection
+++ b/tests/ocsp-tests/ocsp-must-staple-connection
@@ -53,7 +53,7 @@ fi
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
eval "${GETPORT}"
# Port for gnutls-serv
diff --git a/tests/ocsp-tests/ocsp-test b/tests/ocsp-tests/ocsp-test
index 3730175208..bc2641a22e 100755
--- a/tests/ocsp-tests/ocsp-test
+++ b/tests/ocsp-tests/ocsp-test
@@ -32,7 +32,7 @@ export TZ="UTC"
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
# Note that in rare cases this test may fail because the
# time set using datefudge could have changed since the generation
diff --git a/tests/ocsp-tests/ocsp-tls-connection b/tests/ocsp-tests/ocsp-tls-connection
index bcc77ec2d9..870f4ff78b 100755
--- a/tests/ocsp-tests/ocsp-tls-connection
+++ b/tests/ocsp-tests/ocsp-tls-connection
@@ -54,7 +54,7 @@ export TZ="UTC"
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
eval "${GETPORT}"
# Port for gnutls-serv
diff --git a/tests/pkcs7-cat.sh b/tests/pkcs7-cat.sh
index 2f3b0b0b35..a7a53a431a 100755
--- a/tests/pkcs7-cat.sh
+++ b/tests/pkcs7-cat.sh
@@ -34,7 +34,7 @@ fi
. ${srcdir}/scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
#try verification
datefudge -s "2010-10-10" \
diff --git a/tests/rsa-md5-collision/rsa-md5-collision.sh b/tests/rsa-md5-collision/rsa-md5-collision.sh
index a935804dc0..e319544b73 100755
--- a/tests/rsa-md5-collision/rsa-md5-collision.sh
+++ b/tests/rsa-md5-collision/rsa-md5-collision.sh
@@ -31,7 +31,7 @@ if ! test -x "${CERTTOOL}"; then
fi
. ${srcdir}/scripts/common.sh
-check_for_datefudge
+skip_if_no_datefudge
# Disable leak detection
ASAN_OPTIONS="detect_leaks=0"
diff --git a/tests/scripts/common.sh b/tests/scripts/common.sh
index 95f8a5298e..6ae19fa586 100644
--- a/tests/scripts/common.sh
+++ b/tests/scripts/common.sh
@@ -80,7 +80,12 @@ check_for_datefudge() {
TSTAMP=`datefudge -s "2006-09-23" "${top_builddir}/tests/datefudge-check" || true`
if test "$TSTAMP" != "1158969600" || test "$WINDOWS" = 1; then
- echo $TSTAMP
+ return 1
+ fi
+}
+
+skip_if_no_datefudge() {
+ if ! check_for_datefudge; then
echo "You need datefudge to run this test"
exit 77
fi
diff --git a/tests/server-multi-keys.sh b/tests/server-multi-keys.sh
index 3138fb6888..7737ec9b83 100755
--- a/tests/server-multi-keys.sh
+++ b/tests/server-multi-keys.sh
@@ -46,7 +46,7 @@ SERV="${SERV} -q"
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
echo "Checking whether server can utilize multiple keys"
diff --git a/tests/server-weak-keys.sh b/tests/server-weak-keys.sh
index 31c51a80bc..1fa14711fb 100755
--- a/tests/server-weak-keys.sh
+++ b/tests/server-weak-keys.sh
@@ -46,7 +46,7 @@ SERV="${SERV} -q"
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
echo "Checking whether a client will refuse weak but trusted keys"
diff --git a/tests/suite/testcompat-oldgnutls.sh b/tests/suite/testcompat-oldgnutls.sh
index 2ec96b20c2..937bf57050 100755
--- a/tests/suite/testcompat-oldgnutls.sh
+++ b/tests/suite/testcompat-oldgnutls.sh
@@ -54,7 +54,7 @@ LDPATH=/usr/local/OLDGNUTLS/lib/x86_64-linux-gnu:/usr/local/OLDGNUTLS/usr/lib/x8
. "${srcdir}/../scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
. "${srcdir}/testcompat-common"
diff --git a/tests/suite/testcompat-openssl.sh b/tests/suite/testcompat-openssl.sh
index bfc59c09ac..b932a599c9 100755
--- a/tests/suite/testcompat-openssl.sh
+++ b/tests/suite/testcompat-openssl.sh
@@ -54,7 +54,7 @@ export TZ="UTC"
# Check for datefudge
. "${srcdir}/../scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
timeout 1800 datefudge "2012-09-2" "${srcdir}/testcompat-main-openssl"
diff --git a/tests/suite/testcompat-polarssl.sh b/tests/suite/testcompat-polarssl.sh
index 1af0099dca..2197a94bf7 100755
--- a/tests/suite/testcompat-polarssl.sh
+++ b/tests/suite/testcompat-polarssl.sh
@@ -42,7 +42,7 @@ fi
# Check for datefudge
. "${srcdir}/../scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
cat /proc/cpuinfo|grep "model name"|grep "VIA Esther" >/dev/null 2>&1
if test $? = 0; then
diff --git a/tests/suite/testcompat-tls13-openssl.sh b/tests/suite/testcompat-tls13-openssl.sh
index 128873ab23..bc198a02b6 100755
--- a/tests/suite/testcompat-tls13-openssl.sh
+++ b/tests/suite/testcompat-tls13-openssl.sh
@@ -49,7 +49,7 @@ fi
. "${srcdir}/../scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
. "${srcdir}/testcompat-common"
diff --git a/tests/system-override-profiles.sh b/tests/system-override-profiles.sh
index 88ec631798..516ce57e71 100755
--- a/tests/system-override-profiles.sh
+++ b/tests/system-override-profiles.sh
@@ -41,7 +41,7 @@ fi
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
CERT="${srcdir}/certs/cert-ecc256.pem"
KEY="${srcdir}/certs/ecc256.pem"
diff --git a/tests/system-override-tls.sh b/tests/system-override-tls.sh
index 6114d76282..54bc190dd9 100755
--- a/tests/system-override-tls.sh
+++ b/tests/system-override-tls.sh
@@ -40,7 +40,7 @@ fi
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
CERT="${srcdir}/certs/cert-ecc256.pem"
KEY="${srcdir}/certs/ecc256.pem"
diff --git a/tests/tls13/prf-early.sh b/tests/tls13/prf-early.sh
index b19da4cb65..7f62aba8d8 100755
--- a/tests/tls13/prf-early.sh
+++ b/tests/tls13/prf-early.sh
@@ -23,7 +23,7 @@ builddir="${builddir:-.}"
. "${srcdir}/scripts/common.sh"
-check_for_datefudge
+skip_if_no_datefudge
datefudge -s 2019-04-12 "${builddir}/tls13/prf-early" "$@"
exit $?