7 echo "Usage: $0 [serial]"
15 snum=`sudo dmesg -t | awk '/usb.*Product:/ { ck = index($0, "ChaosKey"); }
16 /usb.*SerialNumber:/ { if (ck) print $4; }' | tail -1`
23 serial="--serial $snum"
28 echo "Usage: $0 [serial]"
33 echo -e '\e[34mTesting ChaosKey' $snum '\e[39m'
35 tests="0:100 1:100 2:100 3:100 12:10 13:100 15:10000 16:250 202:1000 203:100 204:500 206:20 207:1000:32 209:1000"
40 chaosread $serial --infinite --bytes | for test in $tests done; do
43 dnum=`echo $test | sed 's/:.*$//'`
44 tnum=`echo $test | sed 's/^[^:]*://'`
45 tnum=`echo $test | sed 's/^[^:]*://' | sed 's/:.*$//'`
46 nnum=`echo $test | sed 's/^.*://'`
47 opts="-d $dnum -t $tnum -n $nnum"
50 dnum=`echo $test | sed 's/:.*$//'`
51 tnum=`echo $test | sed 's/^.*://'`
52 opts="-d $dnum -t $tnum"
65 dieharder -g 200 $opts
68 done | while read result; do
71 testnum=`echo $result | sed 's/TEST //'`
80 echo test $testnum failed
84 echo pass $PASS weak $WEAK fail $FAIL
87 echo -e '\e[32m'ChaosKey $snum is ready to ship'\e[39m'
91 echo -e '\e[31m'ChaosKey $snum failed'\e[39m'