]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Improve datefudge check. Fix builddir != srcdir.
authorSimon Josefsson <simon@josefsson.org>
Wed, 25 Jan 2012 07:46:55 +0000 (08:46 +0100)
committerSimon Josefsson <simon@josefsson.org>
Wed, 25 Jan 2012 07:46:55 +0000 (08:46 +0100)
tests/cert-tests/template-test

index 55921526c100f68060e249bb5f221ad8cb4492f4..b56b27d63c619a2eec2d6e2dddc33aa6db1e7454 100755 (executable)
@@ -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=$?