summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2012-01-25 08:46:55 +0100
committerSimon Josefsson <simon@josefsson.org>2012-01-25 08:46:55 +0100
commit6cd4f0e3fb51faa6a787113eabec13cf40155fe1 (patch)
treebc3a29ea9f5c397955be51101f074fe6e3d7ff5b /tests
parent88bf26a18e48df38598bd2119700b3777c5a9ee9 (diff)
downloadgnutls-6cd4f0e3fb51faa6a787113eabec13cf40155fe1.tar.gz
Improve datefudge check. Fix builddir != srcdir.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cert-tests/template-test19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/cert-tests/template-test b/tests/cert-tests/template-test
index 55921526c1..b56b27d63c 100755
--- a/tests/cert-tests/template-test
+++ b/tests/cert-tests/template-test
@@ -1,8 +1,6 @@
#!/bin/sh
-# Copyright (C) 2006-2008, 2010, 2012 Free Software Foundation, Inc.
-#
-# Author: Simon Josefsson
+# Copyright (C) 2006-2012 Free Software Foundation, Inc.
#
# This file is part of GnuTLS.
#
@@ -25,13 +23,18 @@ set -e
srcdir=${srcdir:-.}
CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
-if ! test -x /usr/bin/datefudge;then
- echo "You need datefudge to run this test"
- exit 77
+# Check for datefudge
+TSTAMP=`datefudge "2006-09-23" date -u +%s`
+if test "$TSTAMP" != "1158962400"; then
+ echo "You need datefudge to run this test"
+ exit 77
fi
-datefudge "2007-04-22" $CERTTOOL --generate-self-signed --load-privkey $srcdir/template-test.key \
- --template template-test.tmpl --outfile tmp-tt.pem 2>/dev/null
+datefudge "2007-04-22" \
+ $CERTTOOL --generate-self-signed \
+ --load-privkey $srcdir/template-test.key \
+ --template $srcdir/template-test.tmpl \
+ --outfile tmp-tt.pem 2>/dev/null
diff $srcdir/template-test.pem tmp-tt.pem
rc=$?