| 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 logging, os, re | 5 import logging, os, re |
| 6 from autotest_lib.client.bin import site_crash_test, site_log_reader, \ | 6 from autotest_lib.client.bin import utils |
| 7 test, utils | |
| 8 from autotest_lib.client.common_lib import error | 7 from autotest_lib.client.common_lib import error |
| 8 from autotest_lib.client.cros import crash_test |
| 9 | 9 |
| 10 | 10 |
| 11 _KCRASH_FILE = '/sys/kernel/debug/preserved/kcrash' | 11 _KCRASH_FILE = '/sys/kernel/debug/preserved/kcrash' |
| 12 | 12 |
| 13 | 13 |
| 14 class logging_KernelCrash(site_crash_test.CrashTest): | 14 class logging_KernelCrash(crash_test.CrashTest): |
| 15 version = 1 | 15 version = 1 |
| 16 | 16 |
| 17 | 17 |
| 18 def _test_reporter_startup(self): | 18 def _test_reporter_startup(self): |
| 19 """Test that the crash_reporter is handling kernel crashes.""" | 19 """Test that the crash_reporter is handling kernel crashes.""" |
| 20 if not self._log_reader.can_find('Enabling kernel crash handling'): | 20 if not self._log_reader.can_find('Enabling kernel crash handling'): |
| 21 if not self._log_reader.can_find( | 21 if not self._log_reader.can_find( |
| 22 'Kernel does not support crash dumping'): | 22 'Kernel does not support crash dumping'): |
| 23 raise error.TestFail( | 23 raise error.TestFail( |
| 24 'Could not find kernel crash enabling message') | 24 'Could not find kernel crash enabling message') |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 self._consent = consent | 109 self._consent = consent |
| 110 if is_before: | 110 if is_before: |
| 111 self.run_crash_tests(['reporter_startup'], must_run_all=False) | 111 self.run_crash_tests(['reporter_startup'], must_run_all=False) |
| 112 # Leave crash sending paused for the kernel crash. | 112 # Leave crash sending paused for the kernel crash. |
| 113 self._leave_crash_sending = False | 113 self._leave_crash_sending = False |
| 114 else: | 114 else: |
| 115 self.run_crash_tests(['reporter_startup', | 115 self.run_crash_tests(['reporter_startup', |
| 116 'reporter_kcrash_storage', | 116 'reporter_kcrash_storage', |
| 117 'sender_send_kcrash'], | 117 'sender_send_kcrash'], |
| 118 clear_spool_first=False) | 118 clear_spool_first=False) |
| OLD | NEW |