| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
# Tests the randomness seeding |
| 4 |
|
| 5 |
echo Testing lsh-make-seed |
| 6 |
|
| 7 |
if [ -z "$srcdir" ] ; then |
| 8 |
srcdir=`pwd` |
| 9 |
fi |
| 10 |
|
| 11 |
. $srcdir/functions.sh |
| 12 |
|
| 13 |
for f in test-seed-1 test-seed-2 ; do |
| 14 |
rm -f "$f" |
| 15 |
../lsh-make-seed --sloppy -q -o "$f" && [ -s "$f" ] || die "lsh-make-seed failed" |
| 16 |
done |
| 17 |
|
| 18 |
# Seeds should be different, so that cmp returns the exit code 1. |
| 19 |
if cmp test-seed-1 test-seed-2 ; then |
| 20 |
test_fail |
| 21 |
else |
| 22 |
if [ $? -eq 1 ] ; then |
| 23 |
test_success |
| 24 |
else |
| 25 |
test_fail |
| 26 |
fi |
| 27 |
fi |
| 28 |
|
| 29 |
test_done |