0ac475a30044eb25fc79b0dc8aa6007e71c951ee
[fw/altos] / ao-bringup / test-telemega
1 #!/bin/sh
2
3 VERSION=2.0
4 PRODUCT=TeleMega
5 BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
6
7 echo "$PRODUCT-v$VERSION Test Program"
8 echo "Copyright 2014 by Keith Packard.  Released under GPL v2"
9 echo
10 echo "Expectations:"
11 echo "\t$PRODUCT v$VERSION powered from USB"
12 echo
13
14 ret=1
15 ao-list | while read product serial dev; do
16     case "$product" in
17         "$PRODUCT-v$VERSION")
18
19             echo "Testing $product $serial $dev"
20
21             ./test-igniters $dev main drogue 3 0 1 2
22             echo""
23
24             echo "Testing baro sensor"
25             ../ao-tools/ao-test-baro/ao-test-baro --tty="$dev"
26
27             case $? in
28                 0)
29                     ;;
30                 *)
31                     echo "failed"
32                     exit 1
33             esac
34             echo""
35
36             FLASHSIZE=8388608
37
38             echo "Testing flash"
39             ../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
40
41             case $? in
42                 0)
43                     ;;
44                 *)
45                     echo "failed"
46                     exit 1
47             esac
48             echo""
49
50             echo "Testing GPS"
51             ../ao-tools/ao-test-gps/ao-test-gps --tty="$dev"
52
53             case $? in
54                 0)
55                     ;;
56                 *)
57                     echo "failed"
58                     exit 1
59             esac
60             echo""
61
62             echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
63             echo "\007"
64             ret=0
65             ;;
66     esac
67 done