[autotest] Add atest stable_version command to manage stable versions.
Add a decorator require_confirmation to atest, any delete action will prompt
for confirmation, use option --no-confirmation to skip that. It's applicable
to command like atest label delete, atest host delete.
Add 3 actions for topic stable_version:
list: Show version of a given board or list all boards and their stable
versions if --board option is not specified.
$ ./atest stable_version list
==============================
board | version
------------------------------
DEFAULT | R41-4687.0.0
peppy | R40-4555.0.0
==============================
modify: Set the stable version of a given board to the given value.
$ ./atest stable_version modify -b peppy -i R40-4515.0.0
Stable version for board peppy is changed from R40-4555.0.0.0 to R40-4515.0.0.
delete: Delete the stable version of a given board. So its stable version will
use the value for board `DEFAULT`.
$ ./atest stable_version delete -b peppy
Are you sure to delete stable version for board peppy? After this action is
done, stable version for board peppy will be R41.0.0.0
Continue? [y/N] y
Stable version for board peppy is deleted.
DEPLOY=apache
BUG=chromium:436656
TEST=local setup, unittest
Change-Id: I31047740a4886854aa653b1bf0f16c5f5c7a3f14
Reviewed-on: https://chromium-review.googlesource.com/236951
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
14 files changed