Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: client/site_tests/platform_CryptohomeStress/platform_CryptohomeStress.py

Issue 3412036: Basis for cryptohome+power_SuspendResume stress test. (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: tweaks to test params Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5
6 import os, random, subprocess, time
7 import commands, logging, random, time, utils
8 from autotest_lib.client.bin import site_utils, test
9 from autotest_lib.client.common_lib import error
10
11 SUSPEND_START = '/tmp/power_state_cycle_begin'
12 SUSPEND_END = '/tmp/power_state_cycle_end'
13 CRYPTOHOMESTRESS_START = '/tmp/cryptohomestress_begin'
14 CRYPTOHOMESTRESS_END = '/tmp/cryptohomestress_end'
15
16 class platform_CryptohomeStress(test.test):
17 version = 1
18 def initialize(self):
19 for signal_file in [SUSPEND_END, CRYPTOHOMESTRESS_END]:
20 if os.path.exists(signal_file):
21 logging.warning('removing existing stop file %s' % signal_file)
22 os.unlink(signal_file)
23 random.seed() # System time is fine.
24
25
26 def run_once(self, runtime=300):
27 # check that fio has started, waiting for up to TIMEOUT
28 site_utils.poll_for_condition(
29 lambda: os.path.exists(CRYPTOHOMESTRESS_START),
30 error.TestFail('fiostress not triggered.'),
31 timeout=30, sleep_interval=1)
32 open(SUSPEND_START, 'w').close()
33 # Pad disk stress runtime by 60s for safety.
34 runtime = runtime + 60
35 site_utils.poll_for_condition(
36 lambda: os.path.exists(CRYPTOHOMESTRESS_END),
37 error.TestFail('fiostress runtime exceeded.'),
38 timeout=runtime, sleep_interval=10)
39
40 def cleanup(self):
41 open(SUSPEND_END, 'w').close()
42
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698