| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import random, time | 5 import random, time |
| 6 from autotest_lib.client.common_lib import error, power_strip | 6 from autotest_lib.client.common_lib import error |
| 7 from autotest_lib.client.cros import power_strip |
| 7 from autotest_lib.server import autotest, test | 8 from autotest_lib.server import autotest, test |
| 8 | 9 |
| 9 class platform_CryptohomeSyncStressServer(test.test): | 10 class platform_CryptohomeSyncStressServer(test.test): |
| 10 version = 1 | 11 version = 1 |
| 11 max_delay = 120 | 12 max_delay = 120 |
| 12 | 13 |
| 13 def run_once(self, host, power_addr, outlet, username, password): | 14 def run_once(self, host, power_addr, outlet, username, password): |
| 14 # check parameters | 15 # check parameters |
| 15 if power_addr == None: | 16 if power_addr == None: |
| 16 raise error.TestFail('Missing power_addr argument.') | 17 raise error.TestFail('Missing power_addr argument.') |
| (...skipping 17 matching lines...) Expand all Loading... |
| 34 raise error.TestFail('Client test failed') | 35 raise error.TestFail('Client test failed') |
| 35 | 36 |
| 36 # wait for some delay | 37 # wait for some delay |
| 37 delay = random.randint(0, self.max_delay) | 38 delay = random.randint(0, self.max_delay) |
| 38 print 'Delaying for %s seconds and then restarting.' % (delay) | 39 print 'Delaying for %s seconds and then restarting.' % (delay) |
| 39 time.sleep(delay) | 40 time.sleep(delay) |
| 40 | 41 |
| 41 # restart client | 42 # restart client |
| 42 power_strip.PowerStrip(power_addr).reboot(outlet) | 43 power_strip.PowerStrip(power_addr).reboot(outlet) |
| 43 host.wait_for_restart(old_boot_id=boot_id) | 44 host.wait_for_restart(old_boot_id=boot_id) |
| OLD | NEW |