autotest: make tests less fragile and more robust to uprev process
Some existing tests enumerate subsets of boards by name. This is inefficient
and toilsome with uprevs in this way: you see a test regression on the uprev,
spend time digging in to it and find that the fix is to change the test to
include $BOARD-kernelnext along side $BOARD. Test logic can be written to
expect and optional "-kernelnext" and cut out all this toil and inefficiency.
BUG=b:160605128
TEST=manual, ran test
Change-Id: Idfe62549d3c618ff9ae3d83200a159dde2eb34dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2283685
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Bob Brandt <brndt@google.com>
Tested-by: Bob Brandt <brndt@google.com>
Auto-Submit: Bob Brandt <brndt@google.com>
diff --git a/client/site_tests/audio_AlsaAPI/audio_AlsaAPI.py b/client/site_tests/audio_AlsaAPI/audio_AlsaAPI.py
index 7c6a0ed..610e30b 100644
--- a/client/site_tests/audio_AlsaAPI/audio_AlsaAPI.py
+++ b/client/site_tests/audio_AlsaAPI/audio_AlsaAPI.py
@@ -17,9 +17,7 @@
_PLAYBACK_DEVICE_NAME = '^pcmC(\d+)D(\d+)p$'
# A list of boards that do not correctly implement snd_pcm_drop, see
# crosbug.com/p/51882
- _BOARDS_WITHOUT_DROP_SUPPORT = [
- 'banon', 'elm', 'samus', 'samus-kernelnext', 'squawks'
- ]
+ _BOARDS_WITHOUT_DROP_SUPPORT = ['banon', 'elm', 'samus', 'squawks']
# A dict of list of (card name, device) to be skipped on some boards.
_DEVICES_TO_BE_SKIPPED = {
# On the following boards, devices 4,5,6 are HDMI devices.
@@ -47,7 +45,9 @@
# Skip test_drop on boards that do not implement snd_pcm_drop
# correctly, as it cannot pass.
board = utils.get_board().lower()
- if to_test == 'drop' and board in self._BOARDS_WITHOUT_DROP_SUPPORT:
+ if to_test == 'drop' and \
+ board.replace('-kernelnext', '') in \
+ self._BOARDS_WITHOUT_DROP_SUPPORT:
logging.info('Skipping test_drop for unsupported board: %s', board)
return
diff --git a/client/site_tests/touch_WakeupSource/touch_WakeupSource.py b/client/site_tests/touch_WakeupSource/touch_WakeupSource.py
index d600ecb..f848bab 100644
--- a/client/site_tests/touch_WakeupSource/touch_WakeupSource.py
+++ b/client/site_tests/touch_WakeupSource/touch_WakeupSource.py
@@ -20,9 +20,9 @@
# wake. If you wish to enable on previous devices, see furquan@ doc
# go/cros-trackpad-wake and/or consult chromeos-platform-power@ for more
# details.
- _NO_TOUCHPAD_WAKE = ['caroline', 'caroline-kernelnext', 'clapper', 'coral',
- 'elm-kernelnext', 'glimmer', 'hana-kernelnext', 'kevin'
- 'kukui', 'nami', 'pyro', 'veyron_minnie']
+ _NO_TOUCHPAD_WAKE = ['caroline', 'clapper', 'coral', 'elm', 'glimmer',
+ 'hana', 'kevin', 'kukui', 'nami', 'pyro',
+ 'veyron_minnie']
# Devices with Synaptics touchpads that do not report wake source,
# or reference platforms like Rambi which are broken but do not ship,
@@ -109,7 +109,8 @@
if source is None or source == 'touchpad':
if (self._has_touchpad and
self._platform not in self._INVALID_TOUCHPADS):
- if self._platform in self._NO_TOUCHPAD_WAKE:
+ if self._platform.replace('-kernelnext', '') in \
+ self._NO_TOUCHPAD_WAKE:
if self._is_wake_source('touchpad'):
raise error.TestFail('Touchpad is a wake source!')
else:
diff --git a/server/site_tests/display_Resolution/display_Resolution.py b/server/site_tests/display_Resolution/display_Resolution.py
index 686bb4f..0abf9ac 100644
--- a/server/site_tests/display_Resolution/display_Resolution.py
+++ b/server/site_tests/display_Resolution/display_Resolution.py
@@ -46,12 +46,14 @@
('EDIDv1', 1280, 800),
('EDIDv1', 1600, 900),
]
- INCOMPATIBLE_EDID_BOARDS = [ 'coral', 'eve', 'eve-kernelnext', 'grunt',
- 'nami', 'rammus', 'zork']
+ INCOMPATIBLE_EDID_BOARDS = ['coral', 'eve', 'grunt', 'nami', 'rammus',
+ 'zork']
def run_once(self, host, test_mirrored=False, test_suspend_resume=False,
test_reboot=False, test_lid_close_open=False,
resolution_list=None):
+ """Check conditions, do setup and run test.
+ """
# Check the servo object.
if test_lid_close_open and host.servo is None:
@@ -81,7 +83,8 @@
resolution_list = self.DEFAULT_RESOLUTION_LIST
# Remove board specific incompatible EDIDs.
- if board_name in self.INCOMPATIBLE_EDID_BOARDS:
+ if board_name.replace('-kernelnext', '') in \
+ self.INCOMPATIBLE_EDID_BOARDS:
for edid_value in self.INCOMPATIBLE_EDID_RESOLUTION_LIST:
if edid_value in resolution_list:
resolution_list.remove(edid_value)