Merge lp:~fginther/ubuntu-touch-boottest/console-log-cleanup into lp:ubuntu-touch-boottest

Proposed by Francis Ginther
Status: Merged
Approved by: Francis Ginther
Approved revision: 8
Merged at revision: 6
Proposed branch: lp:~fginther/ubuntu-touch-boottest/console-log-cleanup
Merge into: lp:ubuntu-touch-boottest
Diff against target: 70 lines (+11/-9)
1 file modified
boottest.sh (+11/-9)
To merge this branch: bzr merge lp:~fginther/ubuntu-touch-boottest/console-log-cleanup
Reviewer Review Type Date Requested Status
Paul Larson Approve
Evan (community) Approve
Review via email: mp+261298@code.launchpad.net

Commit message

Provide END_MESSAGEs for all exit paths and redirect provisiong to it's own log file.

Description of the change

To post a comment you must log in.
7. By Francis Ginther

Cleanup tabs.

Revision history for this message
Evan (ev) wrote :

Minor nits, but don't block on these +1

review: Approve
Revision history for this message
Paul Larson (pwlars) wrote :

A couple of small items

review: Needs Fixing
8. By Francis Ginther

Apply fixes from review comments.

Revision history for this message
Francis Ginther (fginther) wrote :
Revision history for this message
Paul Larson (pwlars) wrote :

Looks good, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'boottest.sh'
--- boottest.sh 2015-06-05 20:15:05 +0000
+++ boottest.sh 2015-06-06 02:56:04 +0000
@@ -23,10 +23,8 @@
2323
24# Setup our dependencies24# Setup our dependencies
25UTILDIR="${BASEDIR}/utils"25UTILDIR="${BASEDIR}/utils"
26if [ -f "${UTILDIR}" ]; then26rm -rf "${UTILDIR}"
27 rm -rf "${UTILDIR}"27bzr checkout --lightweight lp:ubuntu-test-cases/touch $UTILDIR
28fi
29bzr branch lp:ubuntu-test-cases/touch $UTILDIR
3028
31# Default adt-run timeout29# Default adt-run timeout
32export ADT_TIMEOUT=${ADT_TIMEOUT:-600}30export ADT_TIMEOUT=${ADT_TIMEOUT:-600}
@@ -68,7 +66,6 @@
68 [ -z ${NODE_NAME} ] || ${UTILDIR}/scripts/recover.py ${NODE_NAME}66 [ -z ${NODE_NAME} ] || ${UTILDIR}/scripts/recover.py ${NODE_NAME}
6967
70 # Leave a parting message68 # Leave a parting message
71 # (disable command tracing as it confuses the output)
72 [ -z "${END_MESSAGE}" ] || echo -e "\n\n${END_MESSAGE}\n\n"69 [ -z "${END_MESSAGE}" ] || echo -e "\n\n${END_MESSAGE}\n\n"
73}70}
74trap exit_handler SIGINT SIGTERM EXIT71trap exit_handler SIGINT SIGTERM EXIT
@@ -123,7 +120,7 @@
123if [ -n "${NODE_NAME}" ]; then120if [ -n "${NODE_NAME}" ]; then
124 while [ ${RETRY} -gt 0 ]; do121 while [ ${RETRY} -gt 0 ]; do
125 echo "Provisioning device"122 echo "Provisioning device"
126 ${PROV_CMD} && break123 ${PROV_CMD} > "provision.log" 2>&1 && break
127 PROV_ERR=$?124 PROV_ERR=$?
128 # Make sure the device doesn't need to be recovered first125 # Make sure the device doesn't need to be recovered first
129 ${UTILDIR}/scripts/recover.py ${NODE_NAME}126 ${UTILDIR}/scripts/recover.py ${NODE_NAME}
@@ -138,7 +135,7 @@
138 echo "Provisioning failed, retrying up to ${RETRY} more times..."135 echo "Provisioning failed, retrying up to ${RETRY} more times..."
139 done136 done
140 if [ ${RETRY} -eq 0 ]; then137 if [ ${RETRY} -eq 0 ]; then
141 echo ERROR: Device provisioning failed!138 END_MESSAGE="ERROR: Device provisioning failed!"
142 exit 1139 exit 1
143 fi140 fi
144fi141fi
@@ -215,7 +212,7 @@
215 adb pull /home/phablet/sourcepkg-version results/sourcepkg-version212 adb pull /home/phablet/sourcepkg-version results/sourcepkg-version
216 echo "Version tested: $(cat results/sourcepkg-version)"213 echo "Version tested: $(cat results/sourcepkg-version)"
217 grep -q 'ERROR' results/sourcepkg-version && \214 grep -q 'ERROR' results/sourcepkg-version && \
218 END_MESSAGE="$(cat results/sourcepkg-version)"215 END_MESSAGE="$(cat results/sourcepkg-version)"
219 set -e216 set -e
220fi217fi
221218
@@ -226,12 +223,17 @@
226223
227if [ -e "results/sourcepkg-version" -a -e "results/testbed-packages" ]; then224if [ -e "results/sourcepkg-version" -a -e "results/testbed-packages" ]; then
228 result='PASS'225 result='PASS'
226 END_MESSAGE="PASS: Boottest passed"
229 resultfile=results/${RELEASE}_${ARCH}_${SRC_PKG_NAME}_$(date +%Y%m%d-%H%M%S).result227 resultfile=results/${RELEASE}_${ARCH}_${SRC_PKG_NAME}_$(date +%Y%m%d-%H%M%S).result
230 [ $RET -gt 0 ] && result="FAIL"228 if [ $RET -gt 0 ]; then
229 result="FAIL"
230 END_MESSAGE="FAIL: Boottest failure"
231 fi
231 echo "$RELEASE $ARCH ${SRC_PKG_NAME} $(cat results/sourcepkg-version) $result $(sort -u results/*-packages|tr -s '[\n\t]' ' ')" > $resultfile232 echo "$RELEASE $ARCH ${SRC_PKG_NAME} $(cat results/sourcepkg-version) $result $(sort -u results/*-packages|tr -s '[\n\t]' ' ')" > $resultfile
232 [ -f "$resultfile" ] && ${RSYNC} -a $resultfile $RSYNC_DEST/${RELEASE}/tmp/ || true233 [ -f "$resultfile" ] && ${RSYNC} -a $resultfile $RSYNC_DEST/${RELEASE}/tmp/ || true
233else234else
234 # Something went wrong with the testbed235 # Something went wrong with the testbed
236 END_MESSAGE="ERROR: Boottest testbed failure"
235 errfile=results/${RELEASE}_${ARCH}_${SRC_PKG_NAME}_$(date +%Y%m%d-%H%M%S).error237 errfile=results/${RELEASE}_${ARCH}_${SRC_PKG_NAME}_$(date +%Y%m%d-%H%M%S).error
236 echo "$RELEASE $ARCH $SRC_PKG_NAME" > $errfile238 echo "$RELEASE $ARCH $SRC_PKG_NAME" > $errfile
237 [ -f "$errfile" ] && ${RSYNC} -a $errfile $RSYNC_DEST/${RELEASE}/tmp/ || true239 [ -f "$errfile" ] && ${RSYNC} -a $errfile $RSYNC_DEST/${RELEASE}/tmp/ || true

Subscribers

People subscribed via source and target branches