ao-bringup: Test EasyMega boards
[fw/altos] / ao-bringup / test-easymega
1 #!/bin/sh
2
3 VERSION=1.0
4 PRODUCT=EasyMega
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             for igniter in drogue main 0 1 2 3; do
22                 echo "Testing $igniter igniter."
23                 echo -n "Press enter to continue..."
24                 read foo < /dev/tty
25                 ../ao-tools/ao-test-igniter/ao-test-igniter --tty="$dev" $igniter
26
27                 case $? in
28                     0)
29                         ;;
30                     *)
31                         echo "failed"
32                         exit 1
33                         ;;
34                 esac
35             done
36
37             echo "Testing baro sensor"
38             ../ao-tools/ao-test-baro/ao-test-baro --tty="$dev"
39
40             case $? in
41                 0)
42                     ;;
43                 *)
44                     echo "failed"
45                     exit 1
46             esac
47
48             FLASHSIZE=8388608
49
50             echo "Testing flash"
51             ../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
52
53             case $? in
54                 0)
55                     ;;
56                 *)
57                     echo "failed"
58                     exit 1
59             esac
60
61             echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
62             ret=0
63             ;;
64         *)
65             echo "Skipping $product $serial $dev"
66             ;;
67     esac
68 done