corrected news entry.
[gnutls.git] / tests / cert-tests / template-test
blob769957b7a90e091841eaef261f34f2408c611dc5
1 #!/bin/sh
3 # Copyright (C) 2006-2012 Free Software Foundation, Inc.
5 # This file is part of GnuTLS.
7 # GnuTLS is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the
9 # Free Software Foundation; either version 3 of the License, or (at
10 # your option) any later version.
12 # GnuTLS is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GnuTLS; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 set -e
23 srcdir=${srcdir:-.}
24 CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
26 # Check for datefudge
27 TSTAMP=`datefudge "2006-09-23" date -u +%s || true`
28 if test "$TSTAMP" != "1158962400"; then
29 echo "You need datefudge to run this test"
30 exit 77
33 datefudge "2007-04-22" \
34 $CERTTOOL --generate-self-signed \
35 --load-privkey $srcdir/template-test.key \
36 --template $srcdir/template-test.tmpl \
37 --outfile tmp-tt.pem 2>/dev/null
39 diff $srcdir/template-test.pem tmp-tt.pem
40 rc=$?
42 rm -f tmp-tt.pem
44 # We're done.
45 if test "$rc" != "0"; then
46 exit $rc
49 exit 0