~pwlars/ubuntu-test-cases/krillin-recovery

« back to all changes in this revision

Viewing changes to scripts/run-autopilot-tests.sh

  • Committer: Andy Doan
  • Date: 2013-10-21 02:19:35 UTC
  • mto: This revision was merged to the branch mainline in revision 75.
  • Revision ID: andy.doan@canonical.com-20131021021935-9v30ul1w0ff7yy30
fix bugs found in run-autopilot.sh

1: When unlock screen failed the whole script was ended. This makes sure
we just fail that single app test and continue trying other apps.

2: The reboot_wait logic isn't resiliant enough. Before we had "mega"
jobs (ie jenkins.sh) it was okay if a test occassionally failed to
get active networking. However, in this new script that failure can
cause all the remaining tests to not get run. The idea is to create
a reboot-and-wait script that will retry 3 times before giving up.

3: Update the system settle "classname" for junit. The issue I'm
seeing is that the junit results viewer in jenkins isn't correlating
the settle failures with the testsuite it happened in. This makes sure
the 2 are tied together.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 
55
55
        system_settle before $odir
56
56
 
57
 
        adb-shell /home/phablet/bin/unlock_screen.sh
58
 
        phablet-test-run \
59
 
                -o ${odir} \
60
 
                -a /var/crash -a /home/phablet/.cache/upstart \
61
 
                -v $app || true
62
 
 
 
57
        if adb-shell /home/phablet/bin/unlock_screen.sh ; then
 
58
                phablet-test-run \
 
59
                        -o ${odir} \
 
60
                        -a /var/crash -a /home/phablet/.cache/upstart \
 
61
                        -v $app || true
 
62
        else
 
63
                echo Screen unlock failed, skipping $app
 
64
        fi
63
65
        system_settle after $odir
64
66
}
65
67
 
66
68
reboot_wait() {
67
69
        if [ -z $QUICK ] ; then
68
 
                # get the phone in sane place
69
 
                adb reboot
70
 
                # sometimes reboot doesn't happen fast enough, so add a little
71
 
                # delay to help ensure its actually rebooted and we didn't just
72
 
                # connect back to the device before it rebooted
73
 
                adb wait-for-device
74
 
                sleep 5
75
 
                adb wait-for-device
 
70
                ${BASEDIR}/scripts/reboot-and-wait
76
71
                adb shell 'rm -rf /var/crash/* /home/phablet/.cache/upstart/*.log'
77
 
                phablet-network --skip-setup -t 90s
78
72
        else
79
73
                echo "SKIPPING phone reboot..."
80
74
        fi