faft: Static declaration of faft_delay_constants memebers
BUG=chromium-os:35902
TEST=Ran FAFT suite and passed.
Change-Id: I1dceb3fa7f6c88b50173b27d061a9aa3b0f975ec
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36999
diff --git a/server/cros/faft_delay_constants.py b/server/cros/faft_delay_constants.py
index 4721c11..a4f4fba 100644
--- a/server/cros/faft_delay_constants.py
+++ b/server/cros/faft_delay_constants.py
@@ -6,38 +6,36 @@
"""Class that contains the delay constants for FAFT."""
version = 1
- DEFAULT_DELAY = {
- # Delay between power-on and firmware screen
- 'firmware_screen': 10,
- # Delay between passing firmware screen and text mode warning screen
- 'legacy_text_screen': 20,
- # The developer screen timeouts fit our spec
- 'dev_screen_timeout': 30,
- # Delay for waiting beep done
- 'beep': 1,
- # Delay of loading the USB kernel
- 'load_usb': 10,
- # Delay between USB plug-out and plug-in
- 'between_usb_plug': 10,
- # Delay after running the 'sync' command
- 'sync': 5,
- # Delay for waiting client to shutdown
- 'shutdown': 30,
- # Delay for waiting client to return before sending EC reboot command
- 'ec_reboot_cmd': 1,
- # Delay between EC boot and ChromeEC console functional
- 'ec_boot_to_console': 0.5,
- # Delay between EC boot and pressing power button
- 'ec_boot_to_pwr_button': 0.5,
- # Delay of EC software sync hash calculating time
- 'software_sync': 6,
- # Duration of holding cold_reset to reset device
- 'hold_cold_reset': 0.1,
- # devserver startup time
- 'devserver': 10,
- # Delay of waiting factory install shim to reset TPM
- 'install_shim_done': 120,
- }
+ # Delay between power-on and firmware screen
+ firmware_screen = 10
+ # Delay between passing firmware screen and text mode warning screen
+ legacy_text_screen = 20
+ # The developer screen timeouts fit our spec
+ dev_screen_timeout = 30
+ # Delay for waiting beep done
+ beep = 1
+ # Delay of loading the USB kernel
+ load_usb = 10
+ # Delay between USB plug-out and plug-in
+ between_usb_plug = 10
+ # Delay after running the 'sync' command
+ sync = 5
+ # Delay for waiting client to shutdown
+ shutdown = 30
+ # Delay for waiting client to return before sending EC reboot command
+ ec_reboot_cmd = 1
+ # Delay between EC boot and ChromeEC console functional
+ ec_boot_to_console = 0.5
+ # Delay between EC boot and pressing power button
+ ec_boot_to_pwr_button = 0.5
+ # Delay of EC software sync hash calculating time
+ software_sync = 6
+ # Duration of holding cold_reset to reset device
+ hold_cold_reset = 0.1
+ # devserver startup time
+ devserver = 10
+ # Delay of waiting factory install shim to reset TPM
+ install_shim_done = 120
def __init__(self, platform=None):
"""Initialized.
@@ -46,15 +44,13 @@
platform: Optional, platform name returned by FAFT client. If not
given, use the default delay values.
"""
- self.__dict__.update(self.DEFAULT_DELAY)
if platform:
- self.__dict__.update(self._get_platform_delay(platform))
+ self._update_platform_delay(platform)
- def _get_platform_delay(self, platform):
- """Return platform-specific delay values."""
- setting = dict()
+ def _update_platform_delay(self, platform):
+ """Set platform dependent delay."""
# Add the platform-specific delay values here.
- return setting
+ pass
diff --git a/server/cros/faftsequence.py b/server/cros/faftsequence.py
index 525b36b..90a9c1b 100644
--- a/server/cros/faftsequence.py
+++ b/server/cros/faftsequence.py
@@ -1061,7 +1061,7 @@
is_dev = self.checkers.crossystem_checker({'devsw_boot': '1'})
if not is_dev:
self.enable_dev_mode_and_reboot()
- time.sleep(self.SYNC_DELAY)
+ time.sleep(self.delay.sync)
self.enable_rec_mode_and_reboot()
time.sleep(self.delay.install_shim_done)
self.warm_reboot()