From d5f0098d3713264d815ae3fe76505e8dac4bbdc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 21 Jan 2007 09:49:49 +0000 Subject: [PATCH] add basic random tests git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20024 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/des/test_crypto.in | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/des/test_crypto.in b/lib/des/test_crypto.in index f897589c9..b2a6c5014 100644 --- a/lib/des/test_crypto.in +++ b/lib/des/test_crypto.in @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2006 Kungliga Tekniska Högskolan +# Copyright (c) 2006 - 2007 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # @@ -38,6 +38,7 @@ srcdir="@srcdir@" rsa="${TESTS_ENVIRONMENT} ./test_rsa" engine="${TESTS_ENVIRONMENT} ./test_engine_dso" +rand="${TESTS_ENVIRONMENT} ./test_rand" ${rsa} --key=${srcdir}/rsakey.der || \ { echo "rsa test failed" ; exit 1; } @@ -45,4 +46,24 @@ ${rsa} --key=${srcdir}/rsakey.der || \ ${engine} --rsa=${srcdir}/rsakey.der || \ { echo "engine test failed" ; exit 1; } + +for a in unix fortuna egd ;do + ${rand} --method=${a} crypto-test 2>error + res=$? + if test "X$res" != X0 ; then + grep "random not ready yet" error || exit 1 + echo "random metod $a out for lunch" + continue + fi + ${rand} --method=${a} crypto-test2 2>error + res=$? + if test "X$res" != X0 ; then + grep "random not ready yet" error || exit 1 + echo "random metod $a out for dinner" + continue + fi + cmp crypto-test crypto-test2 && { echo "rand output same!" ; exit 1; } +done + + exit 0