From 20d640ec504afbfdb69dba1b241d84af1e62abed Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Sep 2014 20:58:26 -0700 Subject: [PATCH] ao-bringup: Improve igniter testing. Add TeleMega and TeleMetrum testing. The script lets you re-try each one when they fail, which is nice if you're hand-holding the setup. The TeleMetrum and TeleMega tests are adapted from the EasyMega tests and are hooked up to the turnon scripts. Signed-off-by: Keith Packard --- ao-bringup/test-easymega | 23 +++---------- ao-bringup/test-easymini | 20 ++++------- ao-bringup/test-igniters | 25 ++++++++++++++ ao-bringup/test-telemega | 66 +++++++++++++++++++++++++++++++++++ ao-bringup/test-telemetrum | 67 ++++++++++++++++++++++++++++++++++++ ao-bringup/turnon_telemega | 4 +++ ao-bringup/turnon_telemetrum | 4 +++ 7 files changed, 177 insertions(+), 32 deletions(-) create mode 100755 ao-bringup/test-igniters create mode 100755 ao-bringup/test-telemega create mode 100755 ao-bringup/test-telemetrum diff --git a/ao-bringup/test-easymega b/ao-bringup/test-easymega index eabe1ee5..76f3effb 100755 --- a/ao-bringup/test-easymega +++ b/ao-bringup/test-easymega @@ -17,22 +17,10 @@ ao-list | while read product serial dev; do "$PRODUCT-v$VERSION") echo "Testing $product $serial $dev" + echo "" - for igniter in drogue main 0 1 2 3; do - echo "Testing $igniter igniter." - echo -n "Press enter to continue..." - read foo < /dev/tty - ../ao-tools/ao-test-igniter/ao-test-igniter --tty="$dev" $igniter - - case $? in - 0) - ;; - *) - echo "failed" - exit 1 - ;; - esac - done + ./test-igniters $dev drogue main 0 1 2 3 + echo"" echo "Testing baro sensor" ../ao-tools/ao-test-baro/ao-test-baro --tty="$dev" @@ -44,6 +32,7 @@ ao-list | while read product serial dev; do echo "failed" exit 1 esac + echo"" FLASHSIZE=8388608 @@ -57,12 +46,10 @@ ao-list | while read product serial dev; do echo "failed" exit 1 esac + echo"" echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship ret=0 ;; - *) - echo "Skipping $product $serial $dev" - ;; esac done diff --git a/ao-bringup/test-easymini b/ao-bringup/test-easymini index 17e00955..e11244d2 100755 --- a/ao-bringup/test-easymini +++ b/ao-bringup/test-easymini @@ -17,17 +17,10 @@ ao-list | while read product serial dev; do "$PRODUCT-v$VERSION") echo "Testing $product $serial $dev" - - echo "Testing igniters. Both should flash" - ../ao-tools/ao-test-igniter/ao-test-igniter --tty="$dev" drogue main - - case $? in - 0) - ;; - *) - echo "failed" - exit 1 - esac + echo "" + + ./test-igniters "$dev" drogue main + echo "" echo "Testing baro sensor" ../ao-tools/ao-test-baro/ao-test-baro --tty="$dev" @@ -39,6 +32,7 @@ ao-list | while read product serial dev; do echo "failed" exit 1 esac + echo"" FLASHSIZE=1048576 @@ -52,12 +46,10 @@ ao-list | while read product serial dev; do echo "failed" exit 1 esac + echo"" echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship ret=0 ;; - *) - echo "Skipping $product $serial $dev" - ;; esac done diff --git a/ao-bringup/test-igniters b/ao-bringup/test-igniters new file mode 100755 index 00000000..763f42a9 --- /dev/null +++ b/ao-bringup/test-igniters @@ -0,0 +1,25 @@ +#!/bin/sh + +dev="$1" +shift + +for igniter in "$@"; do + pass="n" + while [ $pass != "y" ]; do + echo -n "Testing $igniter igniter. Press enter to continue..." + read foo < /dev/tty + ../ao-tools/ao-test-igniter/ao-test-igniter --tty="$dev" $igniter + + case $? in + 0) + echo "pass" + pass="y" + ;; + *) + echo "Failed. Try again." + ;; + esac + done +done + +exit 0 diff --git a/ao-bringup/test-telemega b/ao-bringup/test-telemega new file mode 100755 index 00000000..d3c13e16 --- /dev/null +++ b/ao-bringup/test-telemega @@ -0,0 +1,66 @@ +#!/bin/sh + +VERSION=0.1 +PRODUCT=TeleMega +BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'` + +echo "$PRODUCT-v$VERSION Test Program" +echo "Copyright 2014 by Keith Packard. Released under GPL v2" +echo +echo "Expectations:" +echo "\t$PRODUCT v$VERSION powered from USB" +echo + +ret=1 +ao-list | while read product serial dev; do + case "$product" in + "$PRODUCT-v$VERSION") + + echo "Testing $product $serial $dev" + + ./test-igniters $dev drogue main 0 1 2 3 + echo"" + + echo "Testing baro sensor" + ../ao-tools/ao-test-baro/ao-test-baro --tty="$dev" + + case $? in + 0) + ;; + *) + echo "failed" + exit 1 + esac + echo"" + + FLASHSIZE=8388608 + + echo "Testing flash" + ../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE" + + case $? in + 0) + ;; + *) + echo "failed" + exit 1 + esac + echo"" + + echo "Testing GPS" + ../ao-tools/ao-test-gps/ao-test-gps --tty="$dev" + + case $? in + 0) + ;; + *) + echo "failed" + exit 1 + esac + echo"" + + echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship + ret=0 + ;; + esac +done diff --git a/ao-bringup/test-telemetrum b/ao-bringup/test-telemetrum new file mode 100755 index 00000000..57a4d90d --- /dev/null +++ b/ao-bringup/test-telemetrum @@ -0,0 +1,67 @@ +#!/bin/sh + +VERSION=2.0 +PRODUCT=TeleMetrum +BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'` + +echo "$PRODUCT-v$VERSION Test Program" +echo "Copyright 2014 by Keith Packard. Released under GPL v2" +echo +echo "Expectations:" +echo "\t$PRODUCT v$VERSION powered from USB" +echo + +ret=1 +ao-list | while read product serial dev; do + case "$product" in + "$PRODUCT-v$VERSION") + + echo "Testing $product $serial $dev" + echo "" + + ./test-igniters "$dev" drogue main + echo "" + + echo "Testing baro sensor" + ../ao-tools/ao-test-baro/ao-test-baro --tty="$dev" + + case $? in + 0) + ;; + *) + echo "failed" + exit 1 + esac + echo"" + + FLASHSIZE=8388608 + + echo "Testing flash" + ../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE" + + case $? in + 0) + ;; + *) + echo "failed" + exit 1 + esac + echo"" + + echo "Testing GPS" + ../ao-tools/ao-test-gps/ao-test-gps --tty="$dev" + + case $? in + 0) + ;; + *) + echo "failed" + exit 1 + esac + echo"" + + echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship + ret=0 + ;; + esac +done diff --git a/ao-bringup/turnon_telemega b/ao-bringup/turnon_telemega index 7745a8e5..e0e0d4fe 100755 --- a/ao-bringup/turnon_telemega +++ b/ao-bringup/turnon_telemega @@ -57,3 +57,7 @@ SERIAL=$SERIAL ./cal-freq $dev ../ao-tools/ao-cal-accel/ao-cal-accel $dev echo 'E 1' > $dev + +./test-telemega + +exit $? diff --git a/ao-bringup/turnon_telemetrum b/ao-bringup/turnon_telemetrum index 48ff1e27..ba40a08a 100755 --- a/ao-bringup/turnon_telemetrum +++ b/ao-bringup/turnon_telemetrum @@ -56,3 +56,7 @@ SERIAL=$SERIAL ./cal-freq $dev ../ao-tools/ao-cal-accel/ao-cal-accel $dev echo 'E 1' > $dev + +./test-telemetrum + +exit $? -- 2.30.2