summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-05-30 12:35:07 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-05-30 12:35:07 +0200
commitd617a107e134b2c7e1eaf13695c288c0f2f95ec1 (patch)
treed712acd06cc41ec2ddd4cadc474fc648eb0d655f
parenta9581abbde91a732b5e16179192b72b6032ca874 (diff)
downloadgnutls-d617a107e134b2c7e1eaf13695c288c0f2f95ec1.tar.gz
Print information on failure.
-rwxr-xr-xtests/sha2/sha237
1 files changed, 28 insertions, 9 deletions
diff --git a/tests/sha2/sha2 b/tests/sha2/sha2
index 8c4b96da9e..80b4bc16aa 100755
--- a/tests/sha2/sha2
+++ b/tests/sha2/sha2
@@ -20,7 +20,7 @@
# along with GnuTLS; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-set -e
+#set -e
srcdir=${srcdir:-.}
CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
@@ -28,40 +28,59 @@ CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
echo ca > template
echo cn = "SHA 512 CA" >> template
-$CERTTOOL --generate-self-signed --template template \
+$CERTTOOL -d 2 --generate-self-signed --template template \
--load-privkey $srcdir/key-ca.pem \
--outfile new-ca.pem \
- --hash sha512 >/dev/null 2>&1
+ --hash sha512 >out 2>&1
+
+if [ $? != 0 ];then
+ cat out
+ exit 1
+fi
echo ca > template
echo cn = "SHA 384 sub-CA" >> template
-$CERTTOOL --generate-certificate --template template \
+$CERTTOOL -d 2 --generate-certificate --template template \
--load-ca-privkey $srcdir/key-ca.pem \
--load-ca-certificate new-ca.pem \
--load-privkey $srcdir/key-subca.pem \
--outfile new-subca.pem \
- --hash sha384 >/dev/null 2>&1
+ --hash sha384 >out 2>&1
+
+if [ $? != 0 ];then
+ cat out
+ exit 1
+fi
echo ca > template
echo cn = "SHA 256 sub-sub-CA" >> template
-$CERTTOOL --generate-certificate --template template \
+$CERTTOOL -d 2 --generate-certificate --template template \
--load-ca-privkey $srcdir/key-subca.pem \
--load-ca-certificate new-subca.pem \
--load-privkey $srcdir/key-subsubca.pem \
--outfile new-subsubca.pem \
- --hash sha256 >/dev/null 2>&1
+ --hash sha256 >out 2>&1
+
+if [ $? != 0 ];then
+ cat out
+ exit 1
+fi
echo ca > template
echo cn = "End-user" >> template
-$CERTTOOL --generate-certificate --template template \
+$CERTTOOL -d 2 --generate-certificate --template template \
--load-ca-privkey $srcdir/key-subsubca.pem \
--load-ca-certificate new-subsubca.pem \
--load-privkey $srcdir/key-user.pem \
- --outfile new-user.pem >/dev/null 2>&1
+ --outfile new-user.pem >out 2>&1
+if [ $? != 0 ];then
+ cat out
+ exit 1
+fi
num=`cat new-user.pem new-subsubca.pem new-subca.pem new-ca.pem | $CERTTOOL --verify-chain | tee verify | grep -c Verified`
#cat verify