add basic random tests

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20024 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-01-21 09:49:49 +00:00
parent 3f64ab1f97
commit d5f0098d37

View File

@@ -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