Convert FAFT RPCs from CamelCase to snake_case
Context: Previously, we were converting the FAFT RPC server to use gRPC.
(See go/faft-grpc for more information on this.)
In order to comply with the gRPC and protobuf style guides, we converted
the FAFT RPC servicers and methods from snake_case to CamelCase.
That conversion was in the following CL: https://crrev.com/c/1680644
More recently, we have decided to cancel the gRPC conversion.
(Again, see go/faft-grpc for more context.)
This CL takes us back to snake_case in order to comply with the Python
style guide.
TEST=firmware_FAFTRPC.all, firmware_FAFTSetup, firmware_CorruptFwBodyA,
firmware_CorruptFwSigA, firmware_RollbackFirmware
Also, inspect the output of the following grep in order to ensure that
no weirdly-syntaxed calls slip through the cracks:
grep -rE --include \*.py 'faft_client(\.\w+)?(\.[A-Z]|$|[^A-Za-z0-9_.])'
BUG=chromium:963160
Change-Id: Iff9604c23fdc968c51b256f53a9b634a9c13c96d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1985277
Tested-by: Greg Edelston <gredelston@google.com>
Reviewed-by: Dana Goyette <dgoyette@chromium.org>
Commit-Queue: Greg Edelston <gredelston@google.com>
diff --git a/client/cros/faft/config.py b/client/cros/faft/config.py
index 1525dad..2388af4 100644
--- a/client/cros/faft/config.py
+++ b/client/cros/faft/config.py
@@ -10,6 +10,6 @@
rpc_port = 9990
rpc_command = '/usr/local/autotest/cros/faft/rpc_server.py'
rpc_command_short = 'rpc_server'
- rpc_ready_call = 'System.IsAvailable'
+ rpc_ready_call = 'system.is_available'
rpc_timeout = 20
rpc_logfile = '/var/log/faft_xmlrpc_server.log'
diff --git a/client/cros/faft/rpc_functions.py b/client/cros/faft/rpc_functions.py
index 34043ec..a14d5a4 100644
--- a/client/cros/faft/rpc_functions.py
+++ b/client/cros/faft/rpc_functions.py
@@ -54,15 +54,15 @@
self.updater = UpdaterServicer(os_if)
self._rpc_servicers = {
- 'Bios': self.bios,
- 'Cgpt': self.cgpt,
- 'Ec': self.ec,
- 'Kernel': self.kernel,
- 'RpcSettings': self.rpc_settings,
- 'Rootfs': self.rootfs,
- 'System': self.system,
- 'Tpm': self.tpm,
- 'Updater': self.updater
+ 'bios': self.bios,
+ 'cgpt': self.cgpt,
+ 'ec': self.ec,
+ 'kernel': self.kernel,
+ 'rpc_settings': self.rpc_settings,
+ 'rootfs': self.rootfs,
+ 'system': self.system,
+ 'tpm': self.tpm,
+ 'updater': self.updater
}
self._os_if = os_if
@@ -222,25 +222,25 @@
self._real_bios_handler.init()
return self._real_bios_handler
- def Reload(self):
+ def reload(self):
"""Reload the firmware image that may be changed."""
self._bios_handler.new_image()
- def GetGbbFlags(self):
+ def get_gbb_flags(self):
"""Get the GBB flags.
@return: An integer of the GBB flags.
"""
return self._bios_handler.get_gbb_flags()
- def SetGbbFlags(self, flags):
+ def set_gbb_flags(self, flags):
"""Set the GBB flags.
@param flags: An integer of the GBB flags.
"""
self._bios_handler.set_gbb_flags(flags, write_through=True)
- def GetPreambleFlags(self, section):
+ def get_preamble_flags(self, section):
"""Get the preamble flags of a firmware section.
@param section: A firmware section, either 'a' or 'b'.
@@ -248,17 +248,17 @@
"""
return self._bios_handler.get_section_flags(section)
- def SetPreambleFlags(self, section, flags):
+ def set_preamble_flags(self, section, flags):
"""Set the preamble flags of a firmware section.
@param section: A firmware section, either 'a' or 'b'.
@param flags: An integer of preamble flags.
"""
- version = self.GetVersion(section)
+ version = self.get_version(section)
self._bios_handler.set_section_version(
section, version, flags, write_through=True)
- def GetBodySha(self, section):
+ def get_body_sha(self, section):
"""Get SHA1 hash of BIOS RW firmware section.
@param section: A firmware section, either 'a' or 'b'.
@@ -266,7 +266,7 @@
"""
return self._bios_handler.get_section_sha(section)
- def GetSigSha(self, section):
+ def get_sig_sha(self, section):
"""Get SHA1 hash of firmware vblock in section.
@param section: A firmware section, either 'a' or 'b'.
@@ -274,7 +274,7 @@
"""
return self._bios_handler.get_section_sig_sha(section)
- def GetSectionFwid(self, section=None):
+ def get_section_fwid(self, section=None):
"""Retrieve the RO or RW fwid.
@param section: A firmware section, either 'a' or 'b'.
@@ -282,21 +282,21 @@
"""
return self._bios_handler.get_section_fwid(section)
- def CorruptSig(self, section):
+ def corrupt_sig(self, section):
"""Corrupt the requested firmware section signature.
@param section: A firmware section, either 'a' or 'b'.
"""
self._bios_handler.corrupt_firmware(section)
- def RestoreSig(self, section):
+ def restore_sig(self, section):
"""Restore the previously corrupted firmware section signature.
@param section: A firmware section, either 'a' or 'b'.
"""
self._bios_handler.restore_firmware(section)
- def CorruptBody(self, section, corrupt_all=False):
+ def corrupt_body(self, section, corrupt_all=False):
"""Corrupt the requested firmware section body.
@param section: A firmware section, either 'a' or 'b'.
@@ -305,7 +305,7 @@
"""
self._bios_handler.corrupt_firmware_body(section, corrupt_all)
- def RestoreBody(self, section):
+ def restore_body(self, section):
"""Restore the previously corrupted firmware section body.
@param section: A firmware section, either 'a' or 'b'.
@@ -318,7 +318,7 @@
The passed in delta, a positive or a negative number, is added to the
original firmware version.
"""
- original_version = self.GetVersion(section)
+ original_version = self.get_version(section)
new_version = original_version + delta
flags = self._bios_handler.get_section_flags(section)
self._os_if.log('Setting firmware section %s version from %d to %d' %
@@ -326,34 +326,34 @@
self._bios_handler.set_section_version(
section, new_version, flags, write_through=True)
- def MoveVersionBackward(self, section):
+ def move_version_backward(self, section):
"""Decrement firmware version for the requested section."""
self._modify_version(section, -1)
- def MoveVersionForward(self, section):
+ def move_version_forward(self, section):
"""Increase firmware version for the requested section."""
self._modify_version(section, 1)
- def GetVersion(self, section):
+ def get_version(self, section):
"""Retrieve firmware version of a section."""
return self._bios_handler.get_section_version(section)
- def GetDatakeyVersion(self, section):
+ def get_datakey_version(self, section):
"""Return firmware data key version."""
return self._bios_handler.get_section_datakey_version(section)
- def GetKernelSubkeyVersion(self, section):
+ def get_kernel_subkey_version(self, section):
"""Return kernel subkey version."""
return self._bios_handler.get_section_kernel_subkey_version(section)
- def DumpWhole(self, bios_path):
+ def dump_whole(self, bios_path):
"""Dump the current BIOS firmware to a file, specified by bios_path.
@param bios_path: The path of the BIOS image to be written.
"""
self._bios_handler.dump_whole(bios_path)
- def WriteWhole(self, bios_path):
+ def write_whole(self, bios_path):
"""Write the firmware from bios_path to the current system.
@param bios_path: The path of the source BIOS image
@@ -361,7 +361,7 @@
self._bios_handler.new_image(bios_path)
self._bios_handler.write_whole()
- def StripModifiedFwids(self):
+ def strip_modified_fwids(self):
"""Strip any trailing suffixes (from modify_fwids) out of the FWIDs.
@return: a dict of any fwids that were adjusted, by section (ro, a, b)
@@ -369,7 +369,7 @@
"""
return self._bios_handler.strip_modified_fwids()
- def SetWriteProtectRegion(self, region, enabled=None):
+ def set_write_protect_region(self, region, enabled=None):
"""Modify software write protect region and flag in one operation.
@param region: Region to set (usually WP_RO)
@@ -378,7 +378,7 @@
"""
self._bios_handler.set_write_protect_region(region, enabled)
- def SetWriteProtectRange(self, start, length, enabled=None):
+ def set_write_protect_range(self, start, length, enabled=None):
"""Modify software write protect range and flag in one operation.
@param start: offset (bytes) from start of flash to start of range
@@ -388,7 +388,7 @@
"""
self._bios_handler.set_write_protect_range(start, length, enabled)
- def GetWriteProtectStatus(self):
+ def get_write_protect_status(self):
"""Get a dict describing the status of the write protection
@return: {'enabled': True/False, 'start': '0x0', 'length': '0x0', ...}
@@ -396,7 +396,7 @@
"""
return self._bios_handler.get_write_protect_status()
- def IsAvailable(self):
+ def is_available(self):
"""Return True if available, False if not."""
# Use the real handler, to avoid .init() raising an exception
return self._real_bios_handler.is_available()
@@ -412,7 +412,7 @@
self._os_if = os_if
self._cgpt_handler = cgpt_handler.CgptHandler(self._os_if)
- def GetAttributes(self):
+ def get_attributes(self):
"""Get kernel attributes."""
rootdev = self._os_if.get_root_dev()
self._cgpt_handler.read_device_info(rootdev)
@@ -421,7 +421,7 @@
'B': self._cgpt_handler.get_partition(rootdev, 'KERN-B')
}
- def SetAttributes(self, a=None, b=None):
+ def set_attributes(self, a=None, b=None):
"""Set kernel attributes for either partition (or both)."""
partitions = {'A': a, 'B': b}
rootdev = self._os_if.get_root_dev()
@@ -474,11 +474,11 @@
self._real_ec_handler.init()
return self._real_ec_handler
- def Reload(self):
+ def reload(self):
"""Reload the firmware image that may be changed."""
self._ec_handler.new_image()
- def GetVersion(self):
+ def get_version(self):
"""Get EC version via mosys.
@return: A string of the EC version.
@@ -486,19 +486,19 @@
return self._os_if.run_shell_command_get_output(
'mosys ec info | sed "s/.*| //"')[0]
- def GetActiveHash(self):
+ def get_active_hash(self):
"""Get hash of active EC RW firmware."""
return self._os_if.run_shell_command_get_output(
'ectool echash | grep hash: | sed "s/hash:\s\+//"')[0]
- def DumpWhole(self, ec_path):
+ def dump_whole(self, ec_path):
"""Dump the current EC firmware to a file, specified by ec_path.
@param ec_path: The path of the EC image to be written.
"""
self._ec_handler.dump_whole(ec_path)
- def WriteWhole(self, ec_path):
+ def write_whole(self, ec_path):
"""Write the firmware from ec_path to the current system.
@param ec_path: The path of the source EC image.
@@ -506,21 +506,21 @@
self._ec_handler.new_image(ec_path)
self._ec_handler.write_whole()
- def CorruptBody(self, section):
+ def corrupt_body(self, section):
"""Corrupt the requested EC section body.
@param section: An EC section, either 'a' or 'b'.
"""
self._ec_handler.corrupt_firmware_body(section, corrupt_all=True)
- def DumpFirmware(self, ec_path):
+ def dump_firmware(self, ec_path):
"""Dump the current EC firmware to a file, specified by ec_path.
@param ec_path: The path of the EC image to be written.
"""
self._ec_handler.dump_whole(ec_path)
- def SetWriteProtect(self, enable):
+ def set_write_protect(self, enable):
"""Enable write protect of the EC flash chip.
@param enable: True if activating EC write protect. Otherwise, False.
@@ -530,20 +530,20 @@
else:
self._ec_handler.disable_write_protect()
- def IsEfs(self):
+ def is_efs(self):
"""Return True if the EC supports EFS."""
return self._ec_handler.has_section_body('rw_b')
- def CopyRw(self, from_section, to_section):
+ def copy_rw(self, from_section, to_section):
"""Copy EC RW from from_section to to_section."""
self._ec_handler.copy_from_to(from_section, to_section)
- def RebootToSwitchSlot(self):
+ def reboot_to_switch_slot(self):
"""Reboot EC to switch the active RW slot."""
self._os_if.run_shell_command(
'ectool reboot_ec cold switch-slot', modifies_device=True)
- def StripModifiedFwids(self):
+ def strip_modified_fwids(self):
"""Strip any trailing suffixes (from modify_fwids) out of the FWIDs."""
return self._ec_handler.strip_modified_fwids()
@@ -562,14 +562,14 @@
dev_key_path='/usr/share/vboot/devkeys',
internal_disk=True)
- def CorruptSig(self, section):
+ def corrupt_sig(self, section):
"""Corrupt the requested kernel section.
@param section: A kernel section, either 'a' or 'b'.
"""
self._kernel_handler.corrupt_kernel(section)
- def RestoreSig(self, section):
+ def restore_sig(self, section):
"""Restore the requested kernel section (previously corrupted).
@param section: A kernel section, either 'a' or 'b'.
@@ -588,23 +588,23 @@
(section, original_version, new_version))
self._kernel_handler.set_version(section, new_version)
- def MoveVersionBackward(self, section):
+ def move_version_backward(self, section):
"""Decrement kernel version for the requested section."""
self._modify_version(section, -1)
- def MoveVersionForward(self, section):
+ def move_version_forward(self, section):
"""Increase kernel version for the requested section."""
self._modify_version(section, 1)
- def GetVersion(self, section):
+ def get_version(self, section):
"""Return kernel version."""
return self._kernel_handler.get_version(section)
- def GetDatakeyVersion(self, section):
+ def get_datakey_version(self, section):
"""Return kernel datakey version."""
return self._kernel_handler.get_datakey_version(section)
- def DiffAB(self):
+ def diff_a_b(self):
"""Compare kernel A with B.
@return: True: if kernel A is different with B.
@@ -622,11 +622,11 @@
return header_a != header_b
- def ResignWithKeys(self, section, key_path=None):
+ def resign_with_keys(self, section, key_path=None):
"""Resign kernel with temporary key."""
self._kernel_handler.resign_kernel(section, key_path)
- def Dump(self, section, kernel_path):
+ def dump(self, section, kernel_path):
"""Dump the specified kernel to a file.
@param section: The kernel to dump. May be A or B.
@@ -634,7 +634,7 @@
"""
self._kernel_handler.dump_kernel(section, kernel_path)
- def Write(self, section, kernel_path):
+ def write(self, section, kernel_path):
"""Write a kernel image to the specified section.
@param section: The kernel to dump. May be A or B.
@@ -642,7 +642,7 @@
"""
self._kernel_handler.write_kernel(section, kernel_path)
- def GetSha(self, section):
+ def get_sha(self, section):
"""Return the SHA1 hash of the specified kernel section."""
return self._kernel_handler.get_sha(section)
@@ -658,7 +658,7 @@
self._rootfs_handler = rootfs_handler.RootfsHandler()
self._rootfs_handler.init(self._os_if)
- def VerifyRootfs(self, section):
+ def verify_rootfs(self, section):
"""Verifies the integrity of the root FS.
@param section: The rootfs to verify. May be A or B.
@@ -675,11 +675,11 @@
"""
self._os_if = os_if
- def EnableTestMode(self):
+ def enable_test_mode(self):
"""Enable test mode (avoids writing to flash or gpt)"""
self._os_if.test_mode = True
- def DisableTestMode(self):
+ def disable_test_mode(self):
"""Disable test mode and return to normal operation"""
self._os_if.test_mode = False
@@ -694,14 +694,14 @@
self._os_if = os_if
self._key_checker = firmware_check_keys.firmwareCheckKeys()
- def IsAvailable(self):
+ def is_available(self):
"""Function for polling the RPC server availability.
@return: Always True.
"""
return True
- def DumpLog(self, remove_log=False):
+ def dump_log(self, remove_log=False):
"""Dump the log file.
@param remove_log: Remove the log file after dump.
@@ -713,14 +713,14 @@
os.remove(self._os_if.log_file)
return log
- def RunShellCommand(self, command):
+ def run_shell_command(self, command):
"""Run shell command.
@param command: A shell command to be run.
"""
self._os_if.run_shell_command(command)
- def RunShellCommandCheckOutput(self, command, success_token):
+ def run_shell_command_check_output(self, command, success_token):
"""Run shell command and check its stdout for a string.
@param command: A shell command to be run.
@@ -731,7 +731,7 @@
return self._os_if.run_shell_command_check_output(
command, success_token)
- def RunShellCommandGetOutput(self, command, include_stderr=False):
+ def run_shell_command_get_output(self, command, include_stderr=False):
"""Run shell command and get its console output.
@param command: A shell command to be run.
@@ -739,7 +739,7 @@
"""
return self._os_if.run_shell_command_get_output(command, include_stderr)
- def RunShellCommandGetStatus(self, command):
+ def run_shell_command_get_status(self, command):
"""Run shell command and get its console status.
@param command: A shell command to be run.
@@ -748,7 +748,7 @@
"""
return self._os_if.run_shell_command_get_status(command)
- def GetPlatformName(self):
+ def get_platform_name(self):
"""Get the platform name of the current system.
@return: A string of the platform name.
@@ -761,7 +761,7 @@
'\n'.join(lines))
return lines[-1]
- def GetModelName(self):
+ def get_model_name(self):
"""Get the model name of the current system.
@return: A string of the model name.
@@ -772,14 +772,14 @@
raise Exception('Failed getting model name from cros_config')
return model
- def DevTpmPresent(self):
+ def dev_tpm_present(self):
"""Check if /dev/tpm0 is present.
@return: Boolean true or false.
"""
return os.path.exists('/dev/tpm0')
- def GetCrossystemValue(self, key):
+ def get_crossystem_value(self, key):
"""Get crossystem value of the requested key.
@param key: A crossystem key.
@@ -788,28 +788,28 @@
return self._os_if.run_shell_command_get_output(
'crossystem %s' % key)[0]
- def GetRootDev(self):
+ def get_root_dev(self):
"""Get the name of root device without partition number.
@return: A string of the root device without partition number.
"""
return self._os_if.get_root_dev()
- def GetRootPart(self):
+ def get_root_part(self):
"""Get the name of root device with partition number.
@return: A string of the root device with partition number.
"""
return self._os_if.get_root_part()
- def SetTryFwB(self, count=1):
+ def set_try_fw_b(self, count=1):
"""Set 'Try Firmware B' flag in crossystem.
@param count: # times to try booting into FW B
"""
self._os_if.cs.fwb_tries = count
- def SetFwTryNext(self, next, count=0):
+ def set_fw_try_next(self, next, count=0):
"""Set fw_try_next to A or B.
@param next: Next FW to reboot to (A or B)
@@ -819,32 +819,32 @@
if count:
self._os_if.cs.fw_try_count = count
- def GetFwVboot2(self):
+ def get_fw_vboot2(self):
"""Get fw_vboot2."""
try:
return self._os_if.cs.fw_vboot2 == '1'
except os_interface.OSInterfaceError:
return False
- def RequestRecoveryBoot(self):
+ def request_recovery_boot(self):
"""Request running in recovery mode on the restart."""
self._os_if.cs.request_recovery()
- def GetDevBootUsb(self):
+ def get_dev_boot_usb(self):
"""Get dev_boot_usb value which controls developer mode boot from USB.
@return: True if enable, False if disable.
"""
return self._os_if.cs.dev_boot_usb == '1'
- def SetDevBootUsb(self, value):
+ def set_dev_boot_usb(self, value):
"""Set dev_boot_usb value which controls developer mode boot from USB.
@param value: True to enable, False to disable.
"""
self._os_if.cs.dev_boot_usb = 1 if value else 0
- def IsRemovableDeviceBoot(self):
+ def is_removable_device_boot(self):
"""Check the current boot device is removable.
@return: True: if a removable device boots.
@@ -853,24 +853,24 @@
root_part = self._os_if.get_root_part()
return self._os_if.is_removable_device(root_part)
- def GetInternalDevice(self):
+ def get_internal_device(self):
"""Get the internal disk by given the current disk."""
root_part = self._os_if.get_root_part()
return self._os_if.get_internal_disk(root_part)
- def CreateTempDir(self, prefix='backup_'):
+ def create_temp_dir(self, prefix='backup_'):
"""Create a temporary directory and return the path."""
return tempfile.mkdtemp(prefix=prefix)
- def RemoveFile(self, file_path):
+ def remove_file(self, file_path):
"""Remove the file."""
return self._os_if.remove_file(file_path)
- def RemoveDir(self, dir_path):
+ def remove_dir(self, dir_path):
"""Remove the directory."""
return self._os_if.remove_dir(dir_path)
- def CheckKeys(self, expected_sequence):
+ def check_keys(self, expected_sequence):
"""Check the keys sequence was as expected.
@param expected_sequence: A list of expected key sequences.
@@ -901,32 +901,32 @@
self._real_tpm_handler.init()
return self._real_tpm_handler
- def GetFirmwareVersion(self):
+ def get_firmware_version(self):
"""Retrieve tpm firmware body version."""
return self._tpm_handler.get_fw_version()
- def GetFirmwareDatakeyVersion(self):
+ def get_firmware_datakey_version(self):
"""Retrieve tpm firmware data key version."""
return self._tpm_handler.get_fw_key_version()
- def GetKernelVersion(self):
+ def get_kernel_version(self):
"""Retrieve tpm kernel body version."""
return self._tpm_handler.get_kernel_version()
- def GetKernelDatakeyVersion(self):
+ def get_kernel_datakey_version(self):
"""Retrieve tpm kernel data key version."""
return self._tpm_handler.get_kernel_key_version()
- def GetTpmVersion(self):
+ def get_tpm_version(self):
"""Returns '1.2' or '2.0' as a string."""
# tpmc can return this without stopping daemons, so access real handler.
return self._real_tpm_handler.get_tpm_version()
- def StopDaemon(self):
+ def stop_daemon(self):
"""Stop tpm related daemon."""
return self._tpm_handler.stop_daemon()
- def RestartDaemon(self):
+ def restart_daemon(self):
"""Restart tpm related daemon which was stopped by stop_daemon()."""
return self._tpm_handler.restart_daemon()
@@ -951,40 +951,40 @@
self._real_updater.init()
return self._real_updater
- def Cleanup(self):
+ def cleanup(self):
"""Clean up the temporary directory"""
# Use the updater directly, to avoid initializing it just to clean it up
self._real_updater.cleanup_temp_dir()
- def StopDaemon(self):
+ def stop_daemon(self):
"""Stop update-engine daemon."""
return self._real_updater.stop_daemon()
- def StartDaemon(self):
+ def start_daemon(self):
"""Start update-engine daemon."""
return self._real_updater.start_daemon()
- def GetSectionFwid(self, target='bios', section=None):
+ def get_section_fwid(self, target='bios', section=None):
"""Retrieve shellball's RW or RO fwid."""
return self._updater.get_section_fwid(target, section)
- def GetAllFwids(self, target='bios'):
+ def get_all_fwids(self, target='bios'):
"""Retrieve shellball's RW and/or RO fwids for all sections."""
return self._updater.get_all_fwids(target)
- def GetAllInstalledFwids(self, target='bios', filename=None):
+ def get_all_installed_fwids(self, target='bios', filename=None):
"""Retrieve installed (possibly emulated) fwids for the target."""
return self._updater.get_all_installed_fwids(target, filename)
- def ModifyFwids(self, target='bios', sections=None):
+ def modify_fwids(self, target='bios', sections=None):
"""Modify the fwid in the image, but don't flash it."""
return self._updater.modify_fwids(target, sections)
- def ModifyEcidAndFlashToBios(self):
+ def modify_ecid_and_flash_to_bios(self):
"""Modify ecid, put it to AP firmware, and flash it to the system."""
self._updater.modify_ecid_and_flash_to_bios()
- def CorruptDiagnosticsImage(self, local_filename):
+ def corrupt_diagnostics_image(self, local_filename):
"""Corrupts a diagnostics image in the CBFS working directory.
@param local_filename: Filename for storing the diagnostics image in the
@@ -992,42 +992,42 @@
"""
self._updater.corrupt_diagnostics_image(local_filename)
- def GetEcHash(self):
+ def get_ec_hash(self):
"""Return the hex string of the EC hash."""
blob = self._updater.get_ec_hash()
# Format it to a hex string
return ''.join('%02x' % ord(c) for c in blob)
- def ResignFirmware(self, version):
+ def resign_firmware(self, version):
"""Resign firmware with version.
@param version: new version number.
"""
self._updater.resign_firmware(version)
- def ExtractShellball(self, append=None):
+ def extract_shellball(self, append=None):
"""Extract shellball with the given append suffix.
@param append: use for the shellball name.
"""
return self._updater.extract_shellball(append)
- def RepackShellball(self, append=None):
+ def repack_shellball(self, append=None):
"""Repack shellball with new fwid.
@param append: use for the shellball name.
"""
return self._updater.repack_shellball(append)
- def ResetShellball(self):
+ def reset_shellball(self):
"""Revert to the stock shellball"""
self._updater.reset_shellball()
- def ReloadImages(self):
+ def reload_images(self):
"""Reload handlers from the on-disk images, in case they've changed."""
self._updater.reload_images()
- def RunFirmwareupdate(self, mode, append=None, options=()):
+ def run_firmwareupdate(self, mode, append=None, options=()):
"""Run updater with the given options
@param mode: mode for the updater
@@ -1038,32 +1038,32 @@
"""
return self._updater.run_firmwareupdate(mode, append, options)
- def RunAutoupdate(self, append):
+ def run_autoupdate(self, append):
"""Run chromeos-firmwareupdate with autoupdate mode."""
options = ['--noupdate_ec', '--wp=1']
self._updater.run_firmwareupdate(
mode='autoupdate', append=append, options=options)
- def RunFactoryInstall(self):
+ def run_factory_install(self):
"""Run chromeos-firmwareupdate with factory_install mode."""
options = ['--noupdate_ec', '--wp=0']
self._updater.run_firmwareupdate(
mode='factory_install', options=options)
- def RunBootok(self, append):
+ def run_bootok(self, append):
"""Run chromeos-firmwareupdate with bootok mode."""
self._updater.run_firmwareupdate(mode='bootok', append=append)
- def RunRecovery(self):
+ def run_recovery(self):
"""Run chromeos-firmwareupdate with recovery mode."""
options = ['--noupdate_ec', '--nocheck_keys', '--force', '--wp=1']
self._updater.run_firmwareupdate(mode='recovery', options=options)
- def CbfsSetupWorkDir(self):
+ def cbfs_setup_work_dir(self):
"""Sets up cbfstool work directory."""
return self._updater.cbfs_setup_work_dir()
- def CbfsExtractChip(self, fw_name):
+ def cbfs_extract_chip(self, fw_name):
"""Runs cbfstool to extract chip firmware.
@param fw_name: Name of chip firmware to extract.
@@ -1071,7 +1071,7 @@
"""
return self._updater.cbfs_extract_chip(fw_name)
- def CbfsExtractDiagnostics(self, diag_name, local_filename):
+ def cbfs_extract_diagnostics(self, diag_name, local_filename):
"""Runs cbfstool to extract a diagnostics image.
@param diag_name: Name of the diagnostics image in CBFS
@@ -1080,7 +1080,7 @@
"""
self._updater.cbfs_extract_diagnostics(diag_name, local_filename)
- def CbfsReplaceDiagnostics(self, diag_name, local_filename):
+ def cbfs_replace_diagnostics(self, diag_name, local_filename):
"""Runs cbfstool to replace a diagnostics image in the firmware image.
@param diag_name: Name of the diagnostics image in CBFS
@@ -1089,7 +1089,7 @@
"""
self._updater.cbfs_replace_diagnostics(diag_name, local_filename)
- def CbfsGetChipHash(self, fw_name):
+ def cbfs_get_chip_hash(self, fw_name):
"""Gets the chip firmware hash blob.
@param fw_name: Name of chip firmware whose hash blob to return.
@@ -1097,7 +1097,7 @@
"""
return self._updater.cbfs_get_chip_hash(fw_name)
- def CbfsReplaceChip(self, fw_name):
+ def cbfs_replace_chip(self, fw_name):
"""Runs cbfstool to replace chip firmware.
@param fw_name: Name of chip firmware to extract.
@@ -1105,7 +1105,7 @@
"""
return self._updater.cbfs_replace_chip(fw_name)
- def CbfsSignAndFlash(self):
+ def cbfs_sign_and_flash(self):
"""Runs cbfs signer and flash it.
@param fw_name: Name of chip firmware to extract.
@@ -1113,31 +1113,31 @@
"""
return self._updater.cbfs_sign_and_flash()
- def GetTempPath(self):
+ def get_temp_path(self):
"""Get updater's temp directory path."""
return self._updater.get_temp_path()
- def GetKeysPath(self):
+ def get_keys_path(self):
"""Get updater's keys directory path."""
return self._updater.get_keys_path()
- def GetWorkPath(self):
+ def get_work_path(self):
"""Get updater's work directory path."""
return self._updater.get_work_path()
- def GetBiosRelativePath(self):
+ def get_bios_relative_path(self):
"""Gets the relative path of the bios image in the shellball."""
return self._updater.get_bios_relative_path()
- def GetEcRelativePath(self):
+ def get_ec_relative_path(self):
"""Gets the relative path of the ec image in the shellball."""
return self._updater.get_ec_relative_path()
- def CopyBios(self, filename):
+ def copy_bios(self, filename):
"""Make a copy of the shellball bios.bin"""
return self._updater.copy_bios(filename)
- def GetImageGbbFlags(self, filename=None):
+ def get_image_gbb_flags(self, filename=None):
"""Get the GBB flags in the given image (shellball image if unspecified)
@param filename: the image path to act on (None to use shellball image)
@@ -1145,7 +1145,7 @@
"""
return self._updater.get_image_gbb_flags(filename)
- def SetImageGbbFlags(self, flags, filename=None):
+ def set_image_gbb_flags(self, flags, filename=None):
"""Set the GBB flags in the given image (shellball image if unspecified)
@param flags: the flags to set
diff --git a/server/cros/faft/firmware_test.py b/server/cros/faft/firmware_test.py
index c65e4a3..0978907 100644
--- a/server/cros/faft/firmware_test.py
+++ b/server/cros/faft/firmware_test.py
@@ -143,8 +143,8 @@
self._no_ec_sync = True
self.faft_config = FAFTConfig(
- self.faft_client.System.GetPlatformName(),
- self.faft_client.System.GetModelName())
+ self.faft_client.system.get_platform_name(),
+ self.faft_client.system.get_model_name())
self.checkers = FAFTCheckers(self)
self.switcher = mode_switcher.create_mode_switcher(self)
@@ -169,7 +169,7 @@
% (host.POWER_CONTROL_VALID_ARGS,
self.power_control))
- if not self.faft_client.System.DevTpmPresent():
+ if not self.faft_client.system.dev_tpm_present():
raise error.TestError('/dev/tpm0 does not exist on the client')
# Create the BaseEC object. None if not available.
@@ -177,11 +177,12 @@
self._setup_uart_capture()
self._record_system_info()
- self.fw_vboot2 = self.faft_client.System.GetFwVboot2()
+ self.fw_vboot2 = self.faft_client.system.get_fw_vboot2()
logging.info('vboot version: %d', 2 if self.fw_vboot2 else 1)
if self.fw_vboot2:
- self.faft_client.System.SetFwTryNext('A')
- if self.faft_client.System.GetCrossystemValue('mainfw_act') == 'B':
+ self.faft_client.system.set_fw_try_next('A')
+ if self.faft_client.system.get_crossystem_value(
+ 'mainfw_act') == 'B':
logging.info('mainfw_act is B. rebooting to set it A')
# TODO(crbug.com/1018322): remove try/catch once that bug is
# marked as fixed and verified. In that case the overlay for
@@ -196,13 +197,13 @@
raise
# Check flashrom before first use, to avoid xmlrpclib.Fault.
- if not self.faft_client.Bios.IsAvailable():
+ if not self.faft_client.bios.is_available():
raise error.TestError(
"flashrom is broken; check 'flashrom -p host'"
"and rpc server log.")
self._setup_gbb_flags()
- self.faft_client.Updater.StopDaemon()
+ self.faft_client.updater.stop_daemon()
self._create_faft_lockfile()
self._setup_ec_write_protect(ec_wp)
# See chromium:239034 regarding needing this sync.
@@ -230,7 +231,7 @@
self.servo.rotate_servod_logs(filename=None)
try:
- self.faft_client.System.IsAvailable()
+ self.faft_client.system.is_available()
except:
# Remote is not responding. Revive DUT so that subsequent tests
# don't fail.
@@ -239,8 +240,8 @@
self._restore_ec_write_protect()
self._restore_servo_v4_role()
self._restore_gbb_flags()
- self.faft_client.Updater.StartDaemon()
- self.faft_client.Updater.Cleanup()
+ self.faft_client.updater.start_daemon()
+ self.faft_client.updater.cleanup()
self._remove_faft_lockfile()
self._record_faft_client_log()
self.servo.rotate_servod_logs('servod.cleanup', self.resultsdir)
@@ -258,10 +259,10 @@
This info is used by generate_test_report later.
"""
system_info = {
- 'hwid': self.faft_client.System.GetCrossystemValue('hwid'),
- 'ec_version': self.faft_client.Ec.GetVersion(),
- 'ro_fwid': self.faft_client.System.GetCrossystemValue('ro_fwid'),
- 'rw_fwid': self.faft_client.System.GetCrossystemValue('fwid'),
+ 'hwid': self.faft_client.system.get_crossystem_value('hwid'),
+ 'ec_version': self.faft_client.ec.get_version(),
+ 'ro_fwid': self.faft_client.system.get_crossystem_value('ro_fwid'),
+ 'rw_fwid': self.faft_client.system.get_crossystem_value('fwid'),
'servo_host_os_version' : self.servo.get_os_version(),
'servod_version': self.servo.get_servod_version(),
'os_version': self._client.get_release_builder_path(),
@@ -305,7 +306,7 @@
try:
self.switcher.wait_for_client()
- lines = self.faft_client.System.RunShellCommandGetOutput(
+ lines = self.faft_client.system.run_shell_command_get_output(
'crossystem recovery_reason')
recovery_reason = int(lines[0])
logging.info('Got the recovery reason %d.', recovery_reason)
@@ -366,7 +367,7 @@
# DUT may be broken by a corrupted OS image. Restore OS image.
self._ensure_client_in_recovery()
logging.info('Try restore the OS image...')
- self.faft_client.System.RunShellCommand('chromeos-install --yes')
+ self.faft_client.system.run_shell_command('chromeos-install --yes')
self.switcher.mode_aware_reboot(wait_for_dut_up=False)
self.switcher.wait_for_client_offline()
self.switcher.bypass_dev_mode()
@@ -446,8 +447,8 @@
usb_lsb = self.servo.system_output('cat %s' %
os.path.join(tmpd, 'etc/lsb-release'))
logging.debug('Dumping lsb-release on USB stick:\n%s', usb_lsb)
- dut_lsb = '\n'.join(self.faft_client.System.
- RunShellCommandGetOutput('cat /etc/lsb-release'))
+ dut_lsb = '\n'.join(self.faft_client.system.
+ run_shell_command_get_output('cat /etc/lsb-release'))
logging.debug('Dumping lsb-release on DUT:\n%s', dut_lsb)
if not re.search(r'RELEASE_TRACK=.*test', usb_lsb):
raise error.TestError('USB stick in servo is no test image')
@@ -554,13 +555,13 @@
# Make the dut unable to see the USB disk.
self.servo.switch_usbkey('off')
no_usb_set = set(
- self.faft_client.System.RunShellCommandGetOutput(cmd))
+ self.faft_client.system.run_shell_command_get_output(cmd))
# Make the dut able to see the USB disk.
self.servo.switch_usbkey('dut')
time.sleep(self.faft_config.usb_plug)
has_usb_set = set(
- self.faft_client.System.RunShellCommandGetOutput(cmd))
+ self.faft_client.system.run_shell_command_get_output(cmd))
# Back to its original value.
if original_value != self.servo.get_usbkey_direction():
@@ -576,13 +577,13 @@
"""Creates the FAFT lockfile."""
logging.info('Creating FAFT lockfile...')
command = 'touch %s' % (self.lockfile)
- self.faft_client.System.RunShellCommand(command)
+ self.faft_client.system.run_shell_command(command)
def _remove_faft_lockfile(self):
"""Removes the FAFT lockfile."""
logging.info('Removing FAFT lockfile...')
command = 'rm -f %s' % (self.lockfile)
- self.faft_client.System.RunShellCommand(command)
+ self.faft_client.system.run_shell_command(command)
def clear_set_gbb_flags(self, clear_mask, set_mask):
"""Clear and set the GBB flags in the current flashrom.
@@ -590,14 +591,14 @@
@param clear_mask: A mask of flags to be cleared.
@param set_mask: A mask of flags to be set.
"""
- gbb_flags = self.faft_client.Bios.GetGbbFlags()
+ gbb_flags = self.faft_client.bios.get_gbb_flags()
new_flags = gbb_flags & ctypes.c_uint32(~clear_mask).value | set_mask
self.gbb_flags = new_flags
if new_flags != gbb_flags:
self._backup_gbb_flags = gbb_flags
logging.info('Changing GBB flags from 0x%x to 0x%x.',
gbb_flags, new_flags)
- self.faft_client.Bios.SetGbbFlags(new_flags)
+ self.faft_client.bios.set_gbb_flags(new_flags)
# If changing FORCE_DEV_SWITCH_ON or DISABLE_EC_SOFTWARE_SYNC flag,
# reboot to get a clear state
if ((gbb_flags ^ new_flags) &
@@ -701,15 +702,15 @@
@param from_part: A string of partition number to be copied from.
@param to_part: A string of partition number to be copied to.
"""
- root_dev = self.faft_client.System.GetRootDev()
+ root_dev = self.faft_client.system.get_root_dev()
logging.info('Copying kernel from %s to %s. Please wait...',
from_part, to_part)
- self.faft_client.System.RunShellCommand('dd if=%s of=%s bs=4M' %
+ self.faft_client.system.run_shell_command('dd if=%s of=%s bs=4M' %
(self._join_part(root_dev, self.KERNEL_MAP[from_part]),
self._join_part(root_dev, self.KERNEL_MAP[to_part])))
logging.info('Copying rootfs from %s to %s. Please wait...',
from_part, to_part)
- self.faft_client.System.RunShellCommand('dd if=%s of=%s bs=4M' %
+ self.faft_client.system.run_shell_command('dd if=%s of=%s bs=4M' %
(self._join_part(root_dev, self.ROOTFS_MAP[from_part]),
self._join_part(root_dev, self.ROOTFS_MAP[to_part])))
@@ -722,7 +723,7 @@
@param part: A string of kernel partition number or 'a'/'b'.
"""
if not self.checkers.root_part_checker(part):
- if self.faft_client.Kernel.DiffAB():
+ if self.faft_client.kernel.diff_a_b():
self.copy_kernel_and_rootfs(
from_part=self.OTHER_KERNEL_MAP[part],
to_part=part)
@@ -738,9 +739,9 @@
@param original_dev_boot_usb: Original dev_boot_usb value.
"""
logging.info('Checking internal device boot.')
- if self.faft_client.System.IsRemovableDeviceBoot():
+ if self.faft_client.system.is_removable_device_boot():
logging.info('Reboot into internal disk...')
- self.faft_client.System.SetDevBootUsb(original_dev_boot_usb)
+ self.faft_client.system.set_dev_boot_usb(original_dev_boot_usb)
self.switcher.mode_aware_reboot()
self.check_state((self.checkers.dev_boot_usb_checker, False,
'Device not booted from internal disk properly.'))
@@ -775,7 +776,7 @@
if self.faft_config.chrome_ec:
self.set_chrome_ec_write_protect_and_reboot(enable)
else:
- self.faft_client.Ec.SetWriteProtect(enable)
+ self.faft_client.ec.set_write_protect(enable)
self.switcher.mode_aware_reboot()
def set_chrome_ec_write_protect_and_reboot(self, enable):
@@ -932,12 +933,12 @@
def suspend(self):
"""Suspends the DUT."""
cmd = '(sleep %d; powerd_dbus_suspend) &' % self.EC_SUSPEND_DELAY
- self.faft_client.System.RunShellCommand(cmd)
+ self.faft_client.system.run_shell_command(cmd)
time.sleep(self.EC_SUSPEND_DELAY)
def _record_faft_client_log(self):
"""Record the faft client log to the results directory."""
- client_log = self.faft_client.System.DumpLog(True)
+ client_log = self.faft_client.system.dump_log(True)
client_log_file = os.path.join(self.resultsdir, 'faft_client.log')
with open(client_log_file, 'w') as f:
f.write(client_log)
@@ -991,7 +992,7 @@
if not self.checkers.crossystem_checker({'tried_fwb': '1'}):
logging.info(
'Firmware is not booted with tried_fwb. Reboot into it.')
- self.faft_client.System.SetTryFwB()
+ self.faft_client.system.set_try_fw_b()
else:
if not self.checkers.crossystem_checker({'tried_fwb': '0'}):
logging.info(
@@ -1017,10 +1018,10 @@
@param section: A firmware section, either 'a' or 'b'.
"""
- flags = self.faft_client.Bios.GetPreambleFlags(section)
+ flags = self.faft_client.bios.get_preamble_flags(section)
if flags & vboot.PREAMBLE_USE_RO_NORMAL:
flags = flags ^ vboot.PREAMBLE_USE_RO_NORMAL
- self.faft_client.Bios.SetPreambleFlags(section, flags)
+ self.faft_client.bios.set_preamble_flags(section, flags)
self.switcher.mode_aware_reboot()
def setup_kernel(self, part):
@@ -1033,8 +1034,8 @@
"""
self.ensure_kernel_boot(part)
logging.info('Checking the integrity of kernel B and rootfs B...')
- if (self.faft_client.Kernel.DiffAB() or
- not self.faft_client.Rootfs.VerifyRootfs('B')):
+ if (self.faft_client.kernel.diff_a_b() or
+ not self.faft_client.rootfs.verify_rootfs('B')):
logging.info('Copying kernel and rootfs from A to B...')
self.copy_kernel_and_rootfs(from_part=part,
to_part=self.OTHER_KERNEL_MAP[part])
@@ -1047,14 +1048,14 @@
@param part: A string of partition number to be prioritized.
"""
- root_dev = self.faft_client.System.GetRootDev()
+ root_dev = self.faft_client.system.get_root_dev()
# Reset kernel A and B to bootable.
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.run_shell_command(
'cgpt add -i%s -P1 -S1 -T0 %s' % (self.KERNEL_MAP['a'], root_dev))
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.run_shell_command(
'cgpt add -i%s -P1 -S1 -T0 %s' % (self.KERNEL_MAP['b'], root_dev))
# Set kernel part highest priority.
- self.faft_client.System.RunShellCommand('cgpt prioritize -i%s %s' %
+ self.faft_client.system.run_shell_command('cgpt prioritize -i%s %s' %
(self.KERNEL_MAP[part], root_dev))
def do_blocking_sync(self, device):
@@ -1064,7 +1065,7 @@
if 'mmcblk' in device:
# For mmc devices, use `mmc status get` command to send an
# empty command to wait for the disk to be available again.
- self.faft_client.System.RunShellCommand('mmc status get %s' %
+ self.faft_client.system.run_shell_command('mmc status get %s' %
device)
elif 'nvme' in device:
# For NVMe devices, use `nvme flush` command to commit data
@@ -1075,7 +1076,7 @@
# [ 0]:0x1
# [ 1]:0x2
list_ns_cmd = "nvme list-ns %s" % device
- available_ns = self.faft_client.System.RunShellCommandGetOutput(
+ available_ns = self.faft_client.system.run_shell_command_get_output(
list_ns_cmd)
if not available_ns:
@@ -1086,7 +1087,7 @@
for ns in available_ns:
ns = ns.split(':')[-1]
flush_cmd = 'nvme flush %s -n %s' % (device, ns)
- flush_rc = self.faft_client.System.RunShellCommandGetStatus(
+ flush_rc = self.faft_client.system.run_shell_command_get_status(
flush_cmd)
if flush_rc != 0:
raise error.TestError(
@@ -1095,7 +1096,7 @@
else:
# For other devices, hdparm sends TUR to check if
# a device is ready for transfer operation.
- self.faft_client.System.RunShellCommand('hdparm -f %s' % device)
+ self.faft_client.system.run_shell_command('hdparm -f %s' % device)
def blocking_sync(self):
"""Sync root device and internal device."""
@@ -1103,17 +1104,17 @@
# since the first call returns before the flush
# is complete, but the second will wait for the
# first to finish.
- self.faft_client.System.RunShellCommand('sync')
- self.faft_client.System.RunShellCommand('sync')
+ self.faft_client.system.run_shell_command('sync')
+ self.faft_client.system.run_shell_command('sync')
# sync only sends SYNCHRONIZE_CACHE but doesn't check the status.
# This function will perform a device-specific sync command.
- root_dev = self.faft_client.System.GetRootDev()
+ root_dev = self.faft_client.system.get_root_dev()
self.do_blocking_sync(root_dev)
# Also sync the internal device if booted from removable media.
- if self.faft_client.System.IsRemovableDeviceBoot():
- internal_dev = self.faft_client.System.GetInternalDevice()
+ if self.faft_client.system.is_removable_device_boot():
+ internal_dev = self.faft_client.system.get_internal_device()
self.do_blocking_sync(internal_dev)
def sync_and_ec_reboot(self, flags=''):
@@ -1132,7 +1133,7 @@
def reboot_and_reset_tpm(self):
"""Reboot into recovery mode, reset TPM, then reboot back to disk."""
self.switcher.reboot_to_mode(to_mode='rec')
- self.faft_client.System.RunShellCommand('chromeos-tpm-recovery')
+ self.faft_client.system.run_shell_command('chromeos-tpm-recovery')
self.switcher.mode_aware_reboot()
def full_power_off_and_on(self):
@@ -1179,11 +1180,11 @@
This will cause the AP to ignore power button presses sent by the EC.
"""
- powerd_running = self.faft_client.System.RunShellCommandCheckOutput(
+ powerd_running = self.faft_client.system.run_shell_command_check_output(
'status powerd', 'start/running')
if powerd_running:
logging.debug('Stopping powerd')
- self.faft_client.System.RunShellCommand("stop powerd")
+ self.faft_client.system.run_shell_command("stop powerd")
def _modify_usb_kernel(self, usb_dev, from_magic, to_magic):
"""Modify the kernel header magic in USB stick.
@@ -1365,19 +1366,19 @@
# TODO(dgoyette): add a way to avoid hardcoding the keys (section names)
current_checksums = {
- 'VBOOTA': self.faft_client.Bios.GetSigSha('a'),
- 'FVMAINA': self.faft_client.Bios.GetBodySha('a'),
- 'VBOOTB': self.faft_client.Bios.GetSigSha('b'),
- 'FVMAINB': self.faft_client.Bios.GetBodySha('b'),
+ 'VBOOTA': self.faft_client.bios.get_sig_sha('a'),
+ 'FVMAINA': self.faft_client.bios.get_body_sha('a'),
+ 'VBOOTB': self.faft_client.bios.get_sig_sha('b'),
+ 'FVMAINB': self.faft_client.bios.get_body_sha('b'),
}
if not all(current_checksums.values()):
raise error.TestError(
'Failed to get firmware sha: %s', current_checksums)
current_fwids = {
- 'RO_FRID': self.faft_client.Bios.GetSectionFwid('ro'),
- 'RW_FWID_A': self.faft_client.Bios.GetSectionFwid('a'),
- 'RW_FWID_B': self.faft_client.Bios.GetSectionFwid('b'),
+ 'RO_FRID': self.faft_client.bios.get_section_fwid('ro'),
+ 'RW_FWID_A': self.faft_client.bios.get_section_fwid('a'),
+ 'RW_FWID_B': self.faft_client.bios.get_section_fwid('b'),
}
if not all(current_fwids.values()):
raise error.TestError(
@@ -1393,7 +1394,7 @@
@return: True if it is changed, otherwise False.
"""
# Device may not be rebooted after test.
- self.faft_client.Bios.Reload()
+ self.faft_client.bios.reload()
current_info = self.get_current_firmware_identity()
prev_info = self._backup_firmware_identity
@@ -1414,15 +1415,15 @@
@param suffix: a string appended to backup file name
"""
- remote_temp_dir = self.faft_client.System.CreateTempDir()
+ remote_temp_dir = self.faft_client.system.create_temp_dir()
remote_bios_path = os.path.join(remote_temp_dir, 'bios')
- self.faft_client.Bios.DumpWhole(remote_bios_path)
+ self.faft_client.bios.dump_whole(remote_bios_path)
self._client.get_file(remote_bios_path,
os.path.join(self.resultsdir, 'bios' + suffix))
if self.faft_config.chrome_ec:
remote_ec_path = os.path.join(remote_temp_dir, 'ec')
- self.faft_client.Ec.DumpWhole(remote_ec_path)
+ self.faft_client.ec.dump_whole(remote_ec_path)
self._client.get_file(remote_ec_path,
os.path.join(self.resultsdir, 'ec' + suffix))
@@ -1457,17 +1458,17 @@
self.backup_firmware(suffix='.corrupt')
# Restore firmware.
- remote_temp_dir = self.faft_client.System.CreateTempDir()
+ remote_temp_dir = self.faft_client.system.create_temp_dir()
self._client.send_file(os.path.join(self.resultsdir, 'bios' + suffix),
os.path.join(remote_temp_dir, 'bios'))
- self.faft_client.Bios.WriteWhole(
+ self.faft_client.bios.write_whole(
os.path.join(remote_temp_dir, 'bios'))
if self.faft_config.chrome_ec and restore_ec:
self._client.send_file(os.path.join(self.resultsdir, 'ec' + suffix),
os.path.join(remote_temp_dir, 'ec'))
- self.faft_client.Ec.WriteWhole(
+ self.faft_client.ec.write_whole(
os.path.join(remote_temp_dir, 'ec'))
self.switcher.mode_aware_reboot()
@@ -1491,28 +1492,28 @@
if is_shellball:
logging.info('Device will update firmware with shellball %s',
shellball)
- temp_path = self.faft_client.Updater.GetTempPath()
+ temp_path = self.faft_client.updater.get_temp_path()
working_shellball = os.path.join(temp_path,
'chromeos-firmwareupdate')
self._client.send_file(shellball, working_shellball)
- self.faft_client.Updater.ExtractShellball()
+ self.faft_client.updater.extract_shellball()
else:
raise error.TestFail(
'The given shellball is not a shell script.')
else:
logging.info('No shellball given, use the original shellball and '
'replace its BIOS and EC images.')
- work_path = self.faft_client.Updater.GetWorkPath()
+ work_path = self.faft_client.updater.get_work_path()
bios_in_work_path = os.path.join(
- work_path, self.faft_client.Updater.GetBiosRelativePath())
+ work_path, self.faft_client.updater.get_bios_relative_path())
ec_in_work_path = os.path.join(
- work_path, self.faft_client.Updater.GetEcRelativePath())
+ work_path, self.faft_client.updater.get_ec_relative_path())
logging.info('Writing current BIOS to: %s', bios_in_work_path)
- self.faft_client.Bios.DumpWhole(bios_in_work_path)
+ self.faft_client.bios.dump_whole(bios_in_work_path)
if self.faft_config.chrome_ec:
logging.info('Writing current EC to: %s', ec_in_work_path)
- self.faft_client.Ec.DumpFirmware(ec_in_work_path)
- self.faft_client.Updater.RepackShellball()
+ self.faft_client.ec.dump_firmware(ec_in_work_path)
+ self.faft_client.updater.repack_shellball()
def is_kernel_changed(self):
"""Check if the current kernel is changed, by comparing its SHA1 hash.
@@ -1522,7 +1523,7 @@
changed = False
for p in ('A', 'B'):
backup_sha = self._backup_kernel_sha.get(p, None)
- current_sha = self.faft_client.Kernel.GetSha(p)
+ current_sha = self.faft_client.kernel.get_sha(p)
if backup_sha != current_sha:
changed = True
logging.info('Kernel %s is changed', p)
@@ -1533,14 +1534,14 @@
@param suffix: a string appended to backup file name.
"""
- remote_temp_dir = self.faft_client.System.CreateTempDir()
+ remote_temp_dir = self.faft_client.system.create_temp_dir()
for p in ('A', 'B'):
remote_path = os.path.join(remote_temp_dir, 'kernel_%s' % p)
- self.faft_client.Kernel.Dump(p, remote_path)
+ self.faft_client.kernel.dump(p, remote_path)
self._client.get_file(
remote_path,
os.path.join(self.resultsdir, 'kernel_%s%s' % (p, suffix)))
- self._backup_kernel_sha[p] = self.faft_client.Kernel.GetSha(p)
+ self._backup_kernel_sha[p] = self.faft_client.kernel.get_sha(p)
logging.info('Backup kernel stored in %s with suffix %s',
self.resultsdir, suffix)
@@ -1567,30 +1568,30 @@
self.backup_kernel(suffix='.corrupt')
# Restore kernel.
- remote_temp_dir = self.faft_client.System.CreateTempDir()
+ remote_temp_dir = self.faft_client.system.create_temp_dir()
for p in ('A', 'B'):
remote_path = os.path.join(remote_temp_dir, 'kernel_%s' % p)
self._client.send_file(
os.path.join(self.resultsdir, 'kernel_%s%s' % (p, suffix)),
remote_path)
- self.faft_client.Kernel.Write(p, remote_path)
+ self.faft_client.kernel.write(p, remote_path)
self.switcher.mode_aware_reboot()
logging.info('Successfully restored kernel.')
def backup_cgpt_attributes(self):
"""Backup CGPT partition table attributes."""
- self._backup_cgpt_attr = self.faft_client.Cgpt.GetAttributes()
+ self._backup_cgpt_attr = self.faft_client.cgpt.get_attributes()
def restore_cgpt_attributes(self):
"""Restore CGPT partition table attributes."""
- current_table = self.faft_client.Cgpt.GetAttributes()
+ current_table = self.faft_client.cgpt.get_attributes()
if current_table == self._backup_cgpt_attr:
return
logging.info('CGPT table is changed. Original: %r. Current: %r.',
self._backup_cgpt_attr,
current_table)
- self.faft_client.Cgpt.SetAttributes(
+ self.faft_client.cgpt.set_attributes(
self._backup_cgpt_attr['A'], self._backup_cgpt_attr['B'])
self.switcher.mode_aware_reboot()
@@ -1606,12 +1607,12 @@
fwb_tries(vb1)/fw_try_next(vb2)
"""
if self.fw_vboot2:
- self.faft_client.System.SetFwTryNext('B', count)
+ self.faft_client.system.set_fw_try_next('B', count)
else:
# vboot1: we need to boot into fwb at least once
if not count:
count = count + 1
- self.faft_client.System.SetTryFwB(count)
+ self.faft_client.system.set_try_fw_b(count)
def identify_shellball(self, include_ec=None):
"""Get the FWIDs of all targets and sections in the shellball
@@ -1621,7 +1622,7 @@
@return: the dict of versions in the shellball
"""
fwids = dict()
- fwids['bios'] = self.faft_client.Updater.GetAllFwids('bios')
+ fwids['bios'] = self.faft_client.updater.get_all_fwids('bios')
if include_ec is None:
if self.faft_config.platform == 'Samus':
@@ -1630,7 +1631,7 @@
include_ec = self.faft_config.chrome_ec
if include_ec:
- fwids['ec'] = self.faft_client.Updater.GetAllFwids('ec')
+ fwids['ec'] = self.faft_client.updater.get_all_fwids('ec')
return fwids
def modify_shellball(self, append, modify_ro=True, modify_ec=False):
@@ -1640,17 +1641,17 @@
"""
if modify_ro:
- self.faft_client.Updater.ModifyFwids('bios', ['ro', 'a', 'b'])
+ self.faft_client.updater.modify_fwids('bios', ['ro', 'a', 'b'])
else:
- self.faft_client.Updater.ModifyFwids('bios', ['a', 'b'])
+ self.faft_client.updater.modify_fwids('bios', ['a', 'b'])
if modify_ec:
if modify_ro:
- self.faft_client.Updater.ModifyFwids('ec', ['ro', 'rw'])
+ self.faft_client.updater.modify_fwids('ec', ['ro', 'rw'])
else:
- self.faft_client.Updater.ModifyFwids('ec', ['rw'])
+ self.faft_client.updater.modify_fwids('ec', ['rw'])
- modded_shellball = self.faft_client.Updater.RepackShellball(append)
+ modded_shellball = self.faft_client.updater.repack_shellball(append)
return modded_shellball
diff --git a/server/cros/faft/rpc_proxy.pyi b/server/cros/faft/rpc_proxy.pyi
index 00158f7..a09a746 100644
--- a/server/cros/faft/rpc_proxy.pyi
+++ b/server/cros/faft/rpc_proxy.pyi
@@ -8,12 +8,12 @@
that are available on RPCProxy via __getattr__.
"""
- Bios: rpc_functions.BiosServicer
- Cgpt: rpc_functions.CgptServicer
- Ec: rpc_functions.EcServicer
- Kernel: rpc_functions.KernelServicer
- Rootfs: rpc_functions.RootfsServicer
- RpcSettings: rpc_functions.RpcSettingsServicer
- System: rpc_functions.SystemServicer
- Tpm: rpc_functions.TpmServicer
- Updater: rpc_functions.UpdaterServicer
+ bios: rpc_functions.BiosServicer
+ cgpt: rpc_functions.CgptServicer
+ ec: rpc_functions.EcServicer
+ kernel: rpc_functions.KernelServicer
+ rootfs: rpc_functions.RootfsServicer
+ rpc_settings: rpc_functions.RpcSettingsServicer
+ system: rpc_functions.SystemServicer
+ tpm: rpc_functions.TpmServicer
+ updater: rpc_functions.UpdaterServicer
diff --git a/server/cros/faft/utils/faft_checkers.py b/server/cros/faft/utils/faft_checkers.py
index 3b74c05..683d95b 100644
--- a/server/cros/faft/utils/faft_checkers.py
+++ b/server/cros/faft/utils/faft_checkers.py
@@ -16,7 +16,7 @@
self.faft_framework = faft_framework
self.faft_client = faft_framework.faft_client
self.faft_config = faft_framework.faft_config
- self.fw_vboot2 = self.faft_client.System.GetFwVboot2()
+ self.fw_vboot2 = self.faft_client.system.get_fw_vboot2()
def _parse_crossystem_output(self, lines):
"""Parse the crossystem output into a dict.
@@ -69,7 +69,7 @@
@return: True if the crossystem value matched; otherwise, False.
"""
succeed = True
- lines = self.faft_client.System.RunShellCommandGetOutput(
+ lines = self.faft_client.system.run_shell_command_get_output(
'crossystem')
got_dict = self._parse_crossystem_output(lines)
for key in expected_dict:
@@ -176,7 +176,7 @@
@param value: An expected value.
@return: True if the flags matched; otherwise, False.
"""
- lines = self.faft_client.System.RunShellCommandGetOutput(
+ lines = self.faft_client.system.run_shell_command_get_output(
'crossystem vdat_flags')
vdat_flags = int(lines[0], 16)
if vdat_flags & mask != value:
@@ -206,7 +206,7 @@
return (self.crossystem_checker({'mainfw_type': 'developer',
'kernkey_vfy':
expected_kernkey_vfy}) and
- self.faft_client.System.IsRemovableDeviceBoot() ==
+ self.faft_client.system.is_removable_device_boot() ==
dev_boot_usb)
def root_part_checker(self, expected_part):
@@ -217,7 +217,7 @@
@return: True if the currect root partition number matched;
otherwise, False.
"""
- part = self.faft_client.System.GetRootPart()[-1]
+ part = self.faft_client.system.get_root_part()[-1]
if self.faft_framework.ROOTFS_MAP[expected_part] != part:
logging.info("Expected root part %s but got %s",
self.faft_framework.ROOTFS_MAP[expected_part], part)
@@ -232,7 +232,7 @@
@return: True if the current EC running copy matches; otherwise, False.
"""
cmd = 'ectool version'
- lines = self.faft_client.System.RunShellCommandGetOutput(cmd)
+ lines = self.faft_client.system.run_shell_command_get_output(cmd)
pattern = re.compile("Firmware copy: (.*)")
for line in lines:
matched = pattern.match(line)
diff --git a/server/cros/faft/utils/mode_switcher.py b/server/cros/faft/utils/mode_switcher.py
index 0bcf370..8fb92c0 100644
--- a/server/cros/faft/utils/mode_switcher.py
+++ b/server/cros/faft/utils/mode_switcher.py
@@ -654,9 +654,9 @@
logging.warning("-[FAFT]-[ system did not respond to ping ]")
if self.client_host.wait_up(timeout):
# Check the FAFT client is avaiable.
- self.faft_client.System.IsAvailable()
+ self.faft_client.system.is_available()
# Stop update-engine as it may change firmware/kernel.
- self.faft_framework.faft_client.Updater.StopDaemon()
+ self.faft_framework.faft_client.updater.stop_daemon()
else:
logging.error('wait_for_client() timed out.')
raise ConnectionError('DUT is still down unexpectedly')
diff --git a/server/site_tests/firmware_BaseECKeyboard/firmware_BaseECKeyboard.py b/server/site_tests/firmware_BaseECKeyboard/firmware_BaseECKeyboard.py
index f1155b6..c9ba847 100644
--- a/server/site_tests/firmware_BaseECKeyboard/firmware_BaseECKeyboard.py
+++ b/server/site_tests/firmware_BaseECKeyboard/firmware_BaseECKeyboard.py
@@ -40,7 +40,7 @@
def cleanup(self):
# Restart UI anyway, in case the test failed in the middle
try:
- self.faft_client.System.RunShellCommand('start ui | true')
+ self.faft_client.system.run_shell_command('start ui | true')
except Exception as e:
logging.error("Caught exception: %s", str(e))
super(firmware_BaseECKeyboard, self).cleanup()
@@ -56,7 +56,7 @@
True if passed; or False if failed.
"""
# Stop UI so that key presses don't go to Chrome.
- self.faft_client.System.RunShellCommand('stop ui')
+ self.faft_client.system.run_shell_command('stop ui')
# Start a thread to perform the key-press action
Timer(self.KEY_PRESS_DELAY, press_action).start()
@@ -64,13 +64,13 @@
# Invoke client side script to monitor keystrokes.
# The codes are linux input event codes.
# The order doesn't matter.
- result = self.faft_client.System.CheckKeys([
+ result = self.faft_client.system.check_keys([
linux_input.KEY_ENTER,
linux_input.KEY_LEFTCTRL,
linux_input.KEY_D])
# Turn UI back on
- self.faft_client.System.RunShellCommand('start ui')
+ self.faft_client.system.run_shell_command('start ui')
time.sleep(self.START_UI_DELAY)
return result
diff --git a/server/site_tests/firmware_Bmpblk/firmware_Bmpblk.py b/server/site_tests/firmware_Bmpblk/firmware_Bmpblk.py
index ef2501f..c97844b 100644
--- a/server/site_tests/firmware_Bmpblk/firmware_Bmpblk.py
+++ b/server/site_tests/firmware_Bmpblk/firmware_Bmpblk.py
@@ -23,8 +23,8 @@
def run_once(self):
"""Runs a single iteration of the test."""
- self.faft_client.Bios.DumpWhole(BIOS_PATH)
- layout = self.faft_client.System.RunShellCommandGetOutput(
+ self.faft_client.bios.dump_whole(BIOS_PATH)
+ layout = self.faft_client.system.run_shell_command_get_output(
LAYOUT_CBFS_CMD)
layout = '\n'.join(layout)
logging.debug('cbfstool layout output:\n\n%s', layout)
@@ -32,7 +32,7 @@
if 'BOOT_STUB' in layout:
print_cbfs_cmd_options=' -r BOOT_STUB'
try:
- files = self.faft_client.System.RunShellCommandGetOutput(
+ files = self.faft_client.system.run_shell_command_get_output(
PRINT_CBFS_CMD + print_cbfs_cmd_options)
files = '\n'.join(files)
logging.debug('cbfstool print output:\n\n%s', files)
@@ -52,4 +52,4 @@
"will ship with!")
raise error.TestFail('bmpblk images not scaled for this board')
finally:
- self.faft_client.System.RemoveFile(BIOS_PATH)
+ self.faft_client.system.remove_file(BIOS_PATH)
diff --git a/server/site_tests/firmware_ChipFwUpdate/firmware_ChipFwUpdate.py b/server/site_tests/firmware_ChipFwUpdate/firmware_ChipFwUpdate.py
index 13ee0c2..a443b25 100644
--- a/server/site_tests/firmware_ChipFwUpdate/firmware_ChipFwUpdate.py
+++ b/server/site_tests/firmware_ChipFwUpdate/firmware_ChipFwUpdate.py
@@ -110,8 +110,8 @@
Creates a fresh temp. dir for cbfstool to manipulate bios.bin.
"""
- cbfs_path = self.faft_client.Updater.CbfsSetupWorkDir()
- bios_relative_path = self.faft_client.Updater.GetBiosRelativePath()
+ cbfs_path = self.faft_client.updater.cbfs_setup_work_dir()
+ bios_relative_path = self.faft_client.updater.get_bios_relative_path()
self.cbfs_work_dir = cbfs_path
self.dut_bios_path = os.path.join(cbfs_path, bios_relative_path)
@@ -127,12 +127,12 @@
logging.info('checking for %s firmware in %s',
chip.chip_name, self.BIOS)
- if not self.faft_client.Updater.CbfsExtractChip(chip.fw_name):
+ if not self.faft_client.updater.cbfs_extract_chip(chip.fw_name):
logging.warning('%s firmware not bundled in %s',
chip.chip_name, self.BIOS)
continue
- hashblob = self.faft_client.Updater.CbfsGetChipHash(
+ hashblob = self.faft_client.updater.cbfs_get_chip_hash(
chip.fw_name)
if not hashblob:
logging.warning('%s firmware hash not extracted from %s',
@@ -183,7 +183,7 @@
self.cbfs_work_dir,
fw_update.cbfs_bin_name))
- if not self.faft_client.Updater.CbfsReplaceChip(
+ if not self.faft_client.updater.cbfs_replace_chip(
fw_update.fw_name):
raise error.TestFail('could not replace %s blobs in cbfs' %
fw_update.chip_name)
@@ -195,7 +195,7 @@
host: host handle to the DUT.
"""
- if not self.faft_client.Updater.CbfsSignAndFlash():
+ if not self.faft_client.updater.cbfs_sign_and_flash():
raise error.TestFail('could not re-sign %s' % self.dut_bios_path)
host.reboot()
diff --git a/server/site_tests/firmware_ClearTPMOwnerAndReset/firmware_ClearTPMOwnerAndReset.py b/server/site_tests/firmware_ClearTPMOwnerAndReset/firmware_ClearTPMOwnerAndReset.py
index 553dc31..644f193 100644
--- a/server/site_tests/firmware_ClearTPMOwnerAndReset/firmware_ClearTPMOwnerAndReset.py
+++ b/server/site_tests/firmware_ClearTPMOwnerAndReset/firmware_ClearTPMOwnerAndReset.py
@@ -37,5 +37,5 @@
self.check_state((self.checkers.crossystem_checker,
{'mainfw_type': 'normal'}))
- if not self.faft_client.System.DevTpmPresent():
+ if not self.faft_client.system.dev_tpm_present():
raise error.TestError('/dev/tpm0 does not exist on the client')
diff --git a/server/site_tests/firmware_CompareChipFwToShellBall/firmware_CompareChipFwToShellBall.py b/server/site_tests/firmware_CompareChipFwToShellBall/firmware_CompareChipFwToShellBall.py
index b700217..eb06cd5 100644
--- a/server/site_tests/firmware_CompareChipFwToShellBall/firmware_CompareChipFwToShellBall.py
+++ b/server/site_tests/firmware_CompareChipFwToShellBall/firmware_CompareChipFwToShellBall.py
@@ -45,7 +45,7 @@
def cleanup(self):
try:
if self.cbfs_work_dir:
- self.faft_client.System.RemoveDir(self.cbfs_work_dir)
+ self.faft_client.system.remove_dir(self.cbfs_work_dir)
except Exception as e:
logging.error("Caught exception: %s", str(e))
super(firmware_CompareChipFwToShellBall, self).cleanup()
@@ -61,7 +61,7 @@
"""
cmd = 'mosys -s product_id pd chip %d' % port
- chip_id = self.faft_client.System.RunShellCommandGetOutput(cmd)
+ chip_id = self.faft_client.system.run_shell_command_get_output(cmd)
if not chip_id:
# chip probably does not exist
return None
@@ -73,7 +73,7 @@
chip = chip_utils.chip_id_map[chip_id]()
cmd = 'mosys -s fw_version pd chip %d' % port
- fw_rev = self.faft_client.System.RunShellCommandGetOutput(cmd)
+ fw_rev = self.faft_client.system.run_shell_command_get_output(cmd)
if not fw_rev:
# chip probably does not exist
return None
@@ -115,8 +115,8 @@
Full path of bios.bin on DUT.
"""
- work_path = self.faft_client.Updater.GetWorkPath()
- bios_relative_path = self.faft_client.Updater.GetBiosRelativePath()
+ work_path = self.faft_client.updater.get_work_path()
+ bios_relative_path = self.faft_client.updater.get_bios_relative_path()
bios_bin = os.path.join(work_path, bios_relative_path)
return bios_bin
@@ -128,8 +128,8 @@
and used instead of the native bios.bin.
"""
- cbfs_path = self.faft_client.Updater.CbfsSetupWorkDir()
- bios_relative_path = self.faft_client.Updater.GetBiosRelativePath()
+ cbfs_path = self.faft_client.updater.cbfs_setup_work_dir()
+ bios_relative_path = self.faft_client.updater.get_bios_relative_path()
self.cbfs_work_dir = cbfs_path
self.dut_bios_path = os.path.join(cbfs_path, bios_relative_path)
@@ -157,12 +157,12 @@
# must be an unfamiliar chip
continue
- if not self.faft_client.Updater.CbfsExtractChip(chip.fw_name):
+ if not self.faft_client.updater.cbfs_extract_chip(chip.fw_name):
logging.warning('%s firmware not bundled in %s',
chip.chip_name, self.BIOS)
continue
- hashblob = self.faft_client.Updater.CbfsGetChipHash(
+ hashblob = self.faft_client.updater.cbfs_get_chip_hash(
chip.fw_name)
if not hashblob:
logging.warning('%s firmware hash not extracted from %s',
diff --git a/server/site_tests/firmware_CorruptBothFwBodyAB/firmware_CorruptBothFwBodyAB.py b/server/site_tests/firmware_CorruptBothFwBodyAB/firmware_CorruptBothFwBodyAB.py
index 4675950..ce0c04f 100644
--- a/server/site_tests/firmware_CorruptBothFwBodyAB/firmware_CorruptBothFwBodyAB.py
+++ b/server/site_tests/firmware_CorruptBothFwBodyAB/firmware_CorruptBothFwBodyAB.py
@@ -40,8 +40,8 @@
self.check_state((self.checkers.crossystem_checker, {
'mainfw_type': 'developer' if dev_mode else 'normal',
}))
- self.faft_client.Bios.CorruptBody('a')
- self.faft_client.Bios.CorruptBody('b')
+ self.faft_client.bios.corrupt_body('a')
+ self.faft_client.bios.corrupt_body('b')
# Older devices (without BROKEN screen) didn't wait for removal in
# dev mode. Make sure the USB key is not plugged in so they won't
@@ -58,8 +58,8 @@
(vboot.RECOVERY_REASON['RO_INVALID_RW'],
vboot.RECOVERY_REASON['RW_VERIFY_BODY']),
}))
- self.faft_client.Bios.RestoreBody('a')
- self.faft_client.Bios.RestoreBody('b')
+ self.faft_client.bios.restore_body('a')
+ self.faft_client.bios.restore_body('b')
self.switcher.mode_aware_reboot()
logging.info("Expected normal boot, done.")
diff --git a/server/site_tests/firmware_CorruptBothFwSigAB/firmware_CorruptBothFwSigAB.py b/server/site_tests/firmware_CorruptBothFwSigAB/firmware_CorruptBothFwSigAB.py
index 6b243c0..1dbdf0f 100644
--- a/server/site_tests/firmware_CorruptBothFwSigAB/firmware_CorruptBothFwSigAB.py
+++ b/server/site_tests/firmware_CorruptBothFwSigAB/firmware_CorruptBothFwSigAB.py
@@ -42,8 +42,8 @@
self.check_state((self.checkers.crossystem_checker, {
'mainfw_type': 'developer' if dev_mode else 'normal',
}))
- self.faft_client.Bios.CorruptSig('a')
- self.faft_client.Bios.CorruptSig('b')
+ self.faft_client.bios.corrupt_sig('a')
+ self.faft_client.bios.corrupt_sig('b')
# Older devices (without BROKEN screen) didn't wait for removal in
# dev mode. Make sure the USB key is not plugged in so they won't
@@ -60,7 +60,7 @@
vboot.RECOVERY_REASON['RO_INVALID_RW'],
vboot.RECOVERY_REASON['RW_VERIFY_KEYBLOCK']),
}))
- self.faft_client.System.SetTryFwB()
+ self.faft_client.system.set_try_fw_b()
self.servo.switch_usbkey('host')
self.switcher.simple_reboot(sync_before_boot=False)
@@ -74,8 +74,8 @@
vboot.RECOVERY_REASON['RO_INVALID_RW'],
vboot.RECOVERY_REASON['RW_VERIFY_KEYBLOCK']),
}))
- self.faft_client.Bios.RestoreSig('a')
- self.faft_client.Bios.RestoreSig('b')
+ self.faft_client.bios.restore_sig('a')
+ self.faft_client.bios.restore_sig('b')
self.switcher.mode_aware_reboot()
logging.info("Expected normal boot, done.")
diff --git a/server/site_tests/firmware_CorruptBothKernelAB/firmware_CorruptBothKernelAB.py b/server/site_tests/firmware_CorruptBothKernelAB/firmware_CorruptBothKernelAB.py
index aafbeb9..d0b8acc 100644
--- a/server/site_tests/firmware_CorruptBothKernelAB/firmware_CorruptBothKernelAB.py
+++ b/server/site_tests/firmware_CorruptBothKernelAB/firmware_CorruptBothKernelAB.py
@@ -31,7 +31,7 @@
"""
if not self.check_root_part_on_non_recovery(part):
logging.info('Recover the disk OS by running chromeos-install...')
- self.faft_client.System.RunShellCommand('chromeos-install --yes')
+ self.faft_client.system.run_shell_command('chromeos-install --yes')
self.switcher.mode_aware_reboot()
def initialize(self, host, cmdline_args, dev_mode=False):
@@ -61,8 +61,8 @@
logging.info("Corrupt kernel A and B.")
self.check_state((self.check_root_part_on_non_recovery, 'a'))
- self.faft_client.Kernel.CorruptSig('a')
- self.faft_client.Kernel.CorruptSig('b')
+ self.faft_client.kernel.corrupt_sig('a')
+ self.faft_client.kernel.corrupt_sig('b')
# Older devices (without BROKEN screen) didn't wait for removal in
# dev mode. Make sure the USB key is not plugged in so they won't
@@ -77,8 +77,8 @@
'mainfw_type': 'recovery',
'recovery_reason': recovery_reason,
}))
- self.faft_client.Kernel.RestoreSig('a')
- self.faft_client.Kernel.RestoreSig('b')
+ self.faft_client.kernel.restore_sig('a')
+ self.faft_client.kernel.restore_sig('b')
self.switcher.mode_aware_reboot()
logging.info("Expected kernel A normal/dev boot.")
diff --git a/server/site_tests/firmware_CorruptFwBodyA/firmware_CorruptFwBodyA.py b/server/site_tests/firmware_CorruptFwBodyA/firmware_CorruptFwBodyA.py
index 34bfa14..af6e70e 100644
--- a/server/site_tests/firmware_CorruptFwBodyA/firmware_CorruptFwBodyA.py
+++ b/server/site_tests/firmware_CorruptFwBodyA/firmware_CorruptFwBodyA.py
@@ -34,14 +34,14 @@
"""Runs a single iteration of the test."""
logging.info("Corrupt firmware body A.")
self.check_state((self.checkers.fw_tries_checker, 'A'))
- self.faft_client.Bios.CorruptBody('a')
+ self.faft_client.bios.corrupt_body('a')
self.switcher.mode_aware_reboot()
logging.info("Expected firmware B boot and restore firmware A.")
self.check_state((self.checkers.fw_tries_checker, ('B', False)))
- self.faft_client.Bios.RestoreBody('a')
+ self.faft_client.bios.restore_body('a')
self.switcher.mode_aware_reboot()
expected_slot = 'B' if self.fw_vboot2 else 'A'
- logging.info("Expected firmware " + expected_slot + " boot, done.")
+ logging.info("Expected firmware %s boot, done", expected_slot)
self.check_state((self.checkers.fw_tries_checker, expected_slot))
diff --git a/server/site_tests/firmware_CorruptFwBodyB/firmware_CorruptFwBodyB.py b/server/site_tests/firmware_CorruptFwBodyB/firmware_CorruptFwBodyB.py
index 0fe011a..2de2de4 100644
--- a/server/site_tests/firmware_CorruptFwBodyB/firmware_CorruptFwBodyB.py
+++ b/server/site_tests/firmware_CorruptFwBodyB/firmware_CorruptFwBodyB.py
@@ -37,11 +37,11 @@
def run_once(self):
"""Runs a single iteration of the test."""
- RO_enabled = (self.faft_client.Bios.GetPreambleFlags('b') &
+ RO_enabled = (self.faft_client.bios.get_preamble_flags('b') &
vboot.PREAMBLE_USE_RO_NORMAL)
logging.info("Corrupt firmware body B.")
self.check_state((self.checkers.fw_tries_checker, 'A'))
- self.faft_client.Bios.CorruptBody('b')
+ self.faft_client.bios.corrupt_body('b')
self.switcher.mode_aware_reboot()
logging.info("Expected firmware A boot and set try_fwb flag.")
@@ -55,7 +55,7 @@
self.check_state((self.checkers.fw_tries_checker, 'B'))
else:
self.check_state((self.checkers.fw_tries_checker, ('A', False)))
- self.faft_client.Bios.RestoreBody('b')
+ self.faft_client.bios.restore_body('b')
self.switcher.mode_aware_reboot()
logging.info("Final check and done.")
diff --git a/server/site_tests/firmware_CorruptFwSigA/firmware_CorruptFwSigA.py b/server/site_tests/firmware_CorruptFwSigA/firmware_CorruptFwSigA.py
index b344d68..1443431 100644
--- a/server/site_tests/firmware_CorruptFwSigA/firmware_CorruptFwSigA.py
+++ b/server/site_tests/firmware_CorruptFwSigA/firmware_CorruptFwSigA.py
@@ -32,7 +32,7 @@
"""Runs a single iteration of the test."""
logging.info("Corrupt firmware signature A.")
self.check_state((self.checkers.fw_tries_checker, 'A'))
- self.faft_client.Bios.CorruptSig('a')
+ self.faft_client.bios.corrupt_sig('a')
self.switcher.mode_aware_reboot()
logging.info("Expected firmware B boot and set fwb_tries flag.")
@@ -43,9 +43,9 @@
logging.info("Still expected firmware B boot and restore firmware A.")
self.check_state((self.checkers.fw_tries_checker, 'B'))
- self.faft_client.Bios.RestoreSig('a')
+ self.faft_client.bios.restore_sig('a')
self.switcher.mode_aware_reboot()
expected_slot = 'B' if self.fw_vboot2 else 'A'
- logging.info("Expected firmware " + expected_slot + " boot, done.")
+ logging.info("Expected firmware %s boot, done.", expected_slot)
self.check_state((self.checkers.fw_tries_checker, expected_slot))
diff --git a/server/site_tests/firmware_CorruptFwSigB/firmware_CorruptFwSigB.py b/server/site_tests/firmware_CorruptFwSigB/firmware_CorruptFwSigB.py
index 37bb04f..a84f088 100644
--- a/server/site_tests/firmware_CorruptFwSigB/firmware_CorruptFwSigB.py
+++ b/server/site_tests/firmware_CorruptFwSigB/firmware_CorruptFwSigB.py
@@ -33,7 +33,7 @@
logging.info("Expected firmware A boot and corrupt "
"firmware signature B.")
self.check_state((self.checkers.fw_tries_checker, 'A'))
- self.faft_client.Bios.CorruptSig('b')
+ self.faft_client.bios.corrupt_sig('b')
self.switcher.mode_aware_reboot()
logging.info("Expected firmware A boot and set try_fwb flag.")
@@ -43,7 +43,7 @@
logging.info("Expected firmware A boot and restore firmware B.")
self.check_state((self.checkers.fw_tries_checker, ('A', False)))
- self.faft_client.Bios.RestoreSig('b')
+ self.faft_client.bios.restore_sig('b')
self.switcher.mode_aware_reboot()
logging.info("Final check and done.")
diff --git a/server/site_tests/firmware_CorruptKernelA/firmware_CorruptKernelA.py b/server/site_tests/firmware_CorruptKernelA/firmware_CorruptKernelA.py
index 3d6a1c1..4034494 100644
--- a/server/site_tests/firmware_CorruptKernelA/firmware_CorruptKernelA.py
+++ b/server/site_tests/firmware_CorruptKernelA/firmware_CorruptKernelA.py
@@ -36,12 +36,12 @@
"""Runs a single iteration of the test."""
logging.info("Corrupt kernel A.")
self.check_state((self.checkers.root_part_checker, 'a'))
- self.faft_client.Kernel.CorruptSig('a')
+ self.faft_client.kernel.corrupt_sig('a')
self.switcher.mode_aware_reboot()
logging.info("Expected kernel B boot and restore kernel A.")
self.check_state((self.checkers.root_part_checker, 'b'))
- self.faft_client.Kernel.RestoreSig('a')
+ self.faft_client.kernel.restore_sig('a')
self.switcher.mode_aware_reboot()
logging.info("Expected kernel A boot.")
diff --git a/server/site_tests/firmware_CorruptKernelB/firmware_CorruptKernelB.py b/server/site_tests/firmware_CorruptKernelB/firmware_CorruptKernelB.py
index f197f0b..25fef85 100644
--- a/server/site_tests/firmware_CorruptKernelB/firmware_CorruptKernelB.py
+++ b/server/site_tests/firmware_CorruptKernelB/firmware_CorruptKernelB.py
@@ -42,12 +42,12 @@
logging.info("Expected kernel B boot and corrupt kernel B.")
self.check_state((self.checkers.root_part_checker, 'b'))
- self.faft_client.Kernel.CorruptSig('b')
+ self.faft_client.kernel.corrupt_sig('b')
self.switcher.mode_aware_reboot()
logging.info("Expected kernel A boot and restore kernel B.")
self.check_state((self.checkers.root_part_checker, 'a'))
- self.faft_client.Kernel.RestoreSig('b')
+ self.faft_client.kernel.restore_sig('b')
self.switcher.mode_aware_reboot()
logging.info("Expected kernel B boot and prioritize kerenl A.")
diff --git a/server/site_tests/firmware_CorruptRecoveryCache/firmware_CorruptRecoveryCache.py b/server/site_tests/firmware_CorruptRecoveryCache/firmware_CorruptRecoveryCache.py
index b9a1fd5..4a158a4 100644
--- a/server/site_tests/firmware_CorruptRecoveryCache/firmware_CorruptRecoveryCache.py
+++ b/server/site_tests/firmware_CorruptRecoveryCache/firmware_CorruptRecoveryCache.py
@@ -45,7 +45,7 @@
@return True if cache exists
"""
logging.info("Checking if device has RECOVERY_MRC_CACHE")
- return self.faft_client.System.RunShellCommandCheckOutput(
+ return self.faft_client.system.run_shell_command_check_output(
self.FMAP_CMD, self.RECOVERY_CACHE_SECTION)
def check_cache_rebuilt(self):
@@ -55,7 +55,7 @@
@return True if cache rebuilt otherwise false
"""
logging.info("Checking if cache was rebuilt.")
- return self.faft_client.System.RunShellCommandCheckOutput(
+ return self.faft_client.system.run_shell_command_check_output(
self.FIRMWARE_LOG_CMD, self.REBUILD_CACHE_MSG)
def boot_to_recovery(self):
@@ -72,7 +72,7 @@
if not self.cache_exist():
raise error.TestNAError('No RECOVERY_MRC_CACHE was found on DUT.')
- self.faft_client.Bios.CorruptBody('rec', True)
+ self.faft_client.bios.corrupt_body('rec', True)
self.boot_to_recovery()
if not self.check_cache_rebuilt():
diff --git a/server/site_tests/firmware_Cr50DeviceState/firmware_Cr50DeviceState.py b/server/site_tests/firmware_Cr50DeviceState/firmware_Cr50DeviceState.py
index 3571b4e..9d46f0a 100644
--- a/server/site_tests/firmware_Cr50DeviceState/firmware_Cr50DeviceState.py
+++ b/server/site_tests/firmware_Cr50DeviceState/firmware_Cr50DeviceState.py
@@ -363,7 +363,7 @@
full_command = 'echo mem > /sys/power/state &'
elif state == 'G3':
full_command = 'poweroff'
- self.faft_client.System.RunShellCommand(full_command)
+ self.faft_client.system.run_shell_command(full_command)
self.stage_irq_add(self.get_irq_counts(), 'cmd done')
time.sleep(self.SHORT_WAIT);
diff --git a/server/site_tests/firmware_Cr50RddG3/firmware_Cr50RddG3.py b/server/site_tests/firmware_Cr50RddG3/firmware_Cr50RddG3.py
index bd581d8..aee03c9 100644
--- a/server/site_tests/firmware_Cr50RddG3/firmware_Cr50RddG3.py
+++ b/server/site_tests/firmware_Cr50RddG3/firmware_Cr50RddG3.py
@@ -36,7 +36,7 @@
if self.rdd_is_connected():
raise error.TestFail('Cr50 detects Rdd with dts mode off')
- self.faft_client.System.RunShellCommand('poweroff')
+ self.faft_client.system.run_shell_command('poweroff')
time.sleep(self.WAIT_FOR_STATE)
self.ec.send_command('hibernate')
diff --git a/server/site_tests/firmware_Cr50WPG3/firmware_Cr50WPG3.py b/server/site_tests/firmware_Cr50WPG3/firmware_Cr50WPG3.py
index f18bcb9..38ae985 100644
--- a/server/site_tests/firmware_Cr50WPG3/firmware_Cr50WPG3.py
+++ b/server/site_tests/firmware_Cr50WPG3/firmware_Cr50WPG3.py
@@ -50,7 +50,7 @@
if servo_wp_s0 != 'off':
raise error.TestError("WP isn't disabled in S0")
- self.faft_client.System.RunShellCommand('poweroff')
+ self.faft_client.system.run_shell_command('poweroff')
time.sleep(self.WAIT_FOR_STATE)
if hasattr(self, 'ec'):
self.ec.send_command('hibernate')
diff --git a/server/site_tests/firmware_Cr50WilcoEcrst/firmware_Cr50WilcoEcrst.py b/server/site_tests/firmware_Cr50WilcoEcrst/firmware_Cr50WilcoEcrst.py
index 8463d62..0bff15f 100644
--- a/server/site_tests/firmware_Cr50WilcoEcrst/firmware_Cr50WilcoEcrst.py
+++ b/server/site_tests/firmware_Cr50WilcoEcrst/firmware_Cr50WilcoEcrst.py
@@ -52,7 +52,7 @@
"""
GEN_PMCON_A_ADDRESS = 0xfe001020
AFTERG3_EN_BIT = 0x1
- orig_reg_string = self.faft_client.System.RunShellCommandGetOutput(
+ orig_reg_string = self.faft_client.system.run_shell_command_get_output(
'iotools mmio_read32 %#x' % (GEN_PMCON_A_ADDRESS))
logging.info('iotools output: %s', orig_reg_string)
orig_reg_value = int(orig_reg_string[0], 0)
@@ -60,7 +60,7 @@
raise error.TestError(
'iotools mmio_read32 returned a value larger than 32 bits')
new_reg_value = orig_reg_value & ~AFTERG3_EN_BIT
- self.faft_client.System.RunShellCommand('iotools mmio_write32 %#x %#x'
+ self.faft_client.system.run_shell_command('iotools mmio_write32 %#x %#x'
% (GEN_PMCON_A_ADDRESS, new_reg_value))
diff --git a/server/site_tests/firmware_DevBootUSB/firmware_DevBootUSB.py b/server/site_tests/firmware_DevBootUSB/firmware_DevBootUSB.py
index d657026..35e0a9a 100644
--- a/server/site_tests/firmware_DevBootUSB/firmware_DevBootUSB.py
+++ b/server/site_tests/firmware_DevBootUSB/firmware_DevBootUSB.py
@@ -28,7 +28,7 @@
# Use the USB key for Ctrl-U dev boot, not recovery.
self.setup_usbkey(usbkey=True, host=False, used_for_recovery=False)
- self.original_dev_boot_usb = self.faft_client.System.GetDevBootUsb()
+ self.original_dev_boot_usb = self.faft_client.system.get_dev_boot_usb()
logging.info('Original dev_boot_usb value: %s',
str(self.original_dev_boot_usb))
@@ -49,14 +49,14 @@
logging.info("Expected developer mode, set dev_boot_usb to 0.")
self.check_state((self.checkers.dev_boot_usb_checker, False))
- self.faft_client.System.SetDevBootUsb(0)
+ self.faft_client.system.set_dev_boot_usb(0)
self.switcher.mode_aware_reboot()
logging.info("Expected internal disk boot, set dev_boot_usb to 1.")
self.check_state((self.checkers.dev_boot_usb_checker,
False,
"Not internal disk boot, dev_boot_usb misbehaved"))
- self.faft_client.System.SetDevBootUsb(1)
+ self.faft_client.system.set_dev_boot_usb(1)
self.switcher.simple_reboot()
self.switcher.bypass_dev_boot_usb()
self.switcher.wait_for_client()
@@ -64,7 +64,7 @@
logging.info("Expected USB boot, set dev_boot_usb to the original.")
self.check_state((self.checkers.dev_boot_usb_checker, (True, True),
'Device not booted from USB image properly.'))
- self.faft_client.System.SetDevBootUsb(self.original_dev_boot_usb)
+ self.faft_client.system.set_dev_boot_usb(self.original_dev_boot_usb)
self.switcher.mode_aware_reboot()
logging.info("Check and done.")
diff --git a/server/site_tests/firmware_DevScreenTimeout/firmware_DevScreenTimeout.py b/server/site_tests/firmware_DevScreenTimeout/firmware_DevScreenTimeout.py
index bf2f9e1..e87e468 100644
--- a/server/site_tests/firmware_DevScreenTimeout/firmware_DevScreenTimeout.py
+++ b/server/site_tests/firmware_DevScreenTimeout/firmware_DevScreenTimeout.py
@@ -40,7 +40,7 @@
@raise TestError: If the firmware-boot-time file does not exist.
"""
time.sleep(self.RUN_SHELL_READY_TIME_MARGIN)
- [fw_time] = self.faft_client.System.RunShellCommandGetOutput(
+ [fw_time] = self.faft_client.system.run_shell_command_get_output(
'cat /tmp/firmware-boot-time')
logging.info('Got firmware boot time [%s]: %s', tag, fw_time)
if fw_time:
diff --git a/server/site_tests/firmware_ECBattery/firmware_ECBattery.py b/server/site_tests/firmware_ECBattery/firmware_ECBattery.py
index 482d479..6fd4066 100644
--- a/server/site_tests/firmware_ECBattery/firmware_ECBattery.py
+++ b/server/site_tests/firmware_ECBattery/firmware_ECBattery.py
@@ -56,7 +56,7 @@
def _get_battery_path(self):
"""Get battery path in sysfs."""
- match = self.faft_client.System.RunShellCommandGetOutput(
+ match = self.faft_client.system.run_shell_command_get_output(
'grep -iH --color=no "Battery" /sys/class/power_supply/*/type')
name = None
for item in match:
@@ -87,7 +87,7 @@
servo_reading = int(self.servo.get('ppvar_vbat_mv'))
# Kernel gives voltage value in uV. Convert to mV here.
kernel_reading = int(
- self.faft_client.System.RunShellCommandGetOutput(
+ self.faft_client.system.run_shell_command_get_output(
'cat %s' % self._battery_voltage)[0]) / 1000
logging.info("Voltage reading from servo: %dmV", servo_reading)
logging.info("Voltage reading from kernel: %dmV", kernel_reading)
@@ -110,7 +110,7 @@
servo_reading = abs(int(self.servo.get('ppvar_vbat_ma')))
# Kernel gives current value in uA. Convert to mA here.
kernel_reading = abs(
- int(self.faft_client.System.RunShellCommandGetOutput(
+ int(self.faft_client.system.run_shell_command_get_output(
'cat %s' % self._battery_current)[0])) / 1000
logging.info("Current reading from servo: %dmA", servo_reading)
logging.info("Current reading from kernel: %dmA", kernel_reading)
diff --git a/server/site_tests/firmware_ECBootTime/firmware_ECBootTime.py b/server/site_tests/firmware_ECBootTime/firmware_ECBootTime.py
index c76f15a..482ffaa 100644
--- a/server/site_tests/firmware_ECBootTime/firmware_ECBootTime.py
+++ b/server/site_tests/firmware_ECBootTime/firmware_ECBootTime.py
@@ -116,7 +116,7 @@
"""
arm_legacy = ('Snow', 'Spring', 'Pit', 'Pi', 'Big', 'Blaze', 'Kitty')
- output = self.faft_client.System.GetPlatformName()
+ output = self.faft_client.system.get_platform_name()
return output in arm_legacy
def run_once(self):
diff --git a/server/site_tests/firmware_ECCbiEeprom/firmware_ECCbiEeprom.py b/server/site_tests/firmware_ECCbiEeprom/firmware_ECCbiEeprom.py
index 8cd3dac..b96f07e 100644
--- a/server/site_tests/firmware_ECCbiEeprom/firmware_ECCbiEeprom.py
+++ b/server/site_tests/firmware_ECCbiEeprom/firmware_ECCbiEeprom.py
@@ -33,7 +33,8 @@
raise error.TestNAError("Nothing needs to be tested on this device")
cmd = 'ectool locatechip %d %d' % (self.EEPROM_LOCATE_TYPE,
self.EEPROM_LOCATE_INDEX)
- cmd_out = self.faft_client.System.RunShellCommandGetOutput(cmd, True)
+ cmd_out = self.faft_client.system.run_shell_command_get_output(
+ cmd, True)
logging.debug('Ran %s on DUT, output was: %s', cmd, cmd_out)
if len(cmd_out) > 0 and cmd_out[0].startswith('Usage'):
@@ -63,7 +64,7 @@
(self.i2c_port, self.i2c_addr, self.NO_READ, offset, data))
def _read_eeprom(self, offset):
- cmd_out = self.faft_client.System.RunShellCommandGetOutput(
+ cmd_out = self.faft_client.system.run_shell_command_get_output(
'ectool i2cxfer %d %d %d %d' %
(self.i2c_port, self.i2c_addr, self.PAGE_SIZE, offset))
if len(cmd_out) < 1:
@@ -78,7 +79,7 @@
def _write_eeprom(self, offset, data):
# Note we expect this call to fail in certain scenarios, so ignore
# results
- self.faft_client.System.RunShellCommandGetOutput(
+ self.faft_client.system.run_shell_command_get_output(
self._gen_write_command(offset, data))
def _read_write_data(self, offset):
diff --git a/server/site_tests/firmware_ECHash/firmware_ECHash.py b/server/site_tests/firmware_ECHash/firmware_ECHash.py
index 50070a1..bebfadd 100644
--- a/server/site_tests/firmware_ECHash/firmware_ECHash.py
+++ b/server/site_tests/firmware_ECHash/firmware_ECHash.py
@@ -39,7 +39,7 @@
def get_echash(self):
"""Get the current EC hash via ectool/fwtool."""
command = 'ectool echash'
- lines = self.faft_client.System.RunShellCommandGetOutput(command)
+ lines = self.faft_client.system.run_shell_command_get_output(command)
pattern = re.compile('hash: ([0-9a-f]{64})')
for line in lines:
matched = pattern.match(line)
@@ -51,7 +51,7 @@
def invalidate_echash(self):
"""Invalidate the EC hash by requesting hashing some other part."""
command = 'ectool echash recalc 0 4'
- self.faft_client.System.RunShellCommand(command)
+ self.faft_client.system.run_shell_command(command)
def save_echash_and_invalidate(self):
"""Save the current EC hash and invalidate it."""
diff --git a/server/site_tests/firmware_ECLidShutdown/firmware_ECLidShutdown.py b/server/site_tests/firmware_ECLidShutdown/firmware_ECLidShutdown.py
index a7dd431..b3b3667 100644
--- a/server/site_tests/firmware_ECLidShutdown/firmware_ECLidShutdown.py
+++ b/server/site_tests/firmware_ECLidShutdown/firmware_ECLidShutdown.py
@@ -40,7 +40,7 @@
self.switcher.simple_reboot(sync_before_boot=False)
self.switcher.wait_for_client()
self.clear_set_gbb_flags(vboot.GBB_FLAG_DISABLE_LID_SHUTDOWN, 0)
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.run_shell_command(
self.CHECK_POWER_MANAGER_CFG_DEFAULT)
except Exception as exc:
logging.debug(
@@ -67,7 +67,7 @@
"""
self.clear_set_gbb_flags(vboot.GBB_FLAG_DISABLE_LID_SHUTDOWN, 0)
# TODO(kmshelton): Simplify to not use recovery mode.
- self.faft_client.System.RequestRecoveryBoot()
+ self.faft_client.system.request_recovery_boot()
self.servo.set('lid_open', 'no')
time.sleep(self.LID_POWER_STATE_DELAY)
self.switcher.simple_reboot(sync_before_boot=False)
@@ -98,8 +98,8 @@
boots to a firmware screen.
"""
self.clear_set_gbb_flags(0, vboot.GBB_FLAG_DISABLE_LID_SHUTDOWN)
- self.faft_client.System.RequestRecoveryBoot()
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.request_recovery_boot()
+ self.faft_client.system.run_shell_command(
self.IGNORE_LID_IN_USERSPACE_CMD)
self.servo.set('lid_open', 'no')
if not self.wait_power_state('S0', self.POWER_STATE_CHECK_TRIES):
diff --git a/server/site_tests/firmware_ECLidSwitch/firmware_ECLidSwitch.py b/server/site_tests/firmware_ECLidSwitch/firmware_ECLidSwitch.py
index 313691e..88b8214 100644
--- a/server/site_tests/firmware_ECLidSwitch/firmware_ECLidSwitch.py
+++ b/server/site_tests/firmware_ECLidSwitch/firmware_ECLidSwitch.py
@@ -86,7 +86,7 @@
Args:
wake_func: Delayed function to wake DUT.
"""
- self.faft_client.System.RunShellCommand('shutdown -P now')
+ self.faft_client.system.run_shell_command('shutdown -P now')
wake_func()
def _get_keyboard_backlight(self):
@@ -100,7 +100,7 @@
pattern_percent = re.compile(
'Current keyboard backlight percent: (\d*)')
pattern_disable = re.compile('Keyboard backlight disabled.')
- lines = self.faft_client.System.RunShellCommandGetOutput(cmd)
+ lines = self.faft_client.system.run_shell_command_get_output(cmd)
for line in lines:
matched_percent = pattern_percent.match(line)
if matched_percent is not None:
@@ -117,7 +117,7 @@
value: Backlight brightness percentage 0~100.
"""
cmd = 'ectool pwmsetkblight %d' % value
- self.faft_client.System.RunShellCommand(cmd)
+ self.faft_client.system.run_shell_command(cmd)
def check_keycode(self):
"""Check that lid open/close do not send power button keycode.
@@ -131,10 +131,10 @@
self._open_lid()
self.delayed_close_lid()
- if self.faft_client.System.CheckKeys([]) < 0:
+ if self.faft_client.system.check_keys([]) < 0:
return False
self.delayed_open_lid()
- if self.faft_client.System.CheckKeys([]) < 0:
+ if self.faft_client.system.check_keys([]) < 0:
return False
return True
@@ -170,7 +170,7 @@
"""
ok = True
logging.info("Stopping powerd")
- self.faft_client.System.RunShellCommand('stop powerd')
+ self.faft_client.system.run_shell_command('stop powerd')
if not self.check_keycode():
logging.error("check_keycode failed.")
ok = False
@@ -178,7 +178,7 @@
logging.error("check_backlight failed.")
ok = False
logging.info("Restarting powerd")
- self.faft_client.System.RunShellCommand('start powerd')
+ self.faft_client.system.run_shell_command('start powerd')
return ok
def run_once(self):
diff --git a/server/site_tests/firmware_ECPowerButton/firmware_ECPowerButton.py b/server/site_tests/firmware_ECPowerButton/firmware_ECPowerButton.py
index 0151bd0..7a69c14 100644
--- a/server/site_tests/firmware_ECPowerButton/firmware_ECPowerButton.py
+++ b/server/site_tests/firmware_ECPowerButton/firmware_ECPowerButton.py
@@ -38,7 +38,7 @@
def kill_powerd(self):
"""Stop powerd on client."""
- self.faft_client.System.RunShellCommand("stop powerd")
+ self.faft_client.system.run_shell_command("stop powerd")
def debounce_power_button(self):
"""Check if power button debouncing works.
@@ -50,7 +50,7 @@
# Press power button for only 10ms. Should be debounced.
logging.info('ECPowerButton: debounce_power_button')
Timer(3, self.servo.power_key, [0.001]).start()
- return self.faft_client.System.CheckKeys([116])
+ return self.faft_client.system.check_keys([116])
def shutdown_and_wake(self,
shutdown_powerkey_duration,
diff --git a/server/site_tests/firmware_ECPowerG3/firmware_ECPowerG3.py b/server/site_tests/firmware_ECPowerG3/firmware_ECPowerG3.py
index fbb3048..139e403 100644
--- a/server/site_tests/firmware_ECPowerG3/firmware_ECPowerG3.py
+++ b/server/site_tests/firmware_ECPowerG3/firmware_ECPowerG3.py
@@ -38,7 +38,7 @@
def check_G3(self):
"""Shutdown the system and check if X86 drop into G3 correctly."""
- self.faft_client.System.RunShellCommand("shutdown -P now")
+ self.faft_client.system.run_shell_command("shutdown -P now")
if not self.wait_power_state("G3", self.G3_RETRIES):
logging.error("EC fails to drop into G3")
self._failed = True
diff --git a/server/site_tests/firmware_ECThermal/firmware_ECThermal.py b/server/site_tests/firmware_ECThermal/firmware_ECThermal.py
index e79aae5..97bfdf3 100644
--- a/server/site_tests/firmware_ECThermal/firmware_ECThermal.py
+++ b/server/site_tests/firmware_ECThermal/firmware_ECThermal.py
@@ -77,7 +77,7 @@
current_id = 0
while True:
try:
- lines = self.faft_client.System.RunShellCommandGetOutput(
+ lines = self.faft_client.system.run_shell_command_get_output(
'ectool thermalget %d %d' % (type_id, current_id))
except xmlrpclib.Fault:
break
@@ -130,7 +130,7 @@
self._num_temp_sensor = 0
while True:
try:
- self.faft_client.System.RunShellCommand('ectool temps %d' %
+ self.faft_client.system.run_shell_command('ectool temps %d' %
self._num_temp_sensor)
self._num_temp_sensor = self._num_temp_sensor + 1
except xmlrpclib.Fault:
@@ -145,7 +145,7 @@
raise error.TestNAError("Nothing needs to be tested on this device")
self.ec.send_command("chan 0")
try:
- self.faft_client.System.RunShellCommand('stop temp_metrics')
+ self.faft_client.system.run_shell_command('stop temp_metrics')
except xmlrpclib.Fault:
self._has_temp_metrics = False
else:
@@ -163,7 +163,7 @@
self.enable_auto_fan_control()
if self._has_temp_metrics:
logging.info('Starting temp_metrics')
- self.faft_client.System.RunShellCommand('start temp_metrics')
+ self.faft_client.system.run_shell_command('start temp_metrics')
self.ec.send_command("chan 0xffffffff")
except Exception as e:
logging.error("Caught exception: %s", str(e))
@@ -182,7 +182,7 @@
ectool.
"""
for temp_id in range(self._num_temp_sensor):
- lines = self.faft_client.System.RunShellCommandGetOutput(
+ lines = self.faft_client.system.run_shell_command_get_output(
'ectool tempsinfo %d' % temp_id)
for line in lines:
matched = re.match('Sensor name: (.*)', line)
@@ -207,7 +207,7 @@
"""
assert sensor_id < self._num_temp_sensor
pattern = re.compile('Reading temperature...(\d*)')
- lines = self.faft_client.System.RunShellCommandGetOutput(
+ lines = self.faft_client.system.run_shell_command_get_output(
'ectool temps %d' % sensor_id)
for line in lines:
matched = pattern.match(line)
@@ -256,15 +256,15 @@
A list of stress process IDs is returned.
"""
logging.info("Stressing DUT with %d threads...", threads)
- self.faft_client.System.RunShellCommand('pkill dd')
+ self.faft_client.system.run_shell_command('pkill dd')
stress_cmd = 'dd if=/dev/urandom of=/dev/null bs=1M &'
# Grep for [d]d instead of dd to prevent getting the PID of grep
# itself.
pid_cmd = "ps -ef | grep '[d]d if=/dev/urandom' | awk '{print $2}'"
self._stress_pid = list()
for _ in xrange(threads):
- self.faft_client.System.RunShellCommand(stress_cmd)
- lines = self.faft_client.System.RunShellCommandGetOutput(
+ self.faft_client.system.run_shell_command(stress_cmd)
+ lines = self.faft_client.system.run_shell_command_get_output(
pid_cmd)
for line in lines:
logging.info("PID is %s", line)
@@ -276,7 +276,7 @@
"""Stop stressing DUT system"""
stop_cmd = 'kill -9 %d'
for pid in self._stress_pid:
- self.faft_client.System.RunShellCommand(stop_cmd % pid)
+ self.faft_client.system.run_shell_command(stop_cmd % pid)
def check_fan_off(self):
@@ -327,7 +327,7 @@
"""
assert sensor_id < self._num_temp_sensor
pattern = re.compile('Sensor type: (\d*)')
- lines = self.faft_client.System.RunShellCommandGetOutput(
+ lines = self.faft_client.system.run_shell_command_get_output(
'ectool tempsinfo %d' % sensor_id)
for line in lines:
matched = pattern.match(line)
diff --git a/server/site_tests/firmware_ECUpdateId/firmware_ECUpdateId.py b/server/site_tests/firmware_ECUpdateId/firmware_ECUpdateId.py
index 7db1702..71e4fb1 100644
--- a/server/site_tests/firmware_ECUpdateId/firmware_ECUpdateId.py
+++ b/server/site_tests/firmware_ECUpdateId/firmware_ECUpdateId.py
@@ -23,7 +23,7 @@
# Don't bother if there is no Chrome EC or if the EC is non-EFS.
if not self.check_ec_capability():
raise error.TestNAError("Nothing needs to be tested on this device")
- if not self.faft_client.Ec.IsEfs():
+ if not self.faft_client.ec.is_efs():
raise error.TestNAError("Nothing needs to be tested for non-EFS")
# In order to test software sync, it must be enabled.
self.clear_set_gbb_flags(vboot.GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC, 0)
@@ -49,22 +49,22 @@
def setup_ec_rw_to_a(self):
"""For EC EFS, make EC boot into RW A."""
- if self.faft_client.Ec.IsEfs():
+ if self.faft_client.ec.is_efs():
active_copy = self.servo.get_ec_active_copy()
if active_copy == 'RW_B':
from_section = 'rw_b'
to_section = 'rw'
logging.info("Copy EC RW from '%s' to '%s'",
from_section, to_section)
- self.faft_client.Ec.CopyRw(from_section, to_section)
+ self.faft_client.ec.copy_rw(from_section, to_section)
logging.info("EC reboot to switch slot. Wait DUT up...")
- reboot = lambda: self.faft_client.Ec.RebootToSwitchSlot()
+ reboot = lambda: self.faft_client.ec.reboot_to_switch_slot()
self.switcher.mode_aware_reboot('custom', reboot)
def get_active_hash(self):
"""Return the current EC hash."""
- ec_hash = self.faft_client.Ec.GetActiveHash()
+ ec_hash = self.faft_client.ec.get_active_hash()
logging.info("Current EC hash: %s", ec_hash)
return ec_hash
@@ -94,7 +94,7 @@
if self.servo.get_ec_active_copy() == 'RW_B':
section = 'rw_b'
logging.info("Corrupt the EC section: %s", section)
- self.faft_client.Ec.CorruptBody(section)
+ self.faft_client.ec.corrupt_body(section)
def wait_software_sync_and_boot(self):
"""Wait for software sync to update EC."""
@@ -113,8 +113,8 @@
original_hash = self.get_active_hash()
logging.info("Modify EC ID and flash it back to BIOS...")
- self.faft_client.Updater.ModifyEcidAndFlashToBios()
- modified_hash = self.faft_client.Updater.GetEcHash()
+ self.faft_client.updater.modify_ecid_and_flash_to_bios()
+ modified_hash = self.faft_client.updater.get_ec_hash()
logging.info("Reboot EC. Verify if EFS works as intended.")
self.sync_and_ec_reboot('hard')
diff --git a/server/site_tests/firmware_ECUsbPorts/firmware_ECUsbPorts.py b/server/site_tests/firmware_ECUsbPorts/firmware_ECUsbPorts.py
index 6c43eb2..3ba5662 100644
--- a/server/site_tests/firmware_ECUsbPorts/firmware_ECUsbPorts.py
+++ b/server/site_tests/firmware_ECUsbPorts/firmware_ECUsbPorts.py
@@ -69,7 +69,7 @@
(self.RPC_DELAY, ports_off_cmd,
self.REBOOT_DELAY,
ports_on_cmd))
- self.faft_client.System.RunShellCommand(cmd)
+ self.faft_client.system.run_shell_command(cmd)
self.faft_client.disconnect()
def __get_usb_enable_name(self, idx):
@@ -129,7 +129,7 @@
def check_power_off_mode(self):
"""Shutdown the system and check USB ports are disabled."""
self._failed = False
- self.faft_client.System.RunShellCommand("shutdown -P now")
+ self.faft_client.system.run_shell_command("shutdown -P now")
self.switcher.wait_for_client_offline()
if not self.wait_port_disabled(self._port_count, self.SHUTDOWN_TIMEOUT):
logging.info("Fails to wait for USB port disabled")
diff --git a/server/site_tests/firmware_ECWakeSource/firmware_ECWakeSource.py b/server/site_tests/firmware_ECWakeSource/firmware_ECWakeSource.py
index 60f59e7..674c538 100644
--- a/server/site_tests/firmware_ECWakeSource/firmware_ECWakeSource.py
+++ b/server/site_tests/firmware_ECWakeSource/firmware_ECWakeSource.py
@@ -28,7 +28,7 @@
def hibernate_and_wake_by_power_button(self):
"""Shutdown to G2/S5, then hibernate EC. Finally, wake by power button."""
- self.faft_client.System.RunShellCommand("shutdown -H now")
+ self.faft_client.system.run_shell_command("shutdown -H now")
self.switcher.wait_for_client_offline()
self.ec.send_command("hibernate 1000")
time.sleep(self.WAKE_DELAY)
diff --git a/server/site_tests/firmware_ECWatchdog/firmware_ECWatchdog.py b/server/site_tests/firmware_ECWatchdog/firmware_ECWatchdog.py
index e24f4e8..0817b5c 100644
--- a/server/site_tests/firmware_ECWatchdog/firmware_ECWatchdog.py
+++ b/server/site_tests/firmware_ECWatchdog/firmware_ECWatchdog.py
@@ -32,7 +32,7 @@
"""
Trigger a watchdog reset.
"""
- self.faft_client.System.RunShellCommand("sync")
+ self.faft_client.system.run_shell_command("sync")
self.ec.send_command("waitms %d" % self.WATCHDOG_DELAY)
time.sleep((self.WATCHDOG_DELAY + self.EC_BOOT_DELAY) / 1000.0)
self.check_lid_and_power_on()
diff --git a/server/site_tests/firmware_EmmcWriteLoad/firmware_EmmcWriteLoad.py b/server/site_tests/firmware_EmmcWriteLoad/firmware_EmmcWriteLoad.py
index 48731a8..a729c35 100644
--- a/server/site_tests/firmware_EmmcWriteLoad/firmware_EmmcWriteLoad.py
+++ b/server/site_tests/firmware_EmmcWriteLoad/firmware_EmmcWriteLoad.py
@@ -44,7 +44,7 @@
# Use the USB key for Ctrl-U dev boot, not recovery.
self.setup_usbkey(usbkey=True, host=False, used_for_recovery=False)
- self.original_dev_boot_usb = self.faft_client.System.GetDevBootUsb()
+ self.original_dev_boot_usb = self.faft_client.system.get_dev_boot_usb()
logging.info('Original dev_boot_usb value: %s',
str(self.original_dev_boot_usb))
@@ -74,7 +74,7 @@
def install_chrome_os(self):
"""Runs the install command. """
- self.faft_client.System.RunShellCommand(self.INSTALL_COMMAND)
+ self.faft_client.system.run_shell_command(self.INSTALL_COMMAND)
def poll_for_emmc_error(self, dmesg_file, poll_seconds=20):
"""Continuously polls the contents of dmesg for the emmc failure message
@@ -106,7 +106,7 @@
def run_once(self):
"""Main test logic"""
- self.faft_client.System.SetDevBootUsb(1)
+ self.faft_client.system.set_dev_boot_usb(1)
self.switcher.simple_reboot()
self.switcher.bypass_dev_boot_usb()
self.switcher.wait_for_client()
diff --git a/server/site_tests/firmware_EventLog/firmware_EventLog.py b/server/site_tests/firmware_EventLog/firmware_EventLog.py
index 25622a6..2ec0a03 100644
--- a/server/site_tests/firmware_EventLog/firmware_EventLog.py
+++ b/server/site_tests/firmware_EventLog/firmware_EventLog.py
@@ -30,7 +30,7 @@
return bool(filter(re.compile(pattern).search, self._events))
def _gather_events(self):
- entries = self.faft_client.System.RunShellCommandGetOutput(
+ entries = self.faft_client.system.run_shell_command_get_output(
'mosys eventlog list')
now = self._now()
self._events = []
@@ -49,7 +49,7 @@
# This assumes that Linux and the firmware use the same RTC. mosys converts
# timestamps to localtime, and so do we (by calling date without --utc).
def _now(self):
- time_string = self.faft_client.System.RunShellCommandGetOutput(
+ time_string = self.faft_client.system.run_shell_command_get_output(
'date +"%s"' % self._TIME_FORMAT)[0]
logging.debug('Current local system time on DUT is "%s"', time_string)
return time.strptime(time_string, self._TIME_FORMAT)
@@ -130,7 +130,7 @@
logging.info('Verifying eventlog behavior on suspend/resume')
self._cutoff_time = self._now()
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.run_shell_command(
'powerd_dbus_suspend -wakeup_timeout=10')
time.sleep(5) # a little slack time for powerd to write the 'Wake'
self._gather_events()
@@ -149,7 +149,7 @@
logging.info('Enabling S3 to retest suspend/resume')
self.disable_suspend_to_idle()
self._cutoff_time = self._now()
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.run_shell_command(
'powerd_dbus_suspend -wakeup_timeout=10')
time.sleep(5) # a little slack time for powerd to write the 'Wake'
self.teardown_powerd_prefs()
@@ -161,7 +161,7 @@
watchdog = WatchdogTester(self.host)
if not watchdog.is_supported():
logging.info('No hardware watchdog on this platform, skipping')
- elif self.faft_client.System.RunShellCommandGetOutput(
+ elif self.faft_client.system.run_shell_command_get_output(
'crossystem arch')[0] != 'x86': # TODO: Implement event on x86
logging.info('Verifying eventlog behavior with hardware watchdog')
self._cutoff_time = self._now()
diff --git a/server/site_tests/firmware_FAFTRPC/config.py b/server/site_tests/firmware_FAFTRPC/config.py
index 8f67e25..ba902ff 100644
--- a/server/site_tests/firmware_FAFTRPC/config.py
+++ b/server/site_tests/firmware_FAFTRPC/config.py
@@ -70,26 +70,26 @@
"""
RPC_CATEGORIES = [
{
- "category_name": "System",
+ "category_name": "system",
"test_cases": [
{
"method_names": [
- "IsAvailable",
- "GetPlatformName",
- "GetModelName",
- "DevTpmPresent",
- "GetRootDev",
- "GetRootPart",
- "GetFwVboot2",
- "RequestRecoveryBoot",
- "IsRemovableDeviceBoot",
- "GetInternalDevice",
+ "is_available",
+ "get_platform_name",
+ "get_model_name",
+ "dev_tpm_present",
+ "get_root_dev",
+ "get_root_part",
+ "get_fw_vboot2",
+ "request_recovery_boot",
+ "is_removable_device_boot",
+ "get_internal_device",
],
"passing_args": [NO_ARGS],
"failing_args": [ONE_INT_ARG, ONE_STR_ARG],
},
{
- "method_name": "DumpLog",
+ "method_name": "dump_log",
"passing_args": [
NO_ARGS,
(True, ),
@@ -103,8 +103,8 @@
},
{
"method_names": [
- "RunShellCommand",
- "RunShellCommandGetStatus",
+ "run_shell_command",
+ "run_shell_command_get_status",
],
"passing_args": [
("ls", ),
@@ -115,19 +115,19 @@
],
},
{
- "method_name": "RunShellCommandGetStatus",
+ "method_name": "run_shell_command_get_status",
"passing_args": [
("ls ''",),
],
},
{
- "method_name": "RunShellCommand",
+ "method_name": "run_shell_command",
"failing_args": [
("ls ''",),
],
},
{
- "method_name": "RunShellCommandCheckOutput",
+ "method_name": "run_shell_command_check_output",
"passing_args": [
("ls -l", "total"),
],
@@ -136,7 +136,7 @@
],
},
{
- "method_name": "RunShellCommandGetOutput",
+ "method_name": "run_shell_command_get_output",
"passing_args": [
("ls -l", True),
],
@@ -145,14 +145,14 @@
],
},
{
- "method_name": "GetCrossystemValue",
+ "method_name": "get_crossystem_value",
"passing_args": [
("fwid", ),
],
"failing_args": [NO_ARGS],
},
{
- "method_name": "SetTryFwB",
+ "method_name": "set_try_fw_b",
"passing_args": [
NO_ARGS,
(1, ),
@@ -162,7 +162,7 @@
],
},
{
- "method_name": "SetFwTryNext",
+ "method_name": "set_fw_try_next",
"passing_args": [
("A", ),
("A", 1),
@@ -173,13 +173,13 @@
],
},
{
- "method_name": "GetDevBootUsb",
+ "method_name": "get_dev_boot_usb",
"passing_args": [NO_ARGS],
"failing_args": [ONE_INT_ARG, ONE_STR_ARG],
"store_result_as": "dev_boot_usb",
},
{
- "method_name": "SetDevBootUsb",
+ "method_name": "set_dev_boot_usb",
"passing_args": [
(operator.itemgetter("dev_boot_usb"), ),
],
@@ -189,7 +189,7 @@
],
},
{
- "method_name": "CreateTempDir",
+ "method_name": "create_temp_dir",
"passing_args": [
NO_ARGS,
ONE_STR_ARG,
@@ -202,7 +202,7 @@
"store_result_as": "temp_dir",
},
{
- "method_name": "RemoveFile",
+ "method_name": "remove_file",
"passing_args": [
(SAMPLE_FILE, ),
],
@@ -212,7 +212,7 @@
],
},
{
- "method_name": "RemoveDir",
+ "method_name": "remove_dir",
"passing_args": [
(operator.itemgetter("temp_dir"), ),
],
@@ -222,7 +222,7 @@
]
},
{
- "method_name": "CheckKeys",
+ "method_name": "check_keys",
"passing_args": [
([], ),
([116], ),
@@ -237,31 +237,31 @@
]
},
{
- "category_name": "Bios",
+ "category_name": "bios",
"test_cases": [
{
"method_names": [
- "Reload",
+ "reload",
],
"passing_args": [NO_ARGS],
"failing_args": [ONE_INT_ARG, ONE_STR_ARG]
},
{
- "method_name": "GetGbbFlags",
+ "method_name": "get_gbb_flags",
"passing_args": [NO_ARGS],
"failing_args": [ONE_INT_ARG, ONE_STR_ARG],
"expected_return_type": int,
"store_result_as": "gbb_flags",
},
{
- "method_name": "SetGbbFlags",
+ "method_name": "set_gbb_flags",
"passing_args": [
(operator.itemgetter("gbb_flags"), ),
],
"failing_args": [NO_ARGS],
},
{
- "method_name": "GetPreambleFlags",
+ "method_name": "get_preamble_flags",
"passing_args": [
("a", ),
],
@@ -269,7 +269,7 @@
"store_result_as": "preamble_flags",
},
{
- "method_name": "SetPreambleFlags",
+ "method_name": "set_preamble_flags",
"passing_args": [
("a", operator.itemgetter("preamble_flags"), ),
],
@@ -282,12 +282,12 @@
},
{
"method_names": [
- "GetBodySha",
- "GetSigSha",
- "GetSectionFwid",
- "GetVersion",
- "GetDatakeyVersion",
- "GetKernelSubkeyVersion",
+ "get_body_sha",
+ "get_sig_sha",
+ "get_section_fwid",
+ "get_version",
+ "get_datakey_version",
+ "get_kernel_subkey_version",
],
"passing_args": [
("a", ),
@@ -302,12 +302,12 @@
},
{
"method_names": [
- "CorruptSig",
- "RestoreSig",
- "CorruptBody",
- "RestoreBody",
- "MoveVersionBackward",
- "MoveVersionForward",
+ "corrupt_sig",
+ "restore_sig",
+ "corrupt_body",
+ "restore_body",
+ "move_version_backward",
+ "move_version_forward",
],
"passing_args": [
("a", ),
@@ -321,8 +321,8 @@
},
{
"method_names": [
- "DumpWhole",
- "WriteWhole",
+ "dump_whole",
+ "write_whole",
],
"passing_args": [
(SAMPLE_FILE, ),
@@ -330,13 +330,13 @@
"failing_args": [NO_ARGS],
},
{
- "method_name": "StripModifiedFwids",
+ "method_name": "strip_modified_fwids",
"passing_args": [NO_ARGS],
"failing_args": [ONE_INT_ARG, ONE_STR_ARG],
"expected_return_type": dict
},
{
- "method_name": "SetWriteProtectRegion",
+ "method_name": "set_write_protect_region",
"passing_args": [
("WP_RO",),
("WP_RO", None),
@@ -350,7 +350,7 @@
],
},
{
- "method_name": "GetWriteProtectStatus",
+ "method_name": "get_write_protect_status",
"passing_args": [NO_ARGS],
"failing_args": [ONE_INT_ARG, ONE_STR_ARG],
"expected_return_type": dict
@@ -358,14 +358,14 @@
],
},
{
- "category_name": "Ec",
+ "category_name": "ec",
"test_cases": [
{
"method_names": [
- "Reload",
- "GetVersion",
- "GetActiveHash",
- "IsEfs",
+ "reload",
+ "get_version",
+ "get_active_hash",
+ "is_efs",
],
"passing_args": [NO_ARGS],
"failing_args": [ONE_INT_ARG, ONE_STR_ARG],
@@ -373,9 +373,9 @@
},
{
"method_names": [
- "DumpWhole",
- "WriteWhole",
- "DumpFirmware"
+ "dump_whole",
+ "write_whole",
+ "dump_firmware"
],
"passing_args": [
(SAMPLE_FILE, ),
@@ -383,7 +383,7 @@
"failing_args": [NO_ARGS],
},
{
- "method_name": "CorruptBody",
+ "method_name": "corrupt_body",
"passing_args": [
("rw", ),
],
@@ -395,7 +395,7 @@
],
},
{
- "method_name": "SetWriteProtect",
+ "method_name": "set_write_protect",
"passing_args": [
(True, ),
(False, ),
@@ -406,7 +406,7 @@
]
},
{
- "method_name": "CopyRw",
+ "method_name": "copy_rw",
"passing_args": [
("rw", "rw"),
],
@@ -418,7 +418,7 @@
],
},
{
- "method_name": "RebootToSwitchSlot",
+ "method_name": "reboot_to_switch_slot",
"passing_args": [NO_ARGS],
"failing_args": [ONE_INT_ARG, ONE_STR_ARG],
"allow_error_msg": "CmdError",
@@ -426,14 +426,14 @@
],
},
{
- "category_name": "Kernel",
+ "category_name": "kernel",
"test_cases": [
{
"method_names": [
- "CorruptSig",
- "RestoreSig",
- "MoveVersionBackward",
- "MoveVersionForward",
+ "corrupt_sig",
+ "restore_sig",
+ "move_version_backward",
+ "move_version_forward",
],
"passing_args": [
("a", ),
@@ -448,9 +448,9 @@
},
{
"method_names": [
- "GetVersion",
- "GetDatakeyVersion",
- "GetSha",
+ "get_version",
+ "get_datakey_version",
+ "get_sha",
],
"passing_args": [
("a", ),
@@ -464,7 +464,7 @@
],
},
{
- "method_name": "DiffAB",
+ "method_name": "diff_a_b",
"passing_args": [NO_ARGS],
"failing_args": [
ONE_INT_ARG,
@@ -473,7 +473,7 @@
"expected_return_type": bool,
},
{
- "method_name": "ResignWithKeys",
+ "method_name": "resign_with_keys",
"passing_args": [
("a", ),
("b", ),
@@ -488,8 +488,8 @@
},
{
"method_names": [
- "Dump",
- "Write",
+ "dump",
+ "write",
],
"passing_args": [
("a", SAMPLE_FILE),
@@ -505,17 +505,17 @@
],
},
{
- "category_name": "Tpm",
+ "category_name": "tpm",
"test_cases": [
{
"method_names": [
- "GetFirmwareVersion",
- "GetFirmwareDatakeyVersion",
- "GetKernelVersion",
- "GetKernelDatakeyVersion",
- "GetTpmVersion",
- "StopDaemon",
- "RestartDaemon",
+ "get_firmware_version",
+ "get_firmware_datakey_version",
+ "get_kernel_version",
+ "get_kernel_datakey_version",
+ "get_tpm_version",
+ "stop_daemon",
+ "restart_daemon",
],
"passing_args": [NO_ARGS],
"failing_args": [ONE_INT_ARG, ONE_STR_ARG],
@@ -523,10 +523,10 @@
]
},
{
- "category_name": "Cgpt",
+ "category_name": "cgpt",
"test_cases": [
{
- "method_name": "GetAttributes",
+ "method_name": "get_attributes",
"passing_args": [NO_ARGS],
"failing_args": [
ONE_INT_ARG,
@@ -534,7 +534,7 @@
],
},
{
- "method_name": "SetAttributes",
+ "method_name": "set_attributes",
"passing_args": [
NO_ARGS,
(SAMPLE_CGPT_A, ),
@@ -549,28 +549,28 @@
]
},
{
- "category_name": "Updater",
+ "category_name": "updater",
"test_cases": [
# TODO (gredelston/dgoyette):
# Uncomment the methods which write to flash memory,
# once we are able to set the firmware_updater to "emulate" mode.
{
"method_names": [
- "Cleanup",
- "StopDaemon",
- "StartDaemon",
- # "ModifyEcidAndFlashToBios",
- "GetEcHash",
- "ResetShellball",
- # "RunFactoryInstall",
- # "RunRecovery",
- "CbfsSetupWorkDir",
- # "CbfsSignAndFlash",
- "GetTempPath",
- "GetKeysPath",
- "GetWorkPath",
- "GetBiosRelativePath",
- "GetEcRelativePath"
+ "cleanup",
+ "stop_daemon",
+ "start_daemon",
+ # "modify_ecid_and_flash_to_bios",
+ "get_ec_hash",
+ "reset_shellball",
+ # "run_factory_install",
+ # "run_recovery",
+ "cbfs_setup_work_dir",
+ # "cbfs_sign_and_flash",
+ "get_temp_path",
+ "get_keys_path",
+ "get_work_path",
+ "get_bios_relative_path",
+ "get_ec_relative_path"
],
"passing_args": [
NO_ARGS,
@@ -583,7 +583,7 @@
r"/var/tmp/faft/autest/cbfs failed"),
},
{
- "method_name": "GetSectionFwid",
+ "method_name": "get_section_fwid",
"passing_args": [
NO_ARGS,
("bios", ),
@@ -601,8 +601,8 @@
},
{
"method_names": [
- "GetAllFwids",
- "GetAllInstalledFwids",
+ "get_all_fwids",
+ "get_all_installed_fwids",
],
"passing_args": [
NO_ARGS,
@@ -618,7 +618,7 @@
r"does not contain"),
},
{
- "method_name": "ModifyFwids",
+ "method_name": "modify_fwids",
"passing_args": [
NO_ARGS,
("bios", ),
@@ -637,7 +637,7 @@
r"does not contain"),
},
{
- "method_name": "ResignFirmware",
+ "method_name": "resign_firmware",
"passing_args": [
ONE_INT_ARG,
(None, ),
@@ -650,8 +650,8 @@
},
{
"method_names": [
- "RepackShellball",
- "ExtractShellball",
+ "repack_shellball",
+ "extract_shellball",
],
"passing_args": [
NO_ARGS,
@@ -663,7 +663,7 @@
]
},
{
- "method_name": "RunFirmwareupdate",
+ "method_name": "run_firmwareupdate",
"passing_args": [
("autoupdate", ),
("recovery", ),
@@ -678,8 +678,8 @@
},
{
"method_names": [
- "RunAutoupdate",
- "RunBootok",
+ "run_autoupdate",
+ "run_bootok",
],
"passing_args": [
("test",),
@@ -691,9 +691,9 @@
},
{
"method_names": [
- "CbfsExtractChip",
- "CbfsGetChipHash",
- "CbfsReplaceChip",
+ "cbfs_extract_chip",
+ "cbfs_get_chip_hash",
+ "cbfs_replace_chip",
],
"passing_args": [
(chip_fw_name, ) for chip_fw_name in CHIP_FW_NAMES
@@ -705,7 +705,7 @@
"allow_error_msg": "cbfstool /var/tmp/faft/"
},
{
- "method_name": "CopyBios",
+ "method_name": "copy_bios",
"passing_args": [
('/tmp/fake-bios.bin', )
],
@@ -716,7 +716,7 @@
"expected_return_type": str
},
{
- "method_name": "GetImageGbbFlags",
+ "method_name": "get_image_gbb_flags",
"passing_args": [
NO_ARGS,
('/tmp/fake-bios.bin',)
@@ -727,7 +727,7 @@
"store_result_as": "gbb_flags"
},
{
- "method_name": "SetImageGbbFlags",
+ "method_name": "set_image_gbb_flags",
"passing_args": [
(operator.itemgetter('gbb_flags'),),
(operator.itemgetter('gbb_flags'), '/tmp/fake-bios.bin'),
@@ -740,10 +740,10 @@
]
},
{
- "category_name": "Rootfs",
+ "category_name": "rootfs",
"test_cases": [
{
- "method_name": "VerifyRootfs",
+ "method_name": "verify_rootfs",
"passing_args": [
("A", ),
("B", ),
diff --git a/server/site_tests/firmware_FAFTRPC/control.bios b/server/site_tests/firmware_FAFTRPC/control.bios
index bc03ff7..c0ad1b9 100644
--- a/server/site_tests/firmware_FAFTRPC/control.bios
+++ b/server/site_tests/firmware_FAFTRPC/control.bios
@@ -30,7 +30,7 @@
host=host,
cmdline_args=args,
disable_sysinfo=True,
- category_under_test="Bios"
+ category_under_test="bios"
)
parallel_simple(run_faftrpc, machines)
diff --git a/server/site_tests/firmware_FAFTRPC/control.cgpt b/server/site_tests/firmware_FAFTRPC/control.cgpt
index 9c9ec88..7600383 100644
--- a/server/site_tests/firmware_FAFTRPC/control.cgpt
+++ b/server/site_tests/firmware_FAFTRPC/control.cgpt
@@ -30,7 +30,7 @@
host=host,
cmdline_args=args,
disable_sysinfo=True,
- category_under_test="Cgpt"
+ category_under_test="cgpt"
)
parallel_simple(run_faftrpc, machines)
diff --git a/server/site_tests/firmware_FAFTRPC/control.ec b/server/site_tests/firmware_FAFTRPC/control.ec
index ca86e8f..5356dd4 100644
--- a/server/site_tests/firmware_FAFTRPC/control.ec
+++ b/server/site_tests/firmware_FAFTRPC/control.ec
@@ -30,7 +30,7 @@
host=host,
cmdline_args=args,
disable_sysinfo=True,
- category_under_test="Ec",
+ category_under_test="ec",
reboot_after_completion=True
)
diff --git a/server/site_tests/firmware_FAFTRPC/control.kernel b/server/site_tests/firmware_FAFTRPC/control.kernel
index f656468..d4343a0 100644
--- a/server/site_tests/firmware_FAFTRPC/control.kernel
+++ b/server/site_tests/firmware_FAFTRPC/control.kernel
@@ -30,7 +30,7 @@
host=host,
cmdline_args=args,
disable_sysinfo=True,
- category_under_test="Kernel"
+ category_under_test="kernel"
)
parallel_simple(run_faftrpc, machines)
diff --git a/server/site_tests/firmware_FAFTRPC/control.rootfs b/server/site_tests/firmware_FAFTRPC/control.rootfs
index 93a45be..2cb0369 100644
--- a/server/site_tests/firmware_FAFTRPC/control.rootfs
+++ b/server/site_tests/firmware_FAFTRPC/control.rootfs
@@ -30,7 +30,7 @@
host=host,
cmdline_args=args,
disable_sysinfo=True,
- category_under_test="Rootfs"
+ category_under_test="rootfs"
)
parallel_simple(run_faftrpc, machines)
diff --git a/server/site_tests/firmware_FAFTRPC/control.system b/server/site_tests/firmware_FAFTRPC/control.system
index e5aea4f..5ccde1e 100644
--- a/server/site_tests/firmware_FAFTRPC/control.system
+++ b/server/site_tests/firmware_FAFTRPC/control.system
@@ -30,7 +30,7 @@
host=host,
cmdline_args=args,
disable_sysinfo=True,
- category_under_test="System"
+ category_under_test="system"
)
parallel_simple(run_faftrpc, machines)
diff --git a/server/site_tests/firmware_FAFTRPC/control.tpm b/server/site_tests/firmware_FAFTRPC/control.tpm
index 7121809..30243b8 100644
--- a/server/site_tests/firmware_FAFTRPC/control.tpm
+++ b/server/site_tests/firmware_FAFTRPC/control.tpm
@@ -30,7 +30,7 @@
host=host,
cmdline_args=args,
disable_sysinfo=True,
- category_under_test="Tpm"
+ category_under_test="tpm"
)
parallel_simple(run_faftrpc, machines)
diff --git a/server/site_tests/firmware_FAFTRPC/control.updater b/server/site_tests/firmware_FAFTRPC/control.updater
index 3dfa4fd..52f661d 100644
--- a/server/site_tests/firmware_FAFTRPC/control.updater
+++ b/server/site_tests/firmware_FAFTRPC/control.updater
@@ -30,7 +30,7 @@
host=host,
cmdline_args=args,
disable_sysinfo=True,
- category_under_test="Updater"
+ category_under_test="updater"
)
parallel_simple(run_faftrpc, machines)
diff --git a/server/site_tests/firmware_FAFTRPC/firmware_FAFTRPC.py b/server/site_tests/firmware_FAFTRPC/firmware_FAFTRPC.py
index 72962e1..b996ad0 100644
--- a/server/site_tests/firmware_FAFTRPC/firmware_FAFTRPC.py
+++ b/server/site_tests/firmware_FAFTRPC/firmware_FAFTRPC.py
@@ -65,12 +65,12 @@
"""Runs before test begins."""
super(firmware_FAFTRPC, self).initialize(host, cmdline_args)
self.backup_firmware()
- self.faft_client.RpcSettings.EnableTestMode()
+ self.faft_client.rpc_settings.enable_test_mode()
def cleanup(self):
"""Runs after test completion."""
- self.faft_client.RpcSettings.DisableTestMode()
+ self.faft_client.rpc_settings.disable_test_mode()
try:
if self.is_firmware_saved():
self.restore_firmware()
diff --git a/server/site_tests/firmware_FAFTSetup/firmware_FAFTSetup.py b/server/site_tests/firmware_FAFTSetup/firmware_FAFTSetup.py
index 9918279..f211b9f 100644
--- a/server/site_tests/firmware_FAFTSetup/firmware_FAFTSetup.py
+++ b/server/site_tests/firmware_FAFTSetup/firmware_FAFTSetup.py
@@ -48,17 +48,17 @@
"""
result = True
# Stop UI so that key presses don't go to Chrome.
- self.faft_client.System.RunShellCommand("stop ui")
+ self.faft_client.system.run_shell_command("stop ui")
# Press the keys
Timer(self.KEY_PRESS_DELAY, press_action).start()
# Invoke client side script to monitor keystrokes
- if not self.faft_client.System.CheckKeys([28, 29, 32]):
+ if not self.faft_client.system.check_keys([28, 29, 32]):
result = False
# Turn UI back on
- self.faft_client.System.RunShellCommand("start ui")
+ self.faft_client.system.run_shell_command("start ui")
return result
def keyboard_checker(self):
diff --git a/server/site_tests/firmware_FMap/firmware_FMap.py b/server/site_tests/firmware_FMap/firmware_FMap.py
index 56c1fd3..917f532 100644
--- a/server/site_tests/firmware_FMap/firmware_FMap.py
+++ b/server/site_tests/firmware_FMap/firmware_FMap.py
@@ -84,7 +84,7 @@
"""
logging.info('Execute %s', command)
- output = self.faft_client.System.RunShellCommandGetOutput(command)
+ output = self.faft_client.system.run_shell_command_get_output(command)
logging.info('Output %s', output)
return output
diff --git a/server/site_tests/firmware_FWupdate/firmware_FWupdate.py b/server/site_tests/firmware_FWupdate/firmware_FWupdate.py
index a4a00e3..4a9f31f 100644
--- a/server/site_tests/firmware_FWupdate/firmware_FWupdate.py
+++ b/server/site_tests/firmware_FWupdate/firmware_FWupdate.py
@@ -65,18 +65,18 @@
% self.new_pd)
logging.info('new_pd=%s', self.new_pd)
- self._old_bios_wp = self.faft_client.Bios.GetWriteProtectStatus()
+ self._old_bios_wp = self.faft_client.bios.get_write_protect_status()
if not self.images_specified:
# TODO(dgoyette): move this into the general FirmwareTest init?
- stripped_bios = self.faft_client.Bios.StripModifiedFwids()
+ stripped_bios = self.faft_client.bios.strip_modified_fwids()
if stripped_bios:
logging.warn(
"Fixed the previously modified BIOS FWID(s): %s",
stripped_bios)
if self.faft_config.chrome_ec:
- stripped_ec = self.faft_client.Ec.StripModifiedFwids()
+ stripped_ec = self.faft_client.ec.strip_modified_fwids()
if stripped_ec:
logging.warn(
"Fixed the previously modified EC FWID(s): %s",
@@ -90,7 +90,7 @@
self.wp = None
self.set_hardware_write_protect(False)
- self.faft_client.Bios.SetWriteProtectRegion(self.WP_REGION, True)
+ self.faft_client.bios.set_write_protect_region(self.WP_REGION, True)
self.set_hardware_write_protect(True)
self.mode = dict_args.get('mode', 'recovery')
@@ -110,9 +110,11 @@
@rtype: dict
"""
versions = dict()
- versions['bios'] = self.faft_client.Updater.GetAllInstalledFwids('bios')
+ versions['bios'] = self.faft_client.updater.get_all_installed_fwids(
+ 'bios')
if self.faft_config.chrome_ec:
- versions['ec'] = self.faft_client.Updater.GetAllInstalledFwids('ec')
+ versions['ec'] = self.faft_client.updater.get_all_installed_fwids(
+ 'ec')
return versions
def copy_cmdline_images(self, hostname):
@@ -122,18 +124,18 @@
"""
if self.new_bios or self.new_ec or self.new_pd:
- extract_dir = self.faft_client.Updater.GetWorkPath()
+ extract_dir = self.faft_client.updater.get_work_path()
dut_access = remote_access.RemoteDevice(hostname, username='root')
# Replace bin files.
if self.new_bios:
- bios_rel = self.faft_client.Updater.GetBiosRelativePath()
+ bios_rel = self.faft_client.updater.get_bios_relative_path()
bios_path = os.path.join(extract_dir, bios_rel)
dut_access.CopyToDevice(self.new_bios, bios_path, mode='scp')
if self.new_ec:
- ec_rel = self.faft_client.Updater.GetEcRelativePath()
+ ec_rel = self.faft_client.updater.get_ec_relative_path()
ec_path = os.path.join(extract_dir, ec_rel)
dut_access.CopyToDevice(self.new_ec, ec_path, mode='scp')
@@ -159,10 +161,11 @@
self.set_hardware_write_protect(False)
if write_protected:
- self.faft_client.Bios.SetWriteProtectRegion(self.WP_REGION, True)
+ self.faft_client.bios.set_write_protect_region(self.WP_REGION, True)
self.set_hardware_write_protect(True)
else:
- self.faft_client.Bios.SetWriteProtectRegion(self.WP_REGION, False)
+ self.faft_client.bios.set_write_protect_region(
+ self.WP_REGION, False)
expected_written = {}
written_desc = []
@@ -187,7 +190,7 @@
# make sure we restore firmware after the test, if it tried to flash.
self.flashed = True
- self.faft_client.Updater.RunFirmwareupdate(self.mode, append)
+ self.faft_client.updater.run_firmwareupdate(self.mode, append)
after_fwids = self.get_installed_versions()
@@ -208,7 +211,7 @@
append = 'new'
have_ec = bool(self.faft_config.chrome_ec)
- self.faft_client.Updater.ExtractShellball()
+ self.faft_client.updater.extract_shellball()
before_fwids = self.get_installed_versions()
@@ -220,15 +223,15 @@
"new_bios=%s, new_ec=%s, new_pd=%s",
self.new_bios, self.new_ec, self.new_pd)
self.copy_cmdline_images(host.hostname)
- self.faft_client.Updater.ReloadImages()
- self.faft_client.Updater.RepackShellball(append)
+ self.faft_client.updater.reload_images()
+ self.faft_client.updater.repack_shellball(append)
modded_fwids = self.identify_shellball(include_ec=have_ec)
else:
# Modify the stock image
logging.info(
"Using the currently running firmware, with modified fwids")
self.setup_firmwareupdate_shellball()
- self.faft_client.Updater.ReloadImages()
+ self.faft_client.updater.reload_images()
self.modify_shellball(append, modify_ro=True, modify_ec=have_ec)
modded_fwids = self.identify_shellball(include_ec=have_ec)
@@ -260,7 +263,7 @@
reboot the EC with the new firmware.
"""
self.set_hardware_write_protect(False)
- self.faft_client.Bios.SetWriteProtectRange(0, 0, False)
+ self.faft_client.bios.set_write_protect_range(0, 0, False)
if self.flashed:
if self.images_specified:
@@ -270,7 +273,7 @@
self.restore_firmware()
# Restore the old write-protection value at the end of the test.
- self.faft_client.Bios.SetWriteProtectRange(
+ self.faft_client.bios.set_write_protect_range(
self._old_bios_wp['start'],
self._old_bios_wp['length'],
self._old_bios_wp['enabled'])
diff --git a/server/site_tests/firmware_FwScreenCloseLid/firmware_FwScreenCloseLid.py b/server/site_tests/firmware_FwScreenCloseLid/firmware_FwScreenCloseLid.py
index a963777..239a7d2 100644
--- a/server/site_tests/firmware_FwScreenCloseLid/firmware_FwScreenCloseLid.py
+++ b/server/site_tests/firmware_FwScreenCloseLid/firmware_FwScreenCloseLid.py
@@ -127,7 +127,7 @@
'devsw_boot': '1',
'mainfw_type': 'developer',
}))
- self.faft_client.System.RequestRecoveryBoot()
+ self.faft_client.system.request_recovery_boot()
self.switcher.simple_reboot()
self.run_shutdown_process(
self.wait_longer_fw_screen_and_close_lid,
@@ -144,7 +144,7 @@
'devsw_boot': '1',
'mainfw_type': 'developer',
}))
- self.faft_client.System.RequestRecoveryBoot()
+ self.faft_client.system.request_recovery_boot()
self.switcher.simple_reboot()
self.run_shutdown_process(
self.wait_yuck_screen_and_close_lid,
@@ -168,7 +168,7 @@
'devsw_boot': '0',
'mainfw_type': 'normal',
}))
- self.faft_client.System.RequestRecoveryBoot()
+ self.faft_client.system.request_recovery_boot()
self.switcher.simple_reboot()
self.run_shutdown_process(
self.wait_longer_fw_screen_and_close_lid,
diff --git a/server/site_tests/firmware_FwScreenPressPower/firmware_FwScreenPressPower.py b/server/site_tests/firmware_FwScreenPressPower/firmware_FwScreenPressPower.py
index 889c5a9..02908a2 100644
--- a/server/site_tests/firmware_FwScreenPressPower/firmware_FwScreenPressPower.py
+++ b/server/site_tests/firmware_FwScreenPressPower/firmware_FwScreenPressPower.py
@@ -120,7 +120,7 @@
'devsw_boot': '1',
'mainfw_type': 'developer',
}))
- self.faft_client.System.RequestRecoveryBoot()
+ self.faft_client.system.request_recovery_boot()
self.switcher.simple_reboot()
self.run_shutdown_process(
self.wait_longer_fw_screen_and_press_power,
@@ -136,7 +136,7 @@
'devsw_boot': '1',
'mainfw_type': 'developer',
}))
- self.faft_client.System.RequestRecoveryBoot()
+ self.faft_client.system.request_recovery_boot()
self.switcher.simple_reboot()
self.run_shutdown_process(
self.wait_yuck_screen_and_press_power,
@@ -158,7 +158,7 @@
'devsw_boot': '0',
'mainfw_type': 'normal',
}))
- self.faft_client.System.RequestRecoveryBoot()
+ self.faft_client.system.request_recovery_boot()
self.switcher.simple_reboot()
self.run_shutdown_process(
self.wait_longer_fw_screen_and_press_power,
diff --git a/server/site_tests/firmware_LegacyRecovery/firmware_LegacyRecovery.py b/server/site_tests/firmware_LegacyRecovery/firmware_LegacyRecovery.py
index b6863e8..5325b01 100644
--- a/server/site_tests/firmware_LegacyRecovery/firmware_LegacyRecovery.py
+++ b/server/site_tests/firmware_LegacyRecovery/firmware_LegacyRecovery.py
@@ -36,14 +36,14 @@
'devsw_boot': '0',
'mainfw_type': 'normal',
}))
- self.faft_client.System.RequestRecoveryBoot()
+ self.faft_client.system.request_recovery_boot()
self.switcher.simple_reboot()
self.switcher.bypass_rec_mode()
try:
self.switcher.wait_for_client()
except ConnectionError:
raise error.TestError('Failed to boot the USB image.')
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.run_shell_command(
'crossystem recovery_request=1')
logging.info("Wait to ensure no recovery boot at remove screen "
diff --git a/server/site_tests/firmware_Mosys/firmware_Mosys.py b/server/site_tests/firmware_Mosys/firmware_Mosys.py
index 6c32507..1abd7bd 100644
--- a/server/site_tests/firmware_Mosys/firmware_Mosys.py
+++ b/server/site_tests/firmware_Mosys/firmware_Mosys.py
@@ -68,7 +68,8 @@
"""
logging.info('Execute %s', command)
- output = self.faft_client.System.RunShellCommandGetOutput(command, True)
+ output = self.faft_client.system.run_shell_command_get_output(
+ command, True)
logging.info('Output %s', output)
return output
diff --git a/server/site_tests/firmware_PDProtocol/firmware_PDProtocol.py b/server/site_tests/firmware_PDProtocol/firmware_PDProtocol.py
index bb19149..a2b2808 100644
--- a/server/site_tests/firmware_PDProtocol/firmware_PDProtocol.py
+++ b/server/site_tests/firmware_PDProtocol/firmware_PDProtocol.py
@@ -50,7 +50,7 @@
# not swapping here. So set used_for_recovery=False.
self.setup_usbkey(usbkey=True, host=False, used_for_recovery=False)
- self.original_dev_boot_usb = self.faft_client.System.GetDevBootUsb()
+ self.original_dev_boot_usb = self.faft_client.system.get_dev_boot_usb()
logging.info('Original dev_boot_usb value: %s',
str(self.original_dev_boot_usb))
@@ -86,7 +86,7 @@
"""
logging.info('Command to run: %s', command)
- output = self.faft_client.System.RunShellCommandGetOutput(command)
+ output = self.faft_client.system.run_shell_command_get_output(command)
logging.info('Command output: %s', output)
diff --git a/server/site_tests/firmware_RecoveryCacheBootKeys/firmware_RecoveryCacheBootKeys.py b/server/site_tests/firmware_RecoveryCacheBootKeys/firmware_RecoveryCacheBootKeys.py
index 78f58f0..0ef3152 100644
--- a/server/site_tests/firmware_RecoveryCacheBootKeys/firmware_RecoveryCacheBootKeys.py
+++ b/server/site_tests/firmware_RecoveryCacheBootKeys/firmware_RecoveryCacheBootKeys.py
@@ -57,7 +57,7 @@
"""
logging.info("Checking if device has RECOVERY_MRC_CACHE")
- return self.faft_client.System.RunShellCommandCheckOutput(
+ return self.faft_client.system.run_shell_command_check_output(
self.FMAP_CMD, self.RECOVERY_CACHE_SECTION)
def check_cache_used(self):
@@ -68,7 +68,7 @@
"""
logging.info('Checking if cache was used.')
- return self.faft_client.System.RunShellCommandCheckOutput(
+ return self.faft_client.system.run_shell_command_check_output(
self.FIRMWARE_LOG_CMD, self.USED_CACHE_MSG)
def check_cache_rebuilt(self):
@@ -79,7 +79,7 @@
"""
logging.info('Checking if cache was rebuilt.')
- return self.faft_client.System.RunShellCommandCheckOutput(
+ return self.faft_client.system.run_shell_command_check_output(
self.FIRMWARE_LOG_CMD, self.REBUILD_CACHE_MSG)
def run_once(self):
diff --git a/server/site_tests/firmware_RollbackFirmware/firmware_RollbackFirmware.py b/server/site_tests/firmware_RollbackFirmware/firmware_RollbackFirmware.py
index ff98fd5..3047ef4 100644
--- a/server/site_tests/firmware_RollbackFirmware/firmware_RollbackFirmware.py
+++ b/server/site_tests/firmware_RollbackFirmware/firmware_RollbackFirmware.py
@@ -39,12 +39,12 @@
"""Runs a single iteration of the test."""
logging.info("Rollback firmware A.")
self.check_state((self.checkers.fw_tries_checker, 'A'))
- self.faft_client.Bios.MoveVersionBackward('a')
+ self.faft_client.bios.move_version_backward('a')
self.switcher.mode_aware_reboot()
logging.info("Expected firmware B boot and rollback firmware B.")
self.check_state((self.checkers.fw_tries_checker, ('B', False)))
- self.faft_client.Bios.MoveVersionBackward('b')
+ self.faft_client.bios.move_version_backward('b')
# Older devices (without BROKEN screen) didn't wait for removal in
# dev mode. Make sure the USB key is not plugged in so they won't
@@ -61,10 +61,10 @@
vboot.RECOVERY_REASON['RO_INVALID_RW'],
vboot.RECOVERY_REASON['RW_FW_ROLLBACK']),
}))
- self.faft_client.Bios.MoveVersionForward('a')
- self.faft_client.Bios.MoveVersionForward('b')
+ self.faft_client.bios.move_version_forward('a')
+ self.faft_client.bios.move_version_forward('b')
self.switcher.mode_aware_reboot()
expected_slot = 'B' if self.fw_vboot2 else 'A'
- logging.info("Expected firmware " + expected_slot + " boot, done.")
+ logging.info("Expected firmware %s boot, done.", expected_slot)
self.check_state((self.checkers.fw_tries_checker, expected_slot))
diff --git a/server/site_tests/firmware_RollbackKernel/firmware_RollbackKernel.py b/server/site_tests/firmware_RollbackKernel/firmware_RollbackKernel.py
index db0165b..dad997f 100644
--- a/server/site_tests/firmware_RollbackKernel/firmware_RollbackKernel.py
+++ b/server/site_tests/firmware_RollbackKernel/firmware_RollbackKernel.py
@@ -31,7 +31,7 @@
"""
if not self.check_root_part_on_non_recovery(part):
logging.info('Recover the disk OS by running chromeos-install...')
- self.faft_client.System.RunShellCommand('chromeos-install --yes')
+ self.faft_client.system.run_shell_command('chromeos-install --yes')
self.switcher.mode_aware_reboot()
def initialize(self, host, cmdline_args, dev_mode=False):
@@ -62,22 +62,22 @@
if dev_mode:
logging.info("Rollbacks kernel A.")
self.check_state((self.check_root_part_on_non_recovery, 'a'))
- self.faft_client.Kernel.MoveVersionBackward('a')
+ self.faft_client.kernel.move_version_backward('a')
self.switcher.mode_aware_reboot()
logging.info("Still kernel A boot since dev_mode ignores "
"kernel rollback check.")
self.check_state((self.check_root_part_on_non_recovery, 'a'))
- self.faft_client.Kernel.MoveVersionForward('a')
+ self.faft_client.kernel.move_version_forward('a')
else:
logging.info("Rollbacks kernel A.")
self.check_state((self.check_root_part_on_non_recovery, 'a'))
- self.faft_client.Kernel.MoveVersionBackward('a')
+ self.faft_client.kernel.move_version_backward('a')
self.switcher.mode_aware_reboot()
logging.info("Expected kernel B boot and rollbacks kernel B.")
self.check_state((self.check_root_part_on_non_recovery, 'b'))
- self.faft_client.Kernel.MoveVersionBackward('b')
+ self.faft_client.kernel.move_version_backward('b')
self.switcher.mode_aware_reboot(wait_for_dut_up=False)
self.switcher.bypass_rec_mode()
self.switcher.wait_for_client()
@@ -87,8 +87,8 @@
'mainfw_type': 'recovery',
'recovery_reason': recovery_reason,
}))
- self.faft_client.Kernel.MoveVersionForward('a')
- self.faft_client.Kernel.MoveVersionForward('b')
+ self.faft_client.kernel.move_version_forward('a')
+ self.faft_client.kernel.move_version_forward('b')
self.switcher.mode_aware_reboot()
logging.info("Expected kernel A boot and done.")
diff --git a/server/site_tests/firmware_SelfSignedBoot/firmware_SelfSignedBoot.py b/server/site_tests/firmware_SelfSignedBoot/firmware_SelfSignedBoot.py
index a0508b9..2056d28 100644
--- a/server/site_tests/firmware_SelfSignedBoot/firmware_SelfSignedBoot.py
+++ b/server/site_tests/firmware_SelfSignedBoot/firmware_SelfSignedBoot.py
@@ -28,7 +28,7 @@
self.switcher.setup_mode('dev')
self.setup_usbkey(usbkey=True, host=False)
- self.original_dev_boot_usb = self.faft_client.System.GetDevBootUsb()
+ self.original_dev_boot_usb = self.faft_client.system.get_dev_boot_usb()
logging.info('Original dev_boot_usb value: %s',
str(self.original_dev_boot_usb))
@@ -38,7 +38,7 @@
def cleanup(self):
try:
- self.faft_client.System.SetDevBootUsb(self.original_dev_boot_usb)
+ self.faft_client.system.set_dev_boot_usb(self.original_dev_boot_usb)
self.disable_crossystem_selfsigned()
self.ensure_dev_internal_boot(self.original_dev_boot_usb)
self.resignimage_recoverykeys()
@@ -48,26 +48,26 @@
def resignimage_ssdkeys(self):
"""Re-signing the USB image using the SSD keys."""
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.run_shell_command(
'/usr/share/vboot/bin/make_dev_ssd.sh -i %s' % self.usb_dev)
def resignimage_recoverykeys(self):
"""Re-signing the USB image using the Recovery keys."""
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.run_shell_command(
'/usr/share/vboot/bin/make_dev_ssd.sh -i %s --recovery_key'
% self.usb_dev)
def enable_crossystem_selfsigned(self):
"""Enable dev_boot_signed_only + dev_boot_usb."""
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.run_shell_command(
'crossystem dev_boot_signed_only=1')
- self.faft_client.System.RunShellCommand('crossystem dev_boot_usb=1')
+ self.faft_client.system.run_shell_command('crossystem dev_boot_usb=1')
def disable_crossystem_selfsigned(self):
"""Disable dev_boot_signed_only + dev_boot_usb."""
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.run_shell_command(
'crossystem dev_boot_signed_only=0')
- self.faft_client.System.RunShellCommand('crossystem dev_boot_usb=0')
+ self.faft_client.system.run_shell_command('crossystem dev_boot_usb=0')
def run_once(self):
"""Runs a single iteration of the test."""
diff --git a/server/site_tests/firmware_SetSerialNumber/firmware_SetSerialNumber.py b/server/site_tests/firmware_SetSerialNumber/firmware_SetSerialNumber.py
index ffc1958..b7b5547 100644
--- a/server/site_tests/firmware_SetSerialNumber/firmware_SetSerialNumber.py
+++ b/server/site_tests/firmware_SetSerialNumber/firmware_SetSerialNumber.py
@@ -57,10 +57,10 @@
# Disable fw wp to clear VPD value
self.set_hardware_write_protect(False)
- self.faft_client.System.RunShellCommandGetOutput(
+ self.faft_client.system.run_shell_command_get_output(
'flashrom -p host --wp-disable')
- self.faft_client.System.RunShellCommandGetOutput(
+ self.faft_client.system.run_shell_command_get_output(
'vpd -i RO_VPD -s serial_number="%s"' %
(' ' * self.faft_config.serial_number_length)
)
@@ -85,7 +85,7 @@
self.checkers.mode_checker('normal')
# Check that serial_number is correctly set
- result = self.faft_client.System.RunShellCommandGetOutput(
+ result = self.faft_client.system.run_shell_command_get_output(
'vpd -i RO_VPD -g serial_number')[0]
if result != serial_number:
@@ -93,7 +93,7 @@
serial_number, result))
# Check that write protect is correctly set
- result = self.faft_client.System.RunShellCommandGetOutput(
+ result = self.faft_client.system.run_shell_command_get_output(
'flashrom -p host --wp-status')
result = '\n'.join(result)
diff --git a/server/site_tests/firmware_SoftwareSync/firmware_SoftwareSync.py b/server/site_tests/firmware_SoftwareSync/firmware_SoftwareSync.py
index 9aa7a71..24e9222 100644
--- a/server/site_tests/firmware_SoftwareSync/firmware_SoftwareSync.py
+++ b/server/site_tests/firmware_SoftwareSync/firmware_SoftwareSync.py
@@ -43,7 +43,7 @@
def record_hash(self):
"""Record current EC hash."""
- self._ec_hash = self.faft_client.Ec.GetActiveHash()
+ self._ec_hash = self.faft_client.ec.get_active_hash()
logging.info("Stored EC hash: %s", self._ec_hash)
def corrupt_active_rw(self):
@@ -57,11 +57,11 @@
# TODO(waihong): Remove this except clause.
pass
logging.info("Corrupt the EC section: %s", section)
- self.faft_client.Ec.CorruptBody(section)
+ self.faft_client.ec.corrupt_body(section)
def software_sync_checker(self):
"""Check EC firmware is restored by software sync."""
- ec_hash = self.faft_client.Ec.GetActiveHash()
+ ec_hash = self.faft_client.ec.get_active_hash()
logging.info("Current EC hash: %s", ec_hash)
if self._ec_hash != ec_hash:
return False
diff --git a/server/site_tests/firmware_TPMExtend/firmware_TPMExtend.py b/server/site_tests/firmware_TPMExtend/firmware_TPMExtend.py
index 462c508..253a20c 100644
--- a/server/site_tests/firmware_TPMExtend/firmware_TPMExtend.py
+++ b/server/site_tests/firmware_TPMExtend/firmware_TPMExtend.py
@@ -19,7 +19,7 @@
def _tpm1_check_pcr(self, num, hash_obj):
pcrs_file = '/sys/class/*/tpm0/device/pcrs'
- pcrs = '\n'.join(self.faft_client.System.RunShellCommandGetOutput(
+ pcrs = '\n'.join(self.faft_client.system.run_shell_command_get_output(
'cat %s' % pcrs_file))
logging.debug('Dumping PCRs read from device: \n%s', pcrs)
extended = hashlib.sha1(b'\0' * 20 + hash_obj.digest()[:20]).hexdigest()
@@ -28,7 +28,7 @@
return ('PCR-%.2d: %s' % (num, spaced.upper())) in pcrs
def _tpm2_check_pcr(self, num, hash_obj):
- out = self.faft_client.System.RunShellCommandGetOutput(
+ out = self.faft_client.system.run_shell_command_get_output(
'trunks_client --read_pcr --index=%d' % num)[0]
logging.debug('PCR %d read from device: %s', num, out)
padded = (hash_obj.digest() + b'\0' * 12)[:32]
@@ -38,7 +38,7 @@
def _check_pcr(self, num, hash_obj):
"""Returns true iff PCR |num| was extended with hashlib |hash_obj|."""
- if '1.' in self.faft_client.Tpm.GetTpmVersion():
+ if '1.' in self.faft_client.tpm.get_tpm_version():
return self._tpm1_check_pcr(num, hash_obj)
else:
return self._tpm2_check_pcr(num, hash_obj)
@@ -46,7 +46,7 @@
def run_once(self):
"""Runs a single iteration of the test."""
logging.info('Verifying HWID digest in PCR1')
- hwid = self.faft_client.System.RunShellCommandGetOutput(
+ hwid = self.faft_client.system.run_shell_command_get_output(
'crossystem hwid')[0]
logging.debug('HWID reported by device is: %s', hwid)
if not self._check_pcr(1, hashlib.sha256(hwid)):
diff --git a/server/site_tests/firmware_TPMKernelVersion/firmware_TPMKernelVersion.py b/server/site_tests/firmware_TPMKernelVersion/firmware_TPMKernelVersion.py
index 1146415..e87d9fc 100644
--- a/server/site_tests/firmware_TPMKernelVersion/firmware_TPMKernelVersion.py
+++ b/server/site_tests/firmware_TPMKernelVersion/firmware_TPMKernelVersion.py
@@ -20,7 +20,7 @@
self.switcher.setup_mode('dev')
# Use the USB key for Ctrl-U dev boot, not recovery.
self.setup_usbkey(usbkey=True, host=False, used_for_recovery=False)
- self.original_dev_boot_usb = self.faft_client.System.GetDevBootUsb()
+ self.original_dev_boot_usb = self.faft_client.system.get_dev_boot_usb()
logging.info('Original dev_boot_usb value: %s',
str(self.original_dev_boot_usb))
@@ -32,7 +32,7 @@
@returns command output.
"""
logging.info('Execute %s', command)
- output = self.faft_client.System.RunShellCommandGetOutput(command)
+ output = self.faft_client.system.run_shell_command_get_output(command)
logging.info('Output %s', output)
return output
@@ -48,14 +48,14 @@
"""Main test logic"""
# Get the kernel version and its datakey version.
# TODO(twreid): Verify the results.
- version = self.faft_client.Tpm.GetKernelVersion()
+ version = self.faft_client.tpm.get_kernel_version()
logging.info('Kernel version: %d', version)
- version = self.faft_client.Tpm.GetKernelDatakeyVersion()
+ version = self.faft_client.tpm.get_kernel_datakey_version()
logging.info('Kernel datakey version: %d', version)
self.dut_run_cmd('crossystem kernkey_vfy dev_boot_usb')
# Boot CrOS from USB
- self.faft_client.System.SetDevBootUsb(1)
+ self.faft_client.system.set_dev_boot_usb(1)
self.switcher.simple_reboot()
self.switcher.bypass_dev_boot_usb()
self.switcher.wait_for_client()
diff --git a/server/site_tests/firmware_TPMNotCorruptedDevMode/firmware_TPMNotCorruptedDevMode.py b/server/site_tests/firmware_TPMNotCorruptedDevMode/firmware_TPMNotCorruptedDevMode.py
index ee377df..ac6c83c 100644
--- a/server/site_tests/firmware_TPMNotCorruptedDevMode/firmware_TPMNotCorruptedDevMode.py
+++ b/server/site_tests/firmware_TPMNotCorruptedDevMode/firmware_TPMNotCorruptedDevMode.py
@@ -49,7 +49,7 @@
# Use the USB key for Ctrl-U dev boot, not recovery.
self.setup_usbkey(usbkey=True, host=False, used_for_recovery=False)
- self.original_dev_boot_usb = self.faft_client.System.GetDevBootUsb()
+ self.original_dev_boot_usb = self.faft_client.system.get_dev_boot_usb()
logging.info('Original dev_boot_usb value: %s',
str(self.original_dev_boot_usb))
@@ -63,9 +63,9 @@
def ensure_usb_device_boot(self):
"""Ensure USB device boot and if not reboot into USB."""
- if not self.faft_client.System.IsRemovableDeviceBoot():
+ if not self.faft_client.system.is_removable_device_boot():
logging.info('Reboot into USB...')
- self.faft_client.System.SetDevBootUsb(1)
+ self.faft_client.system.set_dev_boot_usb(1)
self.switcher.simple_reboot()
self.switcher.bypass_dev_boot_usb()
self.switcher.wait_for_client()
@@ -80,13 +80,13 @@
"""
self.ensure_dev_internal_boot(self.original_dev_boot_usb)
logging.info('Reading kernel anti-rollback data from the TPM.')
- self.faft_client.Tpm.StopDaemon()
+ self.faft_client.tpm.stop_daemon()
kernel_rollback_space = (
- self.faft_client.System.RunShellCommandGetOutput(
+ self.faft_client.system.run_shell_command_get_output(
'tpmc read %s %s' %
(self.KERNEL_NV_INDEX,
self.KERNEL_ANTIROLLBACK_SPACE_BYTES)))
- self.faft_client.Tpm.RestartDaemon()
+ self.faft_client.tpm.restart_daemon()
logging.info('===== TPMC OUTPUT: %s =====', kernel_rollback_space)
if self.check_tpmc(kernel_rollback_space):
diff --git a/server/site_tests/firmware_UpdateFirmwareDataKeyVersion/firmware_UpdateFirmwareDataKeyVersion.py b/server/site_tests/firmware_UpdateFirmwareDataKeyVersion/firmware_UpdateFirmwareDataKeyVersion.py
index 3e40038..66c20f1 100644
--- a/server/site_tests/firmware_UpdateFirmwareDataKeyVersion/firmware_UpdateFirmwareDataKeyVersion.py
+++ b/server/site_tests/firmware_UpdateFirmwareDataKeyVersion/firmware_UpdateFirmwareDataKeyVersion.py
@@ -23,24 +23,24 @@
"""Resigns the datakey version."""
host.send_file(os.path.join(self.bindir,
'files/common.sh'),
- os.path.join(self.faft_client.Updater.GetTempPath(),
+ os.path.join(self.faft_client.updater.get_temp_path(),
'common.sh'))
host.send_file(os.path.join(self.bindir,
'files/make_keys.sh'),
- os.path.join(self.faft_client.Updater.GetTempPath(),
+ os.path.join(self.faft_client.updater.get_temp_path(),
'make_keys.sh'))
- self.faft_client.System.RunShellCommand('/bin/bash %s %s' % (
- os.path.join(self.faft_client.Updater.GetTempPath(),
+ self.faft_client.system.run_shell_command('/bin/bash %s %s' % (
+ os.path.join(self.faft_client.updater.get_temp_path(),
'make_keys.sh'),
self._update_version))
def check_firmware_datakey_version(self, expected_ver):
"""Checks the firmware datakey version."""
- actual_ver = self.faft_client.Bios.GetDatakeyVersion(
+ actual_ver = self.faft_client.bios.get_datakey_version(
'b' if self.fw_vboot2 else 'a')
- actual_tpm_fwver = self.faft_client.Tpm.GetFirmwareDatakeyVersion()
+ actual_tpm_fwver = self.faft_client.tpm.get_firmware_datakey_version()
if actual_ver != expected_ver or actual_tpm_fwver != expected_ver:
raise error.TestFail(
'Firmware data key version should be %s,'
@@ -64,28 +64,28 @@
# Update firmware if needed
if shellball_path:
self.set_hardware_write_protect(enable=False)
- self.faft_client.Updater.RunFactoryInstall()
+ self.faft_client.updater.run_factory_install()
self.switcher.mode_aware_reboot()
self.setup_usbkey(usbkey=True)
- self._fwid = self.faft_client.Updater.GetSectionFwid()
+ self._fwid = self.faft_client.updater.get_section_fwid()
- self.fw_ver_tpm = self.faft_client.Tpm.GetFirmwareDatakeyVersion()
- actual_ver = self.faft_client.Bios.GetDatakeyVersion('a')
+ self.fw_ver_tpm = self.faft_client.tpm.get_firmware_datakey_version()
+ actual_ver = self.faft_client.bios.get_datakey_version('a')
logging.info('Origin version is %s', actual_ver)
self._update_version = actual_ver + 1
logging.info('Firmware version will update to version %s',
self._update_version)
self.resign_datakey_version(host)
- self.faft_client.Updater.ResignFirmware(1)
- self.faft_client.Updater.RepackShellball('test')
+ self.faft_client.updater.resign_firmware(1)
+ self.faft_client.updater.repack_shellball('test')
def cleanup(self):
"""Cleanup after the test"""
try:
- if (self.faft_client.Tpm.GetFirmwareDatakeyVersion() !=
+ if (self.faft_client.tpm.get_firmware_datakey_version() !=
self.fw_ver_tpm):
self.reboot_and_reset_tpm()
self.restore_firmware()
@@ -102,11 +102,11 @@
'fwid': self._fwid
}))
self.check_state((self.checkers.fw_tries_checker, 'A'))
- self.faft_client.Updater.RunAutoupdate('test')
+ self.faft_client.updater.run_autoupdate('test')
self.switcher.mode_aware_reboot()
logging.info("Check firmware data key version and Rollback.")
- self.faft_client.Updater.RunBootok('test')
+ self.faft_client.updater.run_bootok('test')
self.check_state((self.checkers.fw_tries_checker, 'B'))
self.switcher.mode_aware_reboot()
@@ -114,7 +114,7 @@
self.check_state((self.checkers.fw_tries_checker,
'B' if self.fw_vboot2 else 'A'))
self.check_firmware_datakey_version(self._update_version)
- self.faft_client.Updater.RunRecovery()
+ self.faft_client.updater.run_recovery()
self.reboot_and_reset_tpm()
logging.info("Check Rollback version.")
diff --git a/server/site_tests/firmware_UpdateFirmwareVersion/firmware_UpdateFirmwareVersion.py b/server/site_tests/firmware_UpdateFirmwareVersion/firmware_UpdateFirmwareVersion.py
index af85710..9112367 100644
--- a/server/site_tests/firmware_UpdateFirmwareVersion/firmware_UpdateFirmwareVersion.py
+++ b/server/site_tests/firmware_UpdateFirmwareVersion/firmware_UpdateFirmwareVersion.py
@@ -24,9 +24,9 @@
def check_firmware_version(self, expected_ver):
"""Checks the firmware version."""
- actual_ver = self.faft_client.Bios.GetVersion(
+ actual_ver = self.faft_client.bios.get_version(
'b' if self.fw_vboot2 else 'a')
- actual_tpm_fwver = self.faft_client.Tpm.GetFirmwareVersion()
+ actual_tpm_fwver = self.faft_client.tpm.get_firmware_version()
if actual_ver != expected_ver or actual_tpm_fwver != expected_ver:
raise error.TestFail(
'Firmware version should be %s,'
@@ -50,27 +50,27 @@
# Update firmware if needed
if shellball_path:
self.set_hardware_write_protect(enable=False)
- self.faft_client.Updater.RunFactoryInstall()
+ self.faft_client.updater.run_factory_install()
self.switcher.mode_aware_reboot()
self.setup_usbkey(usbkey=True)
- self._fwid = self.faft_client.Updater.GetSectionFwid()
+ self._fwid = self.faft_client.updater.get_section_fwid()
- self.fw_ver_tpm = self.faft_client.Tpm.GetFirmwareVersion()
- actual_ver = self.faft_client.Bios.GetVersion('a')
+ self.fw_ver_tpm = self.faft_client.tpm.get_firmware_version()
+ actual_ver = self.faft_client.bios.get_version('a')
logging.info('Origin version is %s', actual_ver)
self._update_version = actual_ver + 1
logging.info('Firmware version will update to version %s',
self._update_version)
- self.faft_client.Updater.ResignFirmware(self._update_version)
- self.faft_client.Updater.RepackShellball('test')
+ self.faft_client.updater.resign_firmware(self._update_version)
+ self.faft_client.updater.repack_shellball('test')
def cleanup(self):
"""Cleanup after the test"""
try:
- if self.faft_client.Tpm.GetFirmwareVersion() != self.fw_ver_tpm:
+ if self.faft_client.tpm.get_firmware_version() != self.fw_ver_tpm:
self.reboot_and_reset_tpm()
self.restore_firmware()
self.invalidate_firmware_setup()
@@ -85,11 +85,11 @@
'fwid': self._fwid
}))
self.check_state((self.checkers.fw_tries_checker, 'A'))
- self.faft_client.Updater.RunAutoupdate('test')
+ self.faft_client.updater.run_autoupdate('test')
self.switcher.mode_aware_reboot()
logging.info("Copy firmware form B to A.")
- self.faft_client.Updater.RunBootok('test')
+ self.faft_client.updater.run_bootok('test')
self.check_state((self.checkers.fw_tries_checker, 'B'))
self.switcher.mode_aware_reboot()
@@ -97,7 +97,7 @@
self.check_state((self.checkers.fw_tries_checker,
'B' if self.fw_vboot2 else 'A'))
self.check_firmware_version(self._update_version)
- self.faft_client.Updater.RunRecovery()
+ self.faft_client.updater.run_recovery()
self.reboot_and_reset_tpm()
logging.info("Check Rollback version.")
diff --git a/server/site_tests/firmware_UpdateKernelDataKeyVersion/firmware_UpdateKernelDataKeyVersion.py b/server/site_tests/firmware_UpdateKernelDataKeyVersion/firmware_UpdateKernelDataKeyVersion.py
index 29b4632..c163e5c 100644
--- a/server/site_tests/firmware_UpdateKernelDataKeyVersion/firmware_UpdateKernelDataKeyVersion.py
+++ b/server/site_tests/firmware_UpdateKernelDataKeyVersion/firmware_UpdateKernelDataKeyVersion.py
@@ -20,7 +20,7 @@
def check_kernel_datakey_version(self, expected_ver):
"""Checks the kernel datakey version."""
- actual_ver = self.faft_client.Kernel.GetDatakeyVersion('b')
+ actual_ver = self.faft_client.kernel.get_datakey_version('b')
if actual_ver != expected_ver:
raise error.TestFail(
'Kernel Version should be %s, but got %s.'
@@ -34,26 +34,26 @@
"""Resings the kernel datakey version."""
host.send_file(os.path.join(self.bindir,
'files/common.sh'),
- os.path.join(self.faft_client.Updater.GetTempPath(),
+ os.path.join(self.faft_client.updater.get_temp_path(),
'common.sh'))
host.send_file(os.path.join(self.bindir,
'files/make_keys.sh'),
- os.path.join(self.faft_client.Updater.GetTempPath(),
+ os.path.join(self.faft_client.updater.get_temp_path(),
'make_keys.sh'))
- self.faft_client.System.RunShellCommand('/bin/bash %s %s' % (
- os.path.join(self.faft_client.Updater.GetTempPath(),
+ self.faft_client.system.run_shell_command('/bin/bash %s %s' % (
+ os.path.join(self.faft_client.updater.get_temp_path(),
'make_keys.sh'),
self._update_version))
def modify_kernel_b_and_set_cgpt_priority(self, delta, target_dev):
"""Modifies kernel b and sets CGPT priority."""
if delta == 1:
- self.faft_client.Kernel.ResignWithKeys(
- 'b', self.faft_client.Updater.GetKeysPath())
+ self.faft_client.kernel.resign_with_keys(
+ 'b', self.faft_client.updater.get_keys_path())
elif delta == -1:
self.check_kernel_datakey_version(self._update_version)
- self.faft_client.Kernel.ResignWithKeys('b')
+ self.faft_client.kernel.resign_with_keys('b')
if target_dev == 'a':
self.reset_and_prioritize_kernel('a')
@@ -66,7 +66,7 @@
self.switcher.setup_mode('dev' if dev_mode else 'normal')
- actual_ver = self.faft_client.Kernel.GetDatakeyVersion('b')
+ actual_ver = self.faft_client.kernel.get_datakey_version('b')
logging.info('Original Kernel Version of KERN-B is %s', actual_ver)
self._update_version = actual_ver + 1
diff --git a/server/site_tests/firmware_UpdateKernelSubkeyVersion/firmware_UpdateKernelSubkeyVersion.py b/server/site_tests/firmware_UpdateKernelSubkeyVersion/firmware_UpdateKernelSubkeyVersion.py
index 40db216..83d4201 100644
--- a/server/site_tests/firmware_UpdateKernelSubkeyVersion/firmware_UpdateKernelSubkeyVersion.py
+++ b/server/site_tests/firmware_UpdateKernelSubkeyVersion/firmware_UpdateKernelSubkeyVersion.py
@@ -24,21 +24,21 @@
"""Resigns the kernel subkey version."""
host.send_file(os.path.join(self.bindir,
'files/common.sh'),
- os.path.join(self.faft_client.Updater.GetTempPath(),
+ os.path.join(self.faft_client.updater.get_temp_path(),
'common.sh'))
host.send_file(os.path.join(self.bindir,
'files/make_keys.sh'),
- os.path.join(self.faft_client.Updater.GetTempPath(),
+ os.path.join(self.faft_client.updater.get_temp_path(),
'make_keys.sh'))
- self.faft_client.System.RunShellCommand('/bin/bash %s %s' % (
- os.path.join(self.faft_client.Updater.GetTempPath(),
+ self.faft_client.system.run_shell_command('/bin/bash %s %s' % (
+ os.path.join(self.faft_client.updater.get_temp_path(),
'make_keys.sh'),
self._update_version))
def check_kernel_subkey_version(self, expected_ver):
"""Checks the kernel subkey version."""
- actual_ver = self.faft_client.Bios.GetKernelSubkeyVersion(
+ actual_ver = self.faft_client.bios.get_kernel_subkey_version(
'b' if self.fw_vboot2 else 'a')
if actual_ver != expected_ver:
raise error.TestFail(
@@ -63,20 +63,20 @@
# Update firmware if needed
if shellball_path:
self.set_hardware_write_protect(enable=False)
- self.faft_client.Updater.RunFactoryInstall()
+ self.faft_client.updater.run_factory_install()
self.switcher.mode_aware_reboot()
- self._fwid = self.faft_client.Updater.GetSectionFwid()
+ self._fwid = self.faft_client.updater.get_section_fwid()
- ver = self.faft_client.Bios.GetKernelSubkeyVersion('a')
+ ver = self.faft_client.bios.get_kernel_subkey_version('a')
logging.info('Origin version is %s', ver)
self._update_version = ver + 1
logging.info('Kernel subkey version will update to version %s',
self._update_version)
self.resign_kernel_subkey_version(host)
- self.faft_client.Updater.ResignFirmware(1)
- self.faft_client.Updater.RepackShellball('test')
+ self.faft_client.updater.resign_firmware(1)
+ self.faft_client.updater.repack_shellball('test')
def cleanup(self):
"""Cleanup after the test"""
@@ -94,14 +94,14 @@
'fwid': self._fwid
}))
self.check_state((self.checkers.fw_tries_checker, 'A'))
- self.faft_client.Updater.RunAutoupdate('test')
+ self.faft_client.updater.run_autoupdate('test')
self.switcher.mode_aware_reboot()
logging.info("Check firmware data key version and Rollback.")
- self.faft_client.Updater.RunBootok('test')
+ self.faft_client.updater.run_bootok('test')
self.check_state((self.checkers.fw_tries_checker, 'B'))
self.check_kernel_subkey_version(self._update_version)
- self.faft_client.Updater.RunRecovery()
+ self.faft_client.updater.run_recovery()
self.switcher.mode_aware_reboot()
logging.info("Check Rollback version.")
diff --git a/server/site_tests/firmware_UpdateKernelVersion/firmware_UpdateKernelVersion.py b/server/site_tests/firmware_UpdateKernelVersion/firmware_UpdateKernelVersion.py
index 3d71e94..0c50372 100644
--- a/server/site_tests/firmware_UpdateKernelVersion/firmware_UpdateKernelVersion.py
+++ b/server/site_tests/firmware_UpdateKernelVersion/firmware_UpdateKernelVersion.py
@@ -19,7 +19,7 @@
def check_kernel_version(self, expected_ver):
"""Checks the kernel version."""
- actual_ver = self.faft_client.Kernel.GetVersion('b')
+ actual_ver = self.faft_client.kernel.get_version('b')
if actual_ver != expected_ver:
raise error.TestFail(
'Kernel Version should be %s, but got %s.'
@@ -32,10 +32,10 @@
def modify_kernel_b_and_set_cgpt_priority(self, delta, target_dev):
"""Modifies kernel B and sets CGPT priority."""
if delta == 1:
- self.faft_client.Kernel.MoveVersionForward('b')
+ self.faft_client.kernel.move_version_forward('b')
elif delta == -1:
self.check_kernel_version(self._update_version)
- self.faft_client.Kernel.MoveVersionBackward('b')
+ self.faft_client.kernel.move_version_backward('b')
if target_dev == 'a':
self.reset_and_prioritize_kernel('a')
@@ -48,7 +48,7 @@
self.switcher.setup_mode('dev' if dev_mode else 'normal')
- actual_ver = self.faft_client.Kernel.GetVersion('b')
+ actual_ver = self.faft_client.kernel.get_version('b')
logging.info('Original Kernel Version of KERN-B is %s', actual_ver)
self._update_version = actual_ver + 1
diff --git a/server/site_tests/firmware_UpdaterModes/firmware_UpdaterModes.py b/server/site_tests/firmware_UpdaterModes/firmware_UpdaterModes.py
index 2d8bfb2..d574eea 100644
--- a/server/site_tests/firmware_UpdaterModes/firmware_UpdaterModes.py
+++ b/server/site_tests/firmware_UpdaterModes/firmware_UpdaterModes.py
@@ -38,7 +38,7 @@
def get_bios_fwids(self, path=None):
"""Return the BIOS fwids for the given file"""
- return self.faft_client.Updater.GetAllInstalledFwids('bios', path)
+ return self.faft_client.updater.get_all_installed_fwids('bios', path)
def run_case(self, mode, write_protected, written, modify_ro=True,
should_abort=False, writes_gbb=False):
@@ -52,13 +52,14 @@
@param writes_gbb: if True, the updater should rewrite gbb flags.
@return: a list of failure messages for the case
"""
- self.faft_client.Updater.ResetShellball()
+ self.faft_client.updater.reset_shellball()
- fake_bios_path = self.faft_client.Updater.CopyBios('fake-bios.bin')
- self.faft_client.Updater.SetImageGbbFlags(0, fake_bios_path)
+ fake_bios_path = self.faft_client.updater.copy_bios('fake-bios.bin')
+ self.faft_client.updater.set_image_gbb_flags(0, fake_bios_path)
before_fwids = {'bios': self.get_bios_fwids(fake_bios_path)}
- before_gbb = self.faft_client.Updater.GetImageGbbFlags(fake_bios_path)
+ before_gbb = self.faft_client.updater.get_image_gbb_flags(
+ fake_bios_path)
case_desc = ('chromeos-firmwareupdate --mode=%s --wp=%s'
% (mode, write_protected))
@@ -72,19 +73,19 @@
# Repack the shellball with modded fwids
self.modify_shellball(append, modify_ro)
modded_fwids = self.identify_shellball()
- image_gbb = self.faft_client.Updater.GetImageGbbFlags()
+ image_gbb = self.faft_client.updater.get_image_gbb_flags()
options = ['--emulate', fake_bios_path, '--wp=%s' % write_protected]
logging.info("%s (should write %s)", case_desc,
', '.join(written).upper() or 'nothing')
- rc = self.faft_client.Updater.RunFirmwareupdate(mode, append, options)
+ rc = self.faft_client.updater.run_firmwareupdate(mode, append, options)
if should_abort and rc != 0:
logging.debug('updater aborted as expected')
after_fwids = {'bios': self.get_bios_fwids(fake_bios_path)}
- after_gbb = self.faft_client.Updater.GetImageGbbFlags(fake_bios_path)
+ after_gbb = self.faft_client.updater.get_image_gbb_flags(fake_bios_path)
expected_written = {'bios': written or []}
errors = self.check_fwids_written(
diff --git a/server/site_tests/firmware_UserRequestRecovery/firmware_UserRequestRecovery.py b/server/site_tests/firmware_UserRequestRecovery/firmware_UserRequestRecovery.py
index 0c2bca0..62d0bd6 100644
--- a/server/site_tests/firmware_UserRequestRecovery/firmware_UserRequestRecovery.py
+++ b/server/site_tests/firmware_UserRequestRecovery/firmware_UserRequestRecovery.py
@@ -50,7 +50,7 @@
'mainfw_type': 'developer' if dev_mode else 'normal',
}))
# Execute on DUT: crossystem recovery_request=193
- self.faft_client.System.RequestRecoveryBoot()
+ self.faft_client.system.request_recovery_boot()
# Execute from desktop:
# dut-control warm_reset:on sleep:0.5000 warm_reset:off
self.switcher.simple_reboot()
@@ -70,7 +70,7 @@
'recovery_reason' : vboot.RECOVERY_REASON['US_TEST'],
}))
- self.faft_client.System.RequestRecoveryBoot()
+ self.faft_client.system.request_recovery_boot()
self.switcher.simple_reboot()
self.switcher.bypass_rec_mode()
self.switcher.wait_for_client()
diff --git a/server/site_tests/firmware_WilcoDiagnosticsMode/firmware_WilcoDiagnosticsMode.py b/server/site_tests/firmware_WilcoDiagnosticsMode/firmware_WilcoDiagnosticsMode.py
index e83afaf..1f76fd6 100644
--- a/server/site_tests/firmware_WilcoDiagnosticsMode/firmware_WilcoDiagnosticsMode.py
+++ b/server/site_tests/firmware_WilcoDiagnosticsMode/firmware_WilcoDiagnosticsMode.py
@@ -54,24 +54,24 @@
# image, and write a new firmware image with that corrupt diagnostics
# image.
local_filename = 'diag.bin'
- cbfs_work_dir = self.faft_client.Updater.CbfsSetupWorkDir()
+ cbfs_work_dir = self.faft_client.updater.cbfs_setup_work_dir()
bios_cbfs_path = os.path.join(cbfs_work_dir,
- self.faft_client.Updater.GetBiosRelativePath())
+ self.faft_client.updater.get_bios_relative_path())
diag_cbfs_path = os.path.join(cbfs_work_dir, local_filename)
logging.info('Extracting diagnostics')
- self.faft_client.Updater.CbfsExtractDiagnostics(self.DIAG_CBFS_NAME,
+ self.faft_client.updater.cbfs_extract_diagnostics(self.DIAG_CBFS_NAME,
local_filename)
logging.info('Corrupting diagnostics')
- self.faft_client.Updater.CorruptDiagnosticsImage(local_filename)
+ self.faft_client.updater.corrupt_diagnostics_image(local_filename)
logging.info('Replacing diagnostics')
- self.faft_client.Updater.CbfsReplaceDiagnostics(self.DIAG_CBFS_NAME,
+ self.faft_client.updater.cbfs_replace_diagnostics(self.DIAG_CBFS_NAME,
local_filename)
logging.info('Writing back BIOS')
- self.faft_client.Bios.WriteWhole(bios_cbfs_path)
+ self.faft_client.bios.write_whole(bios_cbfs_path)
self.switcher.mode_aware_reboot()
def _press_f12(self):
@@ -117,7 +117,7 @@
# diagnostics mode, and verify that the DUT goes down (indicating
# success).
logging.info('Updating firmware')
- self.faft_client.Updater.RunAutoupdate(None)
+ self.faft_client.updater.run_autoupdate(None)
logging.info('Rebooting to apply firmware update')
self.switcher.mode_aware_reboot()
diff --git a/server/site_tests/platform_FlashErasers/platform_FlashErasers.py b/server/site_tests/platform_FlashErasers/platform_FlashErasers.py
index c40038b..51fb47c 100644
--- a/server/site_tests/platform_FlashErasers/platform_FlashErasers.py
+++ b/server/site_tests/platform_FlashErasers/platform_FlashErasers.py
@@ -27,7 +27,7 @@
"""
command = command + ' 2>&1'
logging.info('Execute %s', command)
- output = self.faft_client.System.RunShellCommandGetOutput(command)
+ output = self.faft_client.system.run_shell_command_get_output(command)
logging.info('Output >>> %s <<<', output)
if checkfor and checkfor not in '\n'.join(output):
raise error.TestFail('Expect %s in output of %s' %
@@ -94,7 +94,7 @@
else:
raise error.TestFail('Unexpected active fw %s' % active_fw)
- dut_work_path = self.faft_client.Updater.GetWorkPath()
+ dut_work_path = self.faft_client.updater.get_work_path()
# Sizes to try to erase.
test_sizes = (4096, 4096 * 2, 4096 * 4, 4096 * 8, 4096 * 16)
diff --git a/server/site_tests/platform_Flashrom/platform_Flashrom.py b/server/site_tests/platform_Flashrom/platform_Flashrom.py
index 97c6e07..c99645d 100644
--- a/server/site_tests/platform_Flashrom/platform_Flashrom.py
+++ b/server/site_tests/platform_Flashrom/platform_Flashrom.py
@@ -37,7 +37,7 @@
"""
command = command + ' 2>&1'
logging.info('Execute %s', command)
- output = self.faft_client.System.RunShellCommandGetOutput(command)
+ output = self.faft_client.system.run_shell_command_get_output(command)
logging.info('Output >>> %s <<<', output)
if checkfor and checkfor not in '\n'.join(output):
raise error.TestFail('Expect %s in output of %s' %
@@ -88,13 +88,13 @@
# 5) Compare flash section B vs shellball section B
# 5.1) Extract shellball RW section B form the appropriate bios.bin
# found the firmware tarball on the DUT.
- self.faft_client.Updater.ExtractShellball()
+ self.faft_client.updater.extract_shellball()
shball_bios = os.path.join(
- self.faft_client.Updater.GetWorkPath(),
- self.faft_client.Updater.GetBiosRelativePath())
+ self.faft_client.updater.get_work_path(),
+ self.faft_client.updater.get_bios_relative_path())
# Temp file to store a section read from the chip.
shball_rw_b = os.path.join(
- self.faft_client.Updater.GetWorkPath(),
+ self.faft_client.updater.get_work_path(),
'shball_rw_b.bin')
logging.info('Using fw image %s, temp file %s',
shball_bios, shball_rw_b)
diff --git a/server/site_tests/platform_S0ixCycle/platform_S0ixCycle.py b/server/site_tests/platform_S0ixCycle/platform_S0ixCycle.py
index c642c16..198149f 100644
--- a/server/site_tests/platform_S0ixCycle/platform_S0ixCycle.py
+++ b/server/site_tests/platform_S0ixCycle/platform_S0ixCycle.py
@@ -46,7 +46,7 @@
# check S0ix state transition
if not self.wait_power_state('S0', POWER_STATE_RETRY_COUNT):
raise error.TestFail('Platform failed to reach S0 state.')
- self.faft_client.System.RunShellCommand(
+ self.faft_client.system.run_shell_command(
'echo freeze > /sys/power/state &')
time.sleep(SUSPEND_WAIT_TIME_SECONDS)
# check S0ix state transition
@@ -79,7 +79,7 @@
Check this device is a SKL based ChromeBook.
"""
skl_boards = ('Kunimitsu', 'Lars', 'Glados', 'Chell', 'Sentry')
- output = self.faft_client.System.GetPlatformName()
+ output = self.faft_client.system.get_platform_name()
return output in skl_boards
def is_s0ix_supported(self):
@@ -87,7 +87,7 @@
Check this device supports suspend to idle.
"""
cmd = 'cat /var/lib/power_manager/suspend_to_idle'
- output = self.faft_client.System.RunShellCommandGetOutput(cmd)
+ output = self.faft_client.system.run_shell_command_get_output(cmd)
if not output:
return False
else:
diff --git a/server/site_tests/platform_S3Cycle/platform_S3Cycle.py b/server/site_tests/platform_S3Cycle/platform_S3Cycle.py
index a20cf17..24daf7d 100644
--- a/server/site_tests/platform_S3Cycle/platform_S3Cycle.py
+++ b/server/site_tests/platform_S3Cycle/platform_S3Cycle.py
@@ -45,7 +45,8 @@
# check S0 state transition
if not self.wait_power_state('S0', POWER_STATE_RETRY_COUNT):
raise error.TestFail('Platform failed to reach S0 state.')
- self.faft_client.System.RunShellCommand('echo mem > /sys/power/state &')
+ self.faft_client.system.run_shell_command(
+ 'echo mem > /sys/power/state &')
time.sleep(SUSPEND_WAIT_TIME_SECONDS);
# check S3 state transition
if not self.wait_power_state('S3', POWER_STATE_RETRY_COUNT):