| 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 site_crash_test, site_log_reader, \ |
| 7 site_utils, test | 7 site_utils, test |
| 8 from autotest_lib.client.common_lib import error, utils | 8 from autotest_lib.client.common_lib import error, utils |
| 9 | 9 |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 if self._consent: | 59 if self._consent: |
| 60 if kcrash_report is None: | 60 if kcrash_report is None: |
| 61 raise error.TestFail( | 61 raise error.TestFail( |
| 62 'Could not find message with kcrash filename') | 62 'Could not find message with kcrash filename') |
| 63 if announce_match.group(2) != 'handling': | 63 if announce_match.group(2) != 'handling': |
| 64 raise error.TestFail('Did not announce handling of kcrash') | 64 raise error.TestFail('Did not announce handling of kcrash') |
| 65 else: | 65 else: |
| 66 if kcrash_report is not None: | 66 if kcrash_report is not None: |
| 67 raise error.TestFail('Should not have found kcrash filename') | 67 raise error.TestFail('Should not have found kcrash filename') |
| 68 if announce_match.group(2) != 'ignoring': | 68 if announce_match.group(2) != 'ignoring - no consent': |
| 69 raise error.TestFail('Did not announce ignoring of kcrash') | 69 raise error.TestFail('Did not announce ignoring of kcrash') |
| 70 return | 70 return |
| 71 | 71 |
| 72 if not os.path.exists(kcrash_report): | 72 if not os.path.exists(kcrash_report): |
| 73 raise error.TestFail('Crash report gone') | 73 raise error.TestFail('Crash report gone') |
| 74 report_contents = utils.read_file(kcrash_report) | 74 report_contents = utils.read_file(kcrash_report) |
| 75 if not 'kernel BUG at fs/proc/breakme.c' in report_contents: | 75 if not 'kernel BUG at fs/proc/breakme.c' in report_contents: |
| 76 raise error.TestFail('Crash report has unexpected contents') | 76 raise error.TestFail('Crash report has unexpected contents') |
| 77 | 77 |
| 78 if not os.path.exists(_KCRASH_FILE): | 78 if not os.path.exists(_KCRASH_FILE): |
| (...skipping 30 matching lines...) Expand all 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 |