Audio test: Use correct exception to indicate test failed.
Raise TestFail when RMS value below threshold, and raise TestError
when there's problem in test flow. So we can clearly distinguish
them from test dash board.
BUG=None
TEST=None
Change-Id: I89b9df4f66eac7282059591d628aa45c76b49ac2
Reviewed-on: https://gerrit.chromium.org/gerrit/47129
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
diff --git a/client/cros/audio/audio_helper.py b/client/cros/audio/audio_helper.py
index 3b6e18e..011b041 100644
--- a/client/cros/audio/audio_helper.py
+++ b/client/cros/audio/audio_helper.py
@@ -327,6 +327,7 @@
sox_output: The output from sox stat command.
Raises:
+ error.TestError if RMS amplitude can't be parsed.
error.TestFail if the RMS amplitude of the recording isn't above
the threshold.
"""
@@ -340,7 +341,7 @@
logging.info('Got audio RMS value of %f. Minimum pass is %f.' %
(rms_val, self._sox_threshold))
if rms_val < self._sox_threshold:
- raise error.TestError(
+ raise error.TestFail(
'Audio RMS value %f too low. Minimum pass is %f.' %
(rms_val, self._sox_threshold))