Replace "showkey" with client autotest
FAFTSetup, ECLidSwitch, and ECPowerButton all rely on
the showkey utility which doesn't run on freon. So,
this change adds a client side autotest that reads
evdev input and verifies it matches the passed in
expected output, and then modifies each of the
aforementioned tests to invoke the client side test
BUG=chrome-os-partner:35025
TEST=run FAFTSetup on Peppy with servo and verify that
the correct keys sent pass, incorrect keys sent fail
with "Keys mismatched" and no keys sent fail with
"No keys pressed"
Change-Id: I3b667a91b7f2ed84a6e91460f554d53a857a1373
Reviewed-on: https://chromium-review.googlesource.com/266771
Tested-by: danny chan <dchan@chromium.org>
Reviewed-by: danny chan <dchan@chromium.org>
Reviewed-by: David Sodman <dsodman@chromium.org>
Commit-Queue: danny chan <dchan@chromium.org>
diff --git a/client/cros/faft/rpc_functions.py b/client/cros/faft/rpc_functions.py
index 5157ef7..05408c9 100755
--- a/client/cros/faft/rpc_functions.py
+++ b/client/cros/faft/rpc_functions.py
@@ -13,6 +13,7 @@
from autotest_lib.client.cros.faft.utils import (cgpt_state,
cgpt_handler,
chromeos_interface,
+ firmware_check_keys,
firmware_updater,
flashrom_handler,
kernel_handler,
@@ -144,6 +145,7 @@
self._rootfs_handler.init(self._chromeos_interface)
self._updater = firmware_updater.FirmwareUpdater(self._chromeos_interface)
+ self._check_keys = firmware_check_keys.firmwareCheckKeys()
# Initialize temporary directory path
self._temp_path = '/var/tmp/faft/autest'
@@ -789,6 +791,13 @@
"""
return self._rootfs_handler.verify_rootfs(section)
+ def _system_check_keys(self, expected_sequence):
+ """Check the keys sequence was as expected.
+
+ @param expected_sequence: A list of expected key sequences.
+ """
+ return self._check_keys.check_keys(expected_sequence)
+
def cleanup(self):
"""Cleanup for the RPC server. Currently nothing."""
pass