diff options
| author | Pierre Equoy <pierre.equoy@canonical.com> | 2016-02-01 15:39:49 +0800 |
|---|---|---|
| committer | Pierre Equoy <pierre.equoy@canonical.com> | 2016-02-01 15:39:49 +0800 |
| commit | ac4574716960060246f12cf865add85dabca3041 (patch) | |
| tree | dbb34d46350d381d9fdda27813588aff147ad3fa /bin | |
| parent | 06d800de4cfe50a27976f732cd4d14c16b3e99cf (diff) | |
plainbox-provider-checkbox: Fix crash in pm_test
If FWTS, which is optionally called when running suspend tests with the pm_test script, returns 1 (e.g. it finds any failure during the tests), pm_test will raise an uncatched exception and will make plainbox crash. Now, we catch this exception and log it. We also add `--s3-device-check` option when calling fwts_test.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/pm_test | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/pm_test b/bin/pm_test index c2e0efb5..62d039b8 100755 --- a/bin/pm_test +++ b/bin/pm_test @@ -139,7 +139,7 @@ class PowerManagementOperation(object): return if fwts: script_name = 'fwts_test' - command_tpl = '{} -s s3 --s3-sleep-delay=30 --s3-multiple={}' + command_tpl = '{} -s s3 --s3-device-check --s3-sleep-delay=30 --s3-multiple={}' else: script_name = 'sleep_test' command_tpl = '{} -s mem -p -i {} -w 10' @@ -148,10 +148,14 @@ class PowerManagementOperation(object): command_str = command_tpl.format(script_path, cycles_count) logging.info('Running suspend/resume cycles') logging.debug('Executing: {0!r}...'.format(command_str)) - # We call sleep_test script and log its output as it contains - # average times we need to compute global average times later. - logging.info(subprocess.check_output(command_str, - universal_newlines=True, shell=True)) + try: + # We call sleep_test or fwts_test script and log its output as it + # contains average times we need to compute global average times later. + logging.info(subprocess.check_output(command_str, + universal_newlines=True, shell=True)) + except subprocess.CalledProcessError as e: + logging.error('Error while running {0}:'.format(e.cmd)) + logging.error(e.output) def summary(self): """ |
