]> git.gag.com Git - fw/altos/blob - ao-bringup/test-easymini-v1.0
Merge branch 'branch-1.9' into debian
[fw/altos] / ao-bringup / test-easymini-v1.0
1 #!/bin/bash
2
3 VERSION=1.0
4 PRODUCT=EasyMini
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 -e "\t$PRODUCT v$VERSION powered from USB"
12 echo
13
14 found=0
15 while [ $found -eq 0 ]; do
16     (ao-list; echo END END END END) | while read product serial dev; do
17         case "$product" in
18             "$PRODUCT-v$VERSION")
19
20                 found=1
21                 echo -e '\e[34m'Testing $product $serial $dev'\e[39m'
22                 echo ""
23                 
24                 sleep 2
25
26                 ./test-igniters-nowait "$dev" drogue main
27                 echo ""
28
29                 echo "Testing baro sensor"
30                 ../ao-tools/ao-test-baro/ao-test-baro --tty="$dev"
31
32                 if [ $? -ne 0 ]; then
33                     echo -e '\e[31m'"$PRODUCT-$VERSION serial $serial failed"'\e[39m'
34                     exit 1
35                 fi
36                 echo""
37
38                 FLASHSIZE=1048576
39
40                 echo "Testing flash"
41                 ../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
42
43                 if [ $? -ne 0 ]; then
44                     echo -e '\e[31m'"$PRODUCT-$VERSION serial $serial failed"'\e[39m'
45                     exit 1
46                 fi
47                 echo ""
48
49                 echo -e '\e[32m'"$PRODUCT-v$VERSION" serial "$serial" is ready to ship'\e[39m'
50                 exit 0
51                 ;;
52             END)
53                 exit 2
54                 ;;
55         esac
56     done
57     result=$?
58     if [ $result -ne 2 ]; then
59         exit $result
60     fi
61     sleep 0.25
62 done