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 grp, logging, os, pwd, re, stat, subprocess | 5 import grp, logging, os, pwd, re, stat, subprocess |
6 from signal import SIGSEGV | 6 from signal import SIGSEGV |
7 from autotest_lib.client.bin import site_crash_test, site_utils, test | 7 from autotest_lib.client.bin import site_crash_test, 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 _CORE_PATTERN = '/proc/sys/kernel/core_pattern' | 10 _CORE_PATTERN = '/proc/sys/kernel/core_pattern' |
11 _LEAVE_CORE_PATH = '/etc/leave_core' | 11 _LEAVE_CORE_PATH = '/etc/leave_core' |
12 | 12 |
13 | 13 |
14 class logging_UserCrash(site_crash_test.CrashTest): | 14 class logging_UserCrash(site_crash_test.CrashTest): |
15 version = 1 | 15 version = 1 |
16 | 16 |
17 | 17 |
18 def setup(self): | 18 def setup(self): |
19 os.chdir(self.srcdir) | 19 os.chdir(self.srcdir) |
20 utils.system('make clean all') | 20 utils.make('clean all') |
21 | 21 |
22 | 22 |
23 def _test_reporter_startup(self): | 23 def _test_reporter_startup(self): |
24 """Test that the core_pattern is set up by crash reporter.""" | 24 """Test that the core_pattern is set up by crash reporter.""" |
25 output = utils.read_file(_CORE_PATTERN).rstrip() | 25 output = utils.read_file(_CORE_PATTERN).rstrip() |
26 expected_core_pattern = ('|%s --signal=%%s --pid=%%p' % | 26 expected_core_pattern = ('|%s --signal=%%s --pid=%%p' % |
27 self._CRASH_REPORTER_PATH) | 27 self._CRASH_REPORTER_PATH) |
28 if output != expected_core_pattern: | 28 if output != expected_core_pattern: |
29 raise error.TestFail('core pattern should have been %s, not %s' % | 29 raise error.TestFail('core pattern should have been %s, not %s' % |
30 (expected_core_pattern, output)) | 30 (expected_core_pattern, output)) |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 'reporter_startup', | 404 'reporter_startup', |
405 'reporter_shutdown', | 405 'reporter_shutdown', |
406 'no_crash', | 406 'no_crash', |
407 'chronos_breakpad_crasher', | 407 'chronos_breakpad_crasher', |
408 'chronos_nobreakpad_crasher', | 408 'chronos_nobreakpad_crasher', |
409 'root_breakpad_crasher', | 409 'root_breakpad_crasher', |
410 'root_nobreakpad_crasher', | 410 'root_nobreakpad_crasher', |
411 'core_file_removed_in_production', | 411 'core_file_removed_in_production', |
412 'core_file_persists_in_debug', | 412 'core_file_persists_in_debug', |
413 ]) | 413 ]) |
OLD | NEW |