[autotest] Add servo repair process

This CL has the core logic of servo repair process.
A new type of host class, ServoHost, is created for interacting
with our beaglebones. With this class, we can verify and repair
a beaglebone.

CrosHost._initialize now checks whether a servo is required by
a test (see inline comments about how this is achieved).
If a servo is required and the servo is in our lab,
it will attempt to repair bad servo. It will raise an exception
if the servo couldn't be fixed.

CrosHost.repair_full now attempts to repair the servo as well.
If a servo can't be fixed, the repair job will fail leaving the
DUT in "Repair Failed" status.

BUG=chromium:245320
TEST=1)Manually make cros_host believe it is dealing with a lab servo,
and test with repair job, and platform_InstallTestImage.
Confirm when servo is broken, it goes through the servo repair flow.
2) Use local servo by setting servo_args with local servo ip.
Test with repair job and platform_InstallTestImage.
Confirm when servo is broken, it throws a exception.
3) Manually test ServoHost.run, Servo.system, Servo.system_output,
Servo, Servo._scp_image, ensure they work after refactoring.

Change-Id: I9abc3320ba84a604a6534b75d16156bda30b09b5
Reviewed-on: https://chromium-review.googlesource.com/66891
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
5 files changed