My suggestion: The UI has a notification at the top alerting the user there is a new update and they should reboot the moblab.
This way if they are running the SSD test (3 weeks) they can get the update after the test is finished.
+Deymo
update_engine_client should help here.
From the --help output:
--is_reboot_needed (Exit status 0 if reboot is needed, 2 if reboot is not needed or 1 if an error occurred.) type: bool default: false
You can also make it block until the reboot is needed.
while ! update_engine_client --block_until_reboot_is_needed; do
sleep 1; # Something went wrong talking to update_engine
done
reboot
Comment 1 by sbasi@chromium.org
, May 21 2016