input_playback: Do not throw an exception if wacom_flash does not exist
Some platforms use a panel with a wacom touchscreen interface, but their
system images are built without wacom tools (ie they are built without
INPUT_DEVICE="wacom").
In this case, a 'stylus' device will still show in the device list, however
the image will not have wacom_flash.
Just silently ignore this case rather than throwing an exception.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=b:62335264
TEST=(1) attach soraka touchscreen controller
(2) test_that ${IP} accessibility_Sanity
=> Test does not fail b/c it cannot find wacom_flash
Change-Id: Iff47635379b39961347a2cb01b5ef698b9fa7610
Reviewed-on: https://chromium-review.googlesource.com/523887
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Katherine Threlkeld <kathrelkeld@chromium.org>
Reviewed-by: Charlie Mooney <charliemooney@chromium.org>
diff --git a/client/cros/input_playback/input_playback.py b/client/cros/input_playback/input_playback.py
index 0c2226f..c03f1d3 100644
--- a/client/cros/input_playback/input_playback.py
+++ b/client/cros/input_playback/input_playback.py
@@ -291,7 +291,10 @@
if len(contents_of_input_folder) != 0:
i2c_name = i2c_path[len('/dev/'):]
cmd = 'wacom_flash dummy -a %s' % i2c_name
- fw_id = utils.run(cmd).stdout.split()[-1]
+ # Do not throw an exception if wacom_flash does not exist.
+ result = utils.run(cmd, ignore_status=True)
+ if result.exit_status == 0:
+ fw_id = result.stdout.split()[-1]
break
if fw_id == '':