~vila/ubuntu-test-cases/boottest

« back to all changes in this revision

Viewing changes to scripts/boottest.sh

  • Committer: Vincent Ladeuil
  • Date: 2015-02-10 15:47:41 UTC
  • Revision ID: vila+ci@canonical.com-20150210154741-wlgoeezbaoloi1wt
Retry apt-get-update as adt-run does it.
Trap errors in getpkgsrc since it has been seen failing ;)
Fix the wrong early exit so recover.py is called in all cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
 
64
64
# Generate the adt-run setup-command
65
65
rm -f adt-commands || true
66
 
echo "apt-get update" >> adt-commands
 
66
# apt-get update like adt-run does it
 
67
echo "(apt-get update || (sleep 15; apt-get update))" >> adt-commands
67
68
 
68
69
 
69
70
# --no-built-binaries should come first
90
91
# Execute a first test to get the package source tree from the testbed.
91
92
PKG_SRC_DIR=pkgsrc
92
93
rm -fr ${PKG_SRC_DIR} || true
 
94
set +e
93
95
${ADT_CMD} --unbuilt-tree ${TESTS}/getpkgsrc -o ${PKG_SRC_DIR} ${ADT_OPTS}
 
96
RET=$?
 
97
set -e
 
98
if [ $RET -ne 0 ]; then
 
99
    # Something went wrong with the testbed and/or adt-run itself
 
100
    errfile=results/${RELEASE}_${ARCH}_${SRC_PKG_NAME}_$(date +%Y%m%d-%H%M%S).error
 
101
    echo "$RELEASE $ARCH $SRC_PKG_NAME" > $errfile
 
102
    [ -f "$errfile" ] && rsync -a $errfile $RSYNC_DEST/${RELEASE}/tmp/ || true
 
103
    # Ensure we leave a usable phone
 
104
    [ -z ${NODE_NAME} ] || test-runner/scripts/recover.py ${NODE_NAME}
 
105
 
 
106
    exit $RET
 
107
fi
94
108
 
95
109
if [ -n "${FORCE_FAILURE}" ]; then
96
110
        # Force a boottest failure by running an alternate DEP8 test
134
148
    [ -f "$errfile" ] && rsync -a $errfile $RSYNC_DEST/${RELEASE}/tmp/ || true
135
149
fi
136
150
 
137
 
exit $RET
138
 
 
139
151
# Ensure we leave a usable phone
140
152
[ -z ${NODE_NAME} ] || test-runner/scripts/recover.py ${NODE_NAME}
141
153
 
142
 
exit $rc
 
154
exit $RET