summaryrefslogtreecommitdiff
path: root/tests/cert-tests/template-test
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-22 20:29:06 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-22 20:30:35 +0100
commit7fc5737356c15c3e1aa6c89e54e2492b4cbd3a54 (patch)
tree1ca8f06183d5265f81ebe2e8cd12f75563b0f5f5 /tests/cert-tests/template-test
parentafc7d48d87326160d3d7381614cb7882f48bcf8b (diff)
downloadgnutls-7fc5737356c15c3e1aa6c89e54e2492b4cbd3a54.tar.gz
Certtool completely relies on libopts. As a side-effect the syntax of dn_oid and key_purpose_oids has changed.
Diffstat (limited to 'tests/cert-tests/template-test')
-rwxr-xr-xtests/cert-tests/template-test46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/cert-tests/template-test b/tests/cert-tests/template-test
new file mode 100755
index 0000000000..55921526c1
--- /dev/null
+++ b/tests/cert-tests/template-test
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# Copyright (C) 2006-2008, 2010, 2012 Free Software Foundation, Inc.
+#
+# Author: Simon Josefsson
+#
+# This file is part of GnuTLS.
+#
+# GnuTLS is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# GnuTLS is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GnuTLS; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+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
+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
+
+diff $srcdir/template-test.pem tmp-tt.pem
+rc=$?
+
+rm -f tmp-tt.pem
+
+# We're done.
+if test "$rc" != "0"; then
+ exit $rc
+fi
+
+exit 0