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, utils, test | 6 from autotest_lib.client.bin import utils |
7 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 |
8 | 10 |
9 _25_HOURS_AGO = -25 * 60 * 60 | 11 _25_HOURS_AGO = -25 * 60 * 60 |
10 _CRASH_SENDER_CRON_PATH = '/etc/cron.hourly/crash_sender.hourly' | 12 _CRASH_SENDER_CRON_PATH = '/etc/cron.hourly/crash_sender.hourly' |
11 _DAILY_RATE_LIMIT = 32 | 13 _DAILY_RATE_LIMIT = 32 |
12 _MIN_UNIQUE_TIMES = 4 | 14 _MIN_UNIQUE_TIMES = 4 |
13 _HWCLASS_PATH = '/sys/devices/platform/chromeos_acpi/HWID' | 15 _HWCLASS_PATH = '/sys/devices/platform/chromeos_acpi/HWID' |
14 _SECONDS_SEND_SPREAD = 3600 | 16 _SECONDS_SEND_SPREAD = 3600 |
15 | 17 |
16 class logging_CrashSender(site_crash_test.CrashTest): | 18 class logging_CrashSender(crash_test.CrashTest): |
17 version = 1 | 19 version = 1 |
18 | 20 |
19 | 21 |
20 def _check_hardware_info(self, result): | 22 def _check_hardware_info(self, result): |
21 # Get board name | 23 # Get board name |
22 lsb_release = utils.read_file('/etc/lsb-release') | 24 lsb_release = utils.read_file('/etc/lsb-release') |
23 board_match = re.search(r'CHROMEOS_RELEASE_BOARD=(.*)', lsb_release) | 25 board_match = re.search(r'CHROMEOS_RELEASE_BOARD=(.*)', lsb_release) |
24 if not ('Board: %s' % board_match.group(1)) in result['output']: | 26 if not ('Board: %s' % board_match.group(1)) in result['output']: |
25 raise error.TestFail('Missing board name %s in output' % | 27 raise error.TestFail('Missing board name %s in output' % |
26 board_match.group(1)) | 28 board_match.group(1)) |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 'sender_simple_kernel_crash', | 267 'sender_simple_kernel_crash', |
266 'sender_pausing', | 268 'sender_pausing', |
267 'sender_reports_disabled', | 269 'sender_reports_disabled', |
268 'sender_rate_limiting', | 270 'sender_rate_limiting', |
269 'sender_single_instance', | 271 'sender_single_instance', |
270 'sender_send_fails', | 272 'sender_send_fails', |
271 'sender_orphaned_files', | 273 'sender_orphaned_files', |
272 'sender_incomplete_metadata', | 274 'sender_incomplete_metadata', |
273 'sender_missing_payload', | 275 'sender_missing_payload', |
274 'cron_runs']) | 276 'cron_runs']) |
OLD | NEW |