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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « server/site_tests/platform_CryptohomeSyncStressServer/control ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 import random, time
6 from autotest_lib.client.common_lib import error, power_strip
7 from autotest_lib.server import autotest, test
8
9 class platform_CryptohomeSyncStressServer(test.test):
10 version = 1
11 max_delay = 120
12
13 def run_once(self, host, power_addr, outlet, username, password):
14 # check parameters
15 if power_addr == None:
16 raise error.TestFail('Missing power_addr argument.')
17 if outlet == None:
18 raise error.TestFail('Missing outlet argument.')
19 if username == None:
20 raise error.TestFail('Missing user parameter.')
21 if password == None:
22 raise error.TestFail('Missing pass parameter.')
23
24 outlet = int(outlet)
25
26 at = autotest.Autotest(host)
27 boot_id = host.get_boot_id()
28
29 # log in and verify things work
30 self.job.set_state('client_fail', True)
31 at.run_test('platform_CryptohomeSyncStress',
32 username=username, password=password)
33 if self.job.get_state('client_fail'):
34 raise error.TestFail('Client test failed')
35
36 # wait for some delay
37 delay = random.randint(0, self.max_delay)
38 print 'Delaying for %s seconds and then restarting.' % (delay)
39 time.sleep(delay)
40
41 # restart client
42 power_strip.PowerStrip(power_addr).reboot(outlet)
43 host.wait_for_restart(old_boot_id=boot_id)
OLDNEW
« 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