| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
if dpkg-architecture -i s390x; then |
| 4 |
echo "dieharder tests are broken on s390x, skipping tests" |
| 5 |
return 77 |
| 6 |
fi |
| 7 |
|
| 8 |
set -e |
| 9 |
|
| 10 |
# Limit which tests are run, some aren't reliable and some take too long |
| 11 |
TESTS="0 1 2 3 4 8 9 10 11 12 13 15 16 100 101 202 203 204 205 206 207 208 209" |
| 12 |
|
| 13 |
# Notes on tests we don't run: |
| 14 |
# 5, 6, 7: marked as "Suspect" in dieharder -l |
| 15 |
# 14: marked as "Do Not Use" in dieharder -l |
| 16 |
# 102: buggy test that prints no output |
| 17 |
# 200: always fails with "Error: Can only test distribution of positive ntuples." |
| 18 |
# 201: always fails |
| 19 |
|
| 20 |
DATA=$(mktemp) |
| 21 |
RESULTS=$(mktemp) |
| 22 |
|
| 23 |
cleanup() |
| 24 |
{ |
| 25 |
rm -f $RESULTS |
| 26 |
rm -f $DATA |
| 27 |
} |
| 28 |
trap cleanup EXIT |
| 29 |
|
| 30 |
# Generate 4G of random data |
| 31 |
haveged -n 0 | dd of=$DATA bs=1k count=4096k |
| 32 |
|
| 33 |
for d in $TESTS; do |
| 34 |
echo "Running test #$d" |
| 35 |
echo "Test started at: $(date)" |
| 36 |
dieharder -d $d -g 201 -f $DATA | tee $RESULTS |
| 37 |
echo "Test ended at: $(date)" |
| 38 |
echo "" |
| 39 |
(! grep -w -q 'FAILED' $RESULTS) |
| 40 |
done |