From 3ea094fc8ed722bbc0e40cc79e23d38c51078278 Mon Sep 17 00:00:00 2001 From: Maciej Kisielewski Date: Wed, 5 Aug 2015 13:24:14 +0200 Subject: providers:checkbox: use suspend logic in pm_test Signed-off-by: Maciej Kisielewski --- bin/pm_test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bin') diff --git a/bin/pm_test b/bin/pm_test index c9cfd4bf..7c614919 100755 --- a/bin/pm_test +++ b/bin/pm_test @@ -91,6 +91,7 @@ class PowerManagementOperation(object): self.check_last_cycle_duration() if self.args.repetitions > 0: + self.run_suspend_cycles(self.args.suspends_before_reboot) self.run_pm_command() else: self.summary() @@ -150,6 +151,18 @@ class PowerManagementOperation(object): subprocess.check_call(command_str, shell=True) signal.pause() + def run_suspend_cycles(self, cycles_count): + """Run suspend and resume cycles.""" + if cycles_count < 1: + return + sleep_test_path = os.path.join( + os.path.dirname(os.path.realpath(__file__)), 'sleep_test') + command_str = '{} -s mem -p -i {} -w 10'.format( + sleep_test_path, cycles_count) + logging.info('Running suspend/resume cycles') + logging.debug('Executing: {0!r}...'.format(command_str)) + subprocess.check_call(command_str, shell=True) + def summary(self): """ Gather hardware information for the last time, -- cgit v1.2.3