summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2019-12-21 19:21:55 +0100
committerTim Rühsen <tim.ruehsen@gmx.de>2020-01-03 11:34:37 +0100
commit6554630179a08c984809cca8d1c3f3924323a0a1 (patch)
tree6b44ac843ebe76503c52002818d1e41c3fd1eb1c
parent20eceef4c7a1310321cf85e7a96ef167ab477862 (diff)
downloadgnutls-6554630179a08c984809cca8d1c3f3924323a0a1.tar.gz
Use check_for_datefudge in tests
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
-rwxr-xr-xtests/cert-reencoding.sh10
-rwxr-xr-xtests/ocsp-tests/ocsp-load-chain10
-rwxr-xr-xtests/ocsp-tests/ocsp-must-staple-connection10
-rwxr-xr-xtests/ocsp-tests/ocsp-test10
-rwxr-xr-xtests/ocsp-tests/ocsp-tls-connection10
5 files changed, 12 insertions, 38 deletions
diff --git a/tests/cert-reencoding.sh b/tests/cert-reencoding.sh
index d61ec74028..aadd6fd1bd 100755
--- a/tests/cert-reencoding.sh
+++ b/tests/cert-reencoding.sh
@@ -57,6 +57,8 @@ export TZ="UTC"
. "${srcdir}/scripts/common.sh"
+check_for_datefudge
+
eval "${GETPORT}"
# Port for gnutls-serv
TLS_SERVER_PORT=$PORT
@@ -72,14 +74,6 @@ if ! test -x "${OPENSSL}"; then
exit 77
fi
-# Check for datefudge
-TSTAMP=`datefudge "2006-09-23" date -u +%s || true`
-if test "$TSTAMP" != "1158969600"; then
- echo $TSTAMP
- echo "You need datefudge to run this test."
- exit 77
-fi
-
SERVER_PID=""
TLS_SERVER_PID=""
stop_servers ()
diff --git a/tests/ocsp-tests/ocsp-load-chain b/tests/ocsp-tests/ocsp-load-chain
index 73bb4209d8..04de48f7ed 100755
--- a/tests/ocsp-tests/ocsp-load-chain
+++ b/tests/ocsp-tests/ocsp-load-chain
@@ -29,13 +29,9 @@ fi
export TZ="UTC"
-# Check for datefudge
-TSTAMP=`datefudge "2006-09-23" date -u +%s || true`
-if test "$TSTAMP" != "1158969600"; then
- echo $TSTAMP
- echo "You need datefudge to run this test"
- exit 77
-fi
+. "${srcdir}/scripts/common.sh"
+
+check_for_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 111c287a4c..490cc032f0 100755
--- a/tests/ocsp-tests/ocsp-must-staple-connection
+++ b/tests/ocsp-tests/ocsp-must-staple-connection
@@ -53,6 +53,8 @@ fi
. "${srcdir}/scripts/common.sh"
+check_for_datefudge
+
eval "${GETPORT}"
# Port for gnutls-serv
TLS_SERVER_PORT=$PORT
@@ -72,14 +74,6 @@ if ! test -x "${OPENSSL}"; then
exit 77
fi
-# Check for datefudge
-TSTAMP=`datefudge "2006-09-23" date -u +%s || true`
-if test "$TSTAMP" != "1158969600"; then
- echo $TSTAMP
- echo "You need datefudge to run this test."
- exit 77
-fi
-
CERTDATE="2016-04-28"
TESTDATE="2016-04-29"
EXP_OCSP_DATE="2016-03-27"
diff --git a/tests/ocsp-tests/ocsp-test b/tests/ocsp-tests/ocsp-test
index f481e13131..3730175208 100755
--- a/tests/ocsp-tests/ocsp-test
+++ b/tests/ocsp-tests/ocsp-test
@@ -30,13 +30,9 @@ fi
export TZ="UTC"
-# Check for datefudge
-TSTAMP=`datefudge "2006-09-23" date -u +%s || true`
-if test "$TSTAMP" != "1158969600"; then
- echo $TSTAMP
- echo "You need datefudge to run this test"
- exit 77
-fi
+. "${srcdir}/scripts/common.sh"
+
+check_for_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 4b1e3025c7..bcc77ec2d9 100755
--- a/tests/ocsp-tests/ocsp-tls-connection
+++ b/tests/ocsp-tests/ocsp-tls-connection
@@ -54,6 +54,8 @@ export TZ="UTC"
. "${srcdir}/scripts/common.sh"
+check_for_datefudge
+
eval "${GETPORT}"
# Port for gnutls-serv
TLS_SERVER_PORT=$PORT
@@ -73,14 +75,6 @@ if ! test -x "${OPENSSL}"; then
exit 77
fi
-# Check for datefudge
-TSTAMP=`datefudge "2006-09-23" date -u +%s || true`
-if test "$TSTAMP" != "1158969600"; then
- echo $TSTAMP
- echo "You need datefudge to run this test."
- exit 77
-fi
-
CERTDATE="2016-04-28"
TESTDATE="2016-04-29"