summaryrefslogtreecommitdiff
path: root/ao-bringup
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-08-04 09:52:05 -0700
committerKeith Packard <keithp@keithp.com>2016-08-04 09:52:05 -0700
commit71e3a59e42c284fde8ac2767abd029230ed86e07 (patch)
tree936f32beca067c1b828ba2c4c59c2ea8398c02f1 /ao-bringup
parentbc920c80ef447a5bcdf8165b69fb28b8f63609df (diff)
ao-bringup: Add colors to chaoskey test result reporting
This makes them show up nice and bright in the terminal window. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-bringup')
-rwxr-xr-xao-bringup/test-chaoskey16
-rwxr-xr-xao-bringup/turnon_chaoskey6
2 files changed, 14 insertions, 8 deletions
diff --git a/ao-bringup/test-chaoskey b/ao-bringup/test-chaoskey
index db5aed6e..b4c8164f 100755
--- a/ao-bringup/test-chaoskey
+++ b/ao-bringup/test-chaoskey
@@ -12,7 +12,15 @@ case "$#" in
serial="--serial $1"
;;
0)
- serial=""
+ snum=`dmesg | grep 'on chaoskey' | tail -1 | sed 's/.*chaoskey \([0-9a-f][0-9a-f]*\) on chaoskey.*/\1/'`
+ case "$snum" in
+ "")
+ serial=""
+ ;;
+ *)
+ serial="--serial $snum"
+ ;;
+ esac
;;
*)
echo "Usage: $0 [serial]"
@@ -20,6 +28,8 @@ case "$#" in
;;
esac
+echo -e '\e[34mTesting ChaosKey' $snum '\e[39m'
+
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"
PASS=0
@@ -72,11 +82,11 @@ done | while read result; do
echo pass $PASS weak $WEAK fail $FAIL
case $PASS:$FAIL in
[1-9]*:0)
- echo ChaosKey $snum is ready to ship
+ echo -e '\e[32m'ChaosKey $snum is ready to ship'\e[39m'
exit 0
;;
*)
- echo ChaosKey $snum failed
+ echo -e '\e[31m'ChaosKey $snum failed'\e[39m'
exit 1
;;
esac
diff --git a/ao-bringup/turnon_chaoskey b/ao-bringup/turnon_chaoskey
index 8ac8479e..990382f4 100755
--- a/ao-bringup/turnon_chaoskey
+++ b/ao-bringup/turnon_chaoskey
@@ -35,10 +35,6 @@ $USBLOAD --serial=1 $ALTOS_FILE || exit 1
sleep 1
-serial=`dmesg | grep 'on chaoskey' | tail -1 | sed 's/.*chaoskey \([0-9a-f][0-9a-f]*\) on chaoskey.*/\1/'`
-
-echo 'Testing ChaosKey' $serial
-
-./test-chaoskey $serial
+./test-chaoskey
exit $?