Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: image_to_live.sh

Issue 6135002: Add simple update test to pfq. (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: iRebased Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bin/cros_au_test_harness.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: image_to_live.sh
diff --git a/image_to_live.sh b/image_to_live.sh
index 553cd4d21d5e4f5f81bab20229df249f8db58509..bbb5ec904dff336f9725c7e84ca3c15edd323a1b 100755
--- a/image_to_live.sh
+++ b/image_to_live.sh
@@ -241,7 +241,6 @@ function get_update_log {
echo "${REMOTE_OUT}" > "${FLAGS_update_log}"
}
-
# Returns ${1} reported by the update client e.g. PROGRESS, CURRENT_OP.
function get_update_var {
remote_sh "${UPDATER_BIN} --status 2> /dev/null |
@@ -254,21 +253,30 @@ function get_update_var {
# This is expected to run in its own thread.
function status_thread {
local timeout=5
- # Let update engine receive call to ping the dev server.
+
info "Devserver handling ping. Check ${FLAGS_server_log} for more info."
sleep ${timeout}
- # The devserver generates images when the update engine checks for updates.
- while [ $(get_update_var CURRENT_OP) = ${UPDATER_UPDATE_CHECK} ]; do
- echo -n "." && sleep ${timeout}
- done
+ local current_state=""
+ local next_state="$(get_update_var CURRENT_OP)"
+
+ # For current status, only print out status changes.
+ # For download, show progress.
+ # Finally if no status change print out .'s to keep dev informed.
+ while [ "${current_state}" != "${UPDATER_NEED_REBOOT}" ] && \
+ [ "${current_state}" != "${UPDATER_IDLE}" ]; do
+ if [ "${current_state}" != "${next_state}" ]; then
+ info "State of updater has changed to: ${next_state}"
+ elif [ "${next_state}" = "${UPDATER_DOWNLOADING}" ]; then
+ echo "Download progress $(get_update_var PROGRESS)"
+ else
+ echo -n "."
+ fi
- info "Update generated. Update engine downloading update."
- while [ $(get_update_var CURRENT_OP) = ${UPDATER_DOWNLOADING} ]; do
- echo "Download progress $(get_update_var PROGRESS)" && sleep ${timeout}
+ sleep ${timeout}
+ current_state="${next_state}"
+ next_state="$(get_update_var CURRENT_OP)"
done
-
- info "Download complete."
}
« no previous file with comments | « bin/cros_au_test_harness.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698