faft: Use normal full power-off process for the tests which change cgpt value
In normal cases, we use the hardware warm reboot after each step. It caused
an issue that some tests change a cgpt value but the new value seems to be
cached in the block device, not fast enough to write the physical disk.
This CL changes the reboot action to use the normal full power-off process,
which presses the power-button. The system shutdown process should write all
cached data to the physical disk. It takes longer time to reboot but it acts
like more realistic user behavior.
BUG=chrome-os-partner:14055
TEST=Run firmware_CorruptKernelB passed on Snow.
Change-Id: Id5c1ada4b727cc48eb80f4b6820a795db05f424f
Reviewed-on: https://gerrit.chromium.org/gerrit/33268
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Ready: 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 7222463..161152f 100644
--- a/server/cros/faftsequence.py
+++ b/server/cros/faftsequence.py
@@ -103,6 +103,8 @@
SYNC_DELAY = 5
# Delay for waiting client to return before EC reboot
EC_REBOOT_DELAY = 1
+ # Delay for waiting client to full power off
+ FULL_POWER_OFF_DELAY = 30
# Delay between EC reboot and pressing power button
POWER_BTN_DELAY = 0.5
# Delay of EC software sync hash calculating time
@@ -1194,6 +1196,15 @@
self.check_lid_and_power_on()
+ def full_power_off_and_on(self):
+ """Shutdown the device by pressing power button and power on again."""
+ # Press power button to trigger Chrome OS normal shutdown process.
+ self.servo.power_normal_press()
+ time.sleep(self.FULL_POWER_OFF_DELAY)
+ # Short press power button to boot DUT again.
+ self.servo.power_short_press()
+
+
def check_lid_and_power_on(self):
"""
On devices with EC software sync, system powers on after EC reboots if