diff options
author | Pierre Equoy <pierre.equoy@canonical.com> | 2015-12-14 17:58:35 +0800 |
---|---|---|
committer | Pierre Equoy <pierre.equoy@canonical.com> | 2015-12-14 17:58:35 +0800 |
commit | 5c384d5ad205e6ec07260c90f0832f25b0975162 (patch) | |
tree | 589e476f441da121b83970f37edba0bc38554903 | |
parent | 076355b3536dc958a570e32af0d98da11c5970f9 (diff) |
providers/plainbox-provider-checkbox: increment version to 0.24c2plainbox-provider-checkbox-v0.24c2plainbox-provider-checkbox-v0.24
-rwxr-xr-x | bin/pm_test | 54 | ||||
-rw-r--r-- | jobs/stress.txt.in | 4 |
2 files changed, 24 insertions, 34 deletions
diff --git a/bin/pm_test b/bin/pm_test index 14116eb..c2e0efb 100755 --- a/bin/pm_test +++ b/bin/pm_test @@ -88,38 +88,18 @@ class PowerManagementOperation(object): """ logging.info('{0} operations remaining: {1}' .format(self.args.pm_operation, self.args.repetitions)) - - 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() - - def check_last_cycle_duration(self): - """ - Make sure that last cycle duration was reasonable, - that is, not too short, not too long - """ - min_pm_time = timedelta(seconds=self.args.min_pm_time) - # add time needed for suspend/resume cycles ( < 100s each) - max_pm_time = timedelta(seconds=self.args.max_pm_time + - self.args.suspends_before_reboot * 100) if self.args.pm_timestamp: pm_timestamp = datetime.fromtimestamp(self.args.pm_timestamp) now = datetime.now() pm_time = now - pm_timestamp - if pm_time < min_pm_time: - raise TestFailed('{0} time less than expected: {1} < {2}' - .format(self.args.pm_operation.capitalize(), - pm_time, min_pm_time)) - if pm_time > max_pm_time: - raise TestFailed('{0} time greater than expected: {1} > {2}' - .format(self.args.pm_operation.capitalize(), - pm_time, max_pm_time)) - logging.info('{0} time: {1}' .format(self.args.pm_operation.capitalize(), pm_time)) + if self.args.repetitions > 0: + self.run_suspend_cycles(self.args.suspends_before_reboot, + self.args.fwts) + self.run_pm_command() + else: + self.summary() def run_pm_command(self): """ @@ -153,14 +133,19 @@ class PowerManagementOperation(object): subprocess.check_call(command_str, shell=True) signal.pause() - def run_suspend_cycles(self, cycles_count): + def run_suspend_cycles(self, cycles_count, fwts): """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) + if fwts: + script_name = 'fwts_test' + command_tpl = '{} -s s3 --s3-sleep-delay=30 --s3-multiple={}' + 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) + 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 @@ -620,7 +605,7 @@ class AutoStartFile(object): [Desktop Entry] Name={pm_operation} test Comment=Verify {pm_operation} works properly -Exec=sudo /usr/bin/python3 {script} -r {repetitions} -w {wakeup} --hardware-delay {hardware_delay} --pm-delay {pm_delay} --min-pm-time {min_pm_time} --max-pm-time {max_pm_time} --append --total {total} --start {start} --pm-timestamp {pm_timestamp} {silent} --log-level={log_level} --log-dir={log_dir} --suspends-before-reboot={suspend_cycles} {pm_operation} +Exec=sudo /usr/bin/python3 {script} -r {repetitions} -w {wakeup} --hardware-delay {hardware_delay} --pm-delay {pm_delay} --min-pm-time {min_pm_time} --max-pm-time {max_pm_time} --append --total {total} --start {start} --pm-timestamp {pm_timestamp} {silent} --log-level={log_level} --log-dir={log_dir} --suspends-before-reboot={suspend_cycles} {fwts} {pm_operation} Type=Application X-GNOME-Autostart-enabled=true Hidden=false @@ -671,6 +656,7 @@ Hidden=false silent='--silent' if self.args.silent else '', log_level=self.args.log_level_str, log_dir=self.args.log_dir, + fwts='--fwts' if self.args.fwts else '', suspend_cycles=self.args.suspends_before_reboot, pm_operation=self.args.pm_operation)) logging.debug(contents) @@ -806,6 +792,10 @@ class MyArgumentParser(object): parser.add_argument('--suspends-before-reboot', type=int, default=0, help=('How many cycles of suspend/resume to run' 'before each reboot or poweroff')) + + # use fwts for suspend tests + parser.add_argument('--fwts', action='store_true', help=('Use fwts ' + 'when doing the suspend tests')) self.parser = parser def parse(self): diff --git a/jobs/stress.txt.in b/jobs/stress.txt.in index 64b064f..acd88c6 100644 --- a/jobs/stress.txt.in +++ b/jobs/stress.txt.in @@ -52,13 +52,13 @@ _description: plugin: shell category_id: 2013.com.canonical.plainbox::stress id: power-management/suspend_30_cycles_with_reboots -estimated_duration: 7200 +estimated_duration: 5400.0 depends: power-management/rtc suspend/suspend_advanced user: root command: - pm_test reboot --log-level=debug --log-dir=$PLAINBOX_SESSION_SHARE --suspends-before-reboot=30 -r 3 + pm_test reboot --fwts --log-level=debug --log-dir=$PLAINBOX_SESSION_SHARE --suspends-before-reboot=30 -r 3 _description: This is an automated stress test that will run a sequence of '30 suspend/resume cycles and one reboot' 3 times. |