faft: Support a customized hold_power_button delay to shutdown DUT normally
The original normal-press 1.2s is not enough when DUT is busy.
As a result, DUT may not be shutted down and cause a test failure.
Changing it to 2s is more reliable.
BUG=chrome-os-partner:16759
TEST=run firmware_ConsecutiveBoot with 10 iterations passed.
Change-Id: I28f0a0778dd31b8e4313aa06956cd69eb2215602
Reviewed-on: https://gerrit.chromium.org/gerrit/39579
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 23d824d..224258a 100644
--- a/server/cros/faftsequence.py
+++ b/server/cros/faftsequence.py
@@ -1216,7 +1216,8 @@
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()
+ # We use a customized delay since the normal-press 1.2s is not enough.
+ self.servo.power_key(self.delay.hold_pwr_button)
time.sleep(self.delay.shutdown)
# Short press power button to boot DUT again.
self.servo.power_short_press()