Don't fail tests for unsupported rand methods

This commit is contained in:
Asanka Herath
2010-08-23 23:55:09 -04:00
committed by Asanka C. Herath
parent 2ea71109d3
commit 8a1fb91009
2 changed files with 5 additions and 1 deletions

View File

@@ -60,6 +60,8 @@ for a in unix fortuna egd w32crypto ;do
${rand} --method=${a} --file=crypto-test 2>error
res=$?
if test "X$res" != X0 ; then
grep "unknown method" error && \
{ echo "random $a is not available" ; continue; }
grep "random not ready yet" error || \
{ echo "random $a ready failing" ; cat error; exit 1; }
echo "random method $a out for lunch"
@@ -101,6 +103,8 @@ if [ -e /dev/random -o -e /dev/urandom -o -e /dev/srandom -o -e /dev/arandom ] ;
${rand} --method=unix --file=unix 2>error
res=$?
if test "X$res" != X0 ; then
grep "unknown method" error && \
{ echo "random unix is not available"; exit 0; }
grep "random not ready yet" error || \
{ echo "random unix ready failing" ; cat error; exit 1; }
echo "random method unix out for lunch"

View File

@@ -132,7 +132,7 @@ main(int argc, char **argv)
RAND_set_rand_method(RAND_w32crypto_method());
#endif
else
errx(0, "unknown method %s", rand_method);
errx(1, "unknown method %s", rand_method);
}
if (RAND_file_name(path, sizeof(path)) == NULL)