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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
Index: client/site_tests/platform_CryptohomeStress/platform_CryptohomeStress.py
diff --git a/client/site_tests/platform_CryptohomeStress/platform_CryptohomeStress.py b/client/site_tests/platform_CryptohomeStress/platform_CryptohomeStress.py
new file mode 100644
index 0000000000000000000000000000000000000000..3bad4e6aa40176d6e8c60d7366997069960af015
--- /dev/null
+++ b/client/site_tests/platform_CryptohomeStress/platform_CryptohomeStress.py
@@ -0,0 +1,42 @@
+# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+import os, random, subprocess, time
+import commands, logging, random, time, utils
+from autotest_lib.client.bin import site_utils, test
+from autotest_lib.client.common_lib import error
+
+SUSPEND_START = '/tmp/power_state_cycle_begin'
+SUSPEND_END = '/tmp/power_state_cycle_end'
+CRYPTOHOMESTRESS_START = '/tmp/cryptohomestress_begin'
+CRYPTOHOMESTRESS_END = '/tmp/cryptohomestress_end'
+
+class platform_CryptohomeStress(test.test):
+ version = 1
+ def initialize(self):
+ for signal_file in [SUSPEND_END, CRYPTOHOMESTRESS_END]:
+ if os.path.exists(signal_file):
+ logging.warning('removing existing stop file %s' % signal_file)
+ os.unlink(signal_file)
+ random.seed() # System time is fine.
+
+
+ def run_once(self, runtime=300):
+ # check that fio has started, waiting for up to TIMEOUT
+ site_utils.poll_for_condition(
+ lambda: os.path.exists(CRYPTOHOMESTRESS_START),
+ error.TestFail('fiostress not triggered.'),
+ timeout=30, sleep_interval=1)
+ open(SUSPEND_START, 'w').close()
+ # Pad disk stress runtime by 60s for safety.
+ runtime = runtime + 60
+ site_utils.poll_for_condition(
+ lambda: os.path.exists(CRYPTOHOMESTRESS_END),
+ error.TestFail('fiostress runtime exceeded.'),
+ timeout=runtime, sleep_interval=10)
+
+ def cleanup(self):
+ open(SUSPEND_END, 'w').close()
+

Powered by Google App Engine
This is Rietveld 408576698