diff options
author | Simon Josefsson <simon@josefsson.org> | 2012-01-25 08:46:55 +0100 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2012-01-25 08:46:55 +0100 |
commit | 6cd4f0e3fb51faa6a787113eabec13cf40155fe1 (patch) | |
tree | bc3a29ea9f5c397955be51101f074fe6e3d7ff5b /tests | |
parent | 88bf26a18e48df38598bd2119700b3777c5a9ee9 (diff) | |
download | gnutls-6cd4f0e3fb51faa6a787113eabec13cf40155fe1.tar.gz |
Improve datefudge check. Fix builddir != srcdir.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/cert-tests/template-test | 19 |
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=$? |