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

Unified Diff: server/site_tests/platform_CryptohomeSyncStressServer/platform_CryptohomeSyncStressServer.py

Issue 3465002: Add Sentry power strip control and cryptohome/sync stress test (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git
Patch Set: Mistake: iterations is already an autotest parameter for run_tests() Created 10 years, 3 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
« no previous file with comments | « server/site_tests/platform_CryptohomeSyncStressServer/control ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/site_tests/platform_CryptohomeSyncStressServer/platform_CryptohomeSyncStressServer.py
diff --git a/server/site_tests/platform_CryptohomeSyncStressServer/platform_CryptohomeSyncStressServer.py b/server/site_tests/platform_CryptohomeSyncStressServer/platform_CryptohomeSyncStressServer.py
new file mode 100644
index 0000000000000000000000000000000000000000..f6ee95718a71a4b1feaa2339f4a7480977af2197
--- /dev/null
+++ b/server/site_tests/platform_CryptohomeSyncStressServer/platform_CryptohomeSyncStressServer.py
@@ -0,0 +1,43 @@
+# 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 random, time
+from autotest_lib.client.common_lib import error, power_strip
+from autotest_lib.server import autotest, test
+
+class platform_CryptohomeSyncStressServer(test.test):
+ version = 1
+ max_delay = 120
+
+ def run_once(self, host, power_addr, outlet, username, password):
+ # check parameters
+ if power_addr == None:
+ raise error.TestFail('Missing power_addr argument.')
+ if outlet == None:
+ raise error.TestFail('Missing outlet argument.')
+ if username == None:
+ raise error.TestFail('Missing user parameter.')
+ if password == None:
+ raise error.TestFail('Missing pass parameter.')
+
+ outlet = int(outlet)
+
+ at = autotest.Autotest(host)
+ boot_id = host.get_boot_id()
+
+ # log in and verify things work
+ self.job.set_state('client_fail', True)
+ at.run_test('platform_CryptohomeSyncStress',
+ username=username, password=password)
+ if self.job.get_state('client_fail'):
+ raise error.TestFail('Client test failed')
+
+ # wait for some delay
+ delay = random.randint(0, self.max_delay)
+ print 'Delaying for %s seconds and then restarting.' % (delay)
+ time.sleep(delay)
+
+ # restart client
+ power_strip.PowerStrip(power_addr).reboot(outlet)
+ host.wait_for_restart(old_boot_id=boot_id)
« no previous file with comments | « server/site_tests/platform_CryptohomeSyncStressServer/control ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698