Chromium Code Reviews| 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 os | 5 import os |
| 6 | 6 from datetime import datetime |
| 7 from autotest_lib.client.bin import boottool, site_logging, utils | 7 from autotest_lib.client.bin import boottool, utils |
| 8 from autotest_lib.client.bin.job import base_client_job | 8 from autotest_lib.client.bin.job import base_client_job |
| 9 from autotest_lib.client.common_lib import error | 9 from autotest_lib.client.common_lib import error |
| 10 from datetime import datetime | 10 from autotest_lib.client.cros import log_reader |
| 11 | |
| 11 | 12 |
| 12 LAST_BOOT_TAG = object() | 13 LAST_BOOT_TAG = object() |
| 13 | 14 |
| 14 class site_job(base_client_job): | 15 class site_job(base_client_job): |
| 15 def __init__(self, *args, **kwargs): | |
| 16 base_client_job.__init__(self, *args, **kwargs) | |
| 17 | |
| 18 | 16 |
| 19 def run_test(self, url, *args, **dargs): | 17 def run_test(self, url, *args, **dargs): |
| 20 log_pauser = site_logging.LogRotationPauser() | 18 log_pauser = log_reader.LogRotationPauser() |
|
kmixter1
2010/12/16 03:12:57
If you collapse site_log_reader and site_logging,
ericli
2010/12/17 21:48:39
I agree. I have some initial concern about prefix
| |
| 21 passed = False | 19 passed = False |
| 22 try: | 20 try: |
| 23 log_pauser.begin() | 21 log_pauser.begin() |
| 24 passed = base_client_job.run_test(self, url, *args, **dargs) | 22 passed = base_client_job.run_test(self, url, *args, **dargs) |
| 25 if not passed: | 23 if not passed: |
| 26 # Save the VM state immediately after the test failure. | 24 # Save the VM state immediately after the test failure. |
| 27 # This is a NOOP if the the test isn't running in a VM or | 25 # This is a NOOP if the the test isn't running in a VM or |
| 28 # if the VM is not properly configured to save state. | 26 # if the VM is not properly configured to save state. |
| 29 group, testname = self.pkgmgr.get_package_name(url, 'test') | 27 group, testname = self.pkgmgr.get_package_name(url, 'test') |
| 30 now = datetime.now().strftime('%I:%M:%S.%f') | 28 now = datetime.now().strftime('%I:%M:%S.%f') |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 46 | 44 |
| 47 # sync first, so that a sync during shutdown doesn't time out | 45 # sync first, so that a sync during shutdown doesn't time out |
| 48 utils.system("sync; sync", ignore_status=True) | 46 utils.system("sync; sync", ignore_status=True) |
| 49 | 47 |
| 50 utils.system("(sleep 5; reboot) </dev/null >/dev/null 2>&1 &") | 48 utils.system("(sleep 5; reboot) </dev/null >/dev/null 2>&1 &") |
| 51 self.quit() | 49 self.quit() |
| 52 | 50 |
| 53 | 51 |
| 54 def require_gcc(self): | 52 def require_gcc(self): |
| 55 return False | 53 return False |
| OLD | NEW |