autotest: Add servo fw verifier/repair actions
If any servo will required update it will trigger repair action to flash
new version. If we cannot update the servo then it broken.
The update process try to update servo 3 times.
As all tests run servo-repair it allow us update FW any time and prevent
possible errors if servo is not updated.
BUG=b:178506584, b:177928411
TEST=run local verify/repair
good DUT
./server/autoserv -s --host-info-subdir host_info_store -m chromeos2-row9-rack10-host18 --lab True --local-only-host-info True -R -r /tr/
bad DUT
./server/autoserv -s --host-info-subdir host_info_store -m chromeos6-row2-rack11-host7 --lab True --local-only-host-info True -R -r /tr/
Change-Id: Id1e6f7d30536393328f18962883926db59b32eca
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2696287
Commit-Queue: Otabek Kasimov <otabek@google.com>
Tested-by: Otabek Kasimov <otabek@google.com>
Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-by: Garry Wang <xianuowang@chromium.org>
diff --git a/server/hosts/servo_host.py b/server/hosts/servo_host.py
index 7a48081..5a96875 100644
--- a/server/hosts/servo_host.py
+++ b/server/hosts/servo_host.py
@@ -1360,6 +1360,7 @@
them.
"""
ssh = self.get_verifier_state('servo_ssh')
+ servo_fw = self.get_verifier_state('servo_fw')
disk_space = self.get_verifier_state('servo_disk_space')
start_servod = self.get_verifier_state('servod_started')
create_servo = self.get_verifier_state('servod_connection')
@@ -1377,6 +1378,8 @@
if not ssh:
return servo_constants.SERVO_STATE_NO_SSH
+ if servo_fw == hosts.VERIFY_FAILED:
+ return servo_constants.SERVO_STATE_NEED_REPLACEMENT
if (start_servod == hosts.VERIFY_FAILED
or create_servo == hosts.VERIFY_FAILED):
@@ -1724,27 +1727,6 @@
'[Non-critical] Unexpected error while trying to'
' load device health profile; %s', e)
- if try_lab_servo or try_servo_repair:
- try:
- logging.info("Check and update servo firmware.")
- servo_updater.update_servo_firmware(newhost,
- try_attempt_count=3,
- force_update=False,
- try_force_update=False)
- except Exception as e:
- logging.error("Servo device update error: %s", e)
-
- try:
- newhost.restart_servod(quick_startup=True)
- except error.AutoservSSHTimeout:
- logging.warning("Restart servod failed due ssh connection "
- "to servohost timed out. This error is forgiven"
- " here, we will retry in servo repair process.")
- except error.AutoservRunError as e:
- logging.warning("Restart servod failed due to:\n%s\n"
- "This error is forgiven here, we will retry"
- " in servo repair process.", str(e))
-
# Note that the logic of repair() includes everything done
# by verify(). It's sufficient to call one or the other;
# we don't need both.