Create a simple aplay test that can be used in other suites.
This way the aplay test can be run in bvt or kernel_per-build_regression
and also easily run by suspend/resume suites.
Add test to run in serial in SuspendStress.
Add test to run in parallel in SuspendStress.
Add test to run in serial in CheckAfterSuspend.
BUG=None
TEST=./run_remote_tests.sh --remote=w.x.y.z --board=link audiovideo_Aplay
TEST=./run_remote_tests.sh --remote=w.x.y.z --board=link \
client/site_tests/power_SuspendStress/control.audioPerBuild
TEST=./run_remote_tests.sh --remote=w.x.y.z --board=link --use_emerged \
client/site_tests/power_SuspendStress/control.barePerBuild
TEST=./run_remote_tests.sh --remote=w.x.y.z --board=link \
client/site_tests/power_CheckAfterSuspend/control.per_build
Change-Id: Ieea9dbb6afd072812851e6db799fd2bc887f1023
Reviewed-on: https://gerrit.chromium.org/gerrit/46967
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Mike Truty <truty@chromium.org>
Tested-by: Mike Truty <truty@chromium.org>
diff --git a/client/bin/site_utils.py b/client/bin/site_utils.py
index 4e44bf4..679d88f 100644
--- a/client/bin/site_utils.py
+++ b/client/bin/site_utils.py
@@ -309,3 +309,27 @@
if key_value:
result[key_value.group('key')] = key_value.group('value')
return result
+
+
+def set_from_keyval_output(out, delimiter=' '):
+ """Parse delimiter-separated key-val output into a set of tuples.
+
+ Output is expected to be multiline text output from a command.
+ Stuffs the key-vals into tuples in a set to be later compared.
+
+ e.g. deactivated 0
+ disableForceClear 0
+ ==> set(('deactivated', '0'), ('disableForceClear', '0'))
+
+ @param out: multiple lines of space-separated key-val pairs.
+ @param delimiter: character that separates key from val. Usually a
+ space but may be '=' or something else.
+ @return set of key-val tuples.
+ """
+ results = set()
+ kv_match_re = re.compile('([^ ]+)%s(.*)' % delimiter)
+ for linecr in out.splitlines():
+ match = kv_match_re.match(linecr.strip())
+ if match:
+ results.add((match.group(1), match.group(2)))
+ return results