FAFT: Use power_key() where appropriate to power on DUT
Some platforms need a longer power button press than others when
turning on. This is particularly true for platforms that do not
have an EC since the EC will hold the power on signal for the host/AP
for as long as needed (which may exceed the SHORT_DELAY used by
power_short_press()). Platforms without an EC need to be able to
define their own power on hold time.
This patch does a few small things to address that:
- Add hold_pwr_button_poweron in FAFT config to be used as the power
button hold time.
- Rename hold_pwr_button to hold_pwr_button_poweroff to be more
explicit about its usage.
- In cases where an EC is not used, replace power_short_press() with
power_key() and pass hold_pwr_button_poweron as its argument.
BUG=chrome-os-partner:44275
BRANCH=firmware-veyron
TEST=firmware_ConsecutiveBoot now passes on mickey (with follow-up
patch to define hold_pwr_button_poweron)
Change-Id: Ie26f254f0cde0ef083f5db3caf51b2c85b622a77
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/295186
diff --git a/server/cros/faft/firmware_test.py b/server/cros/faft/firmware_test.py
index 6dca8c9..8b1ab6d 100644
--- a/server/cros/faft/firmware_test.py
+++ b/server/cros/faft/firmware_test.py
@@ -936,13 +936,13 @@
boot_id = self.get_bootid()
# Press power button to trigger Chrome OS normal shutdown process.
# We use a customized delay since the normal-press 1.2s is not enough.
- self.servo.power_key(self.faft_config.hold_pwr_button)
+ self.servo.power_key(self.faft_config.hold_pwr_button_poweroff)
# device can take 44-51 seconds to restart,
# add buffer from the default timeout of 60 seconds.
self.wait_for_client_offline(timeout=100, orig_boot_id=boot_id)
time.sleep(self.faft_config.shutdown)
# Short press power button to boot DUT again.
- self.servo.power_short_press()
+ self.servo.power_key(self.faft_config.hold_pwr_button_poweron)
def check_lid_and_power_on(self):
"""
@@ -1077,7 +1077,7 @@
if pre_power_action:
self._call_action(pre_power_action)
- self.servo.power_short_press()
+ self.servo.power_key(self.faft_config.hold_pwr_button_poweron)
if post_power_action:
self._call_action(post_power_action)