faft: Use cold_reboot on firmware_RecoveryButton
The default reboot_action is warm_reboot. But now in the keyboard controlled
recovery design, the recovery button is read on EC bootup. So the original
warm_reboot can't trigger recovery mode. So change it to cold_reboot instead.
BUG=chromium-os:32936
TEST=Run firmware_RecoveryButton/control.normal passed.
Change-Id: Ie60a1d410bd3f00d4c6e4e58dcaab7aff0cb2414
Reviewed-on: https://gerrit.chromium.org/gerrit/28463
Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
diff --git a/server/cros/faftsequence.py b/server/cros/faftsequence.py
index f2d9c91..856ae5d 100644
--- a/server/cros/faftsequence.py
+++ b/server/cros/faftsequence.py
@@ -37,7 +37,7 @@
returning True if valid, otherwise, False to break the whole
test sequence.
userspace_action: a function to describe the action ran in userspace.
- reboot_action: a function to do reboot, default: sync_and_hw_reboot.
+ reboot_action: a function to do reboot, default: sync_and_warm_reboot.
firmware_action: a function to describe the action ran after reboot.
And configurations:
@@ -253,7 +253,7 @@
self.register_faft_template({
'state_checker': (None),
'userspace_action': (None),
- 'reboot_action': (self.sync_and_hw_reboot),
+ 'reboot_action': (self.sync_and_warm_reboot),
'firmware_action': (None)
})
if self._install_image_path:
@@ -858,7 +858,7 @@
time.sleep(self.SYNC_DELAY)
- def sync_and_hw_reboot(self):
+ def sync_and_warm_reboot(self):
"""Request the client sync and do a warm reboot.
This is the default reboot action on FAFT.
@@ -868,6 +868,16 @@
self.servo.warm_reset()
+ def sync_and_cold_reboot(self):
+ """Request the client sync and do a cold reboot.
+
+ This reboot action is used to reset EC for recovery mode.
+ """
+ self.faft_client.run_shell_command('sync')
+ time.sleep(self.SYNC_DELAY)
+ self.servo.cold_reset()
+
+
def sync_and_ec_reboot(self):
"""Request the client sync and do a EC triggered reboot."""
self.faft_client.run_shell_command('sync')
diff --git a/server/site_tests/firmware_RecoveryButton/firmware_RecoveryButton.py b/server/site_tests/firmware_RecoveryButton/firmware_RecoveryButton.py
index 0a98f46..dd63e1d 100644
--- a/server/site_tests/firmware_RecoveryButton/firmware_RecoveryButton.py
+++ b/server/site_tests/firmware_RecoveryButton/firmware_RecoveryButton.py
@@ -53,6 +53,7 @@
'recoverysw_boot': '0',
}),
'userspace_action': self.servo.enable_recovery_mode,
+ 'reboot_action': self.sync_and_cold_reboot,
# When dev_mode ON, directly boot to USB stick if presented.
# When dev_mode OFF,
# the old models need users to remove and insert the USB;