From 58c3a2a0bb87aca226e57440d76e61d42241a253 Mon Sep 17 00:00:00 2001 From: Sylvain Pineau Date: Thu, 20 Jul 2017 15:29:36 +0200 Subject: Fix pm_tests to call checkbox-support-fwts_test Moreover fix the way the --log is passed to fwts_test as it has to be placed before the -s parameter since the rest of args are meant to be sent to fwts. --- bin/pm_test | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/pm_test b/bin/pm_test index 7eff96c..ea75ba8 100755 --- a/bin/pm_test +++ b/bin/pm_test @@ -137,16 +137,18 @@ class PowerManagementOperation(object): """Run suspend and resume cycles.""" if cycles_count < 1: return + script_path = '' if fwts: - script_name = 'fwts_test' - command_tpl = '{} -s s3 --s3-device-check --s3-sleep-delay=30 --s3-multiple={}' + script_path = 'checkbox-support-fwts_test' + command_tpl = '-s s3 --s3-device-check --s3-sleep-delay=30 --s3-multiple={}' if self.args.log_dir: - command_tpl += ' --log={}/fwts.log'.format(self.args.log_dir) + command_tpl = '--log={}/fwts.log '.format(self.args.log_dir) + command_tpl + command_tpl = '{} ' + command_tpl else: script_name = 'sleep_test' command_tpl = '{} -s mem -p -i {} -w 10' - script_path = os.path.join( - os.path.dirname(os.path.realpath(__file__)), script_name) + script_path = os.path.join( + os.path.dirname(os.path.realpath(__file__)), script_name) command_str = command_tpl.format(script_path, cycles_count) logging.info('Running suspend/resume cycles') logging.debug('Executing: {0!r}...'.format(command_str)) -- cgit v1.2.3 From f078d2abadc25d78f266a8ce6558485576d5e9d9 Mon Sep 17 00:00:00 2001 From: Sylvain Pineau Date: Thu, 20 Jul 2017 15:31:04 +0200 Subject: Stop logging tracebacks if fwts_test exits with errors (e.g HIGH FAILURES) --- bin/pm_test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pm_test b/bin/pm_test index ea75ba8..5fa6923 100755 --- a/bin/pm_test +++ b/bin/pm_test @@ -159,7 +159,7 @@ class PowerManagementOperation(object): universal_newlines=True, shell=True)) except subprocess.CalledProcessError as e: logging.error('Error while running {0}:'.format(e.cmd)) - logging.exception(e.output) + logging.error(e.output) def summary(self): """ -- cgit v1.2.3 From e61c7bc2a13b13d9fbb9d63071c08dc6fcb20476 Mon Sep 17 00:00:00 2001 From: Sylvain Pineau Date: Thu, 20 Jul 2017 17:58:54 +0200 Subject: pm_test: Log everything on stdout Red output while running the test from checkbox is so scary... --- bin/pm_test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/pm_test b/bin/pm_test index 5fa6923..ce50a51 100755 --- a/bin/pm_test +++ b/bin/pm_test @@ -711,9 +711,9 @@ class LoggingConfiguration(object): logger = logging.getLogger() logger.setLevel(logging.DEBUG) - # Log to sys.stderr using log level passed through command line + # Log to sys.stdout using log level passed through command line if log_level != logging.NOTSET: - log_handler = logging.StreamHandler() + log_handler = logging.StreamHandler(sys.stdout) formatter = logging.Formatter('%(levelname)-8s %(message)s') log_handler.setFormatter(formatter) log_handler.setLevel(log_level) -- cgit v1.2.3