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, os.path, signal, time | 5 import logging, os, os.path, signal, time |
6 from autotest_lib.client.bin import site_crash_test | 6 from autotest_lib.client.bin import utils |
7 from autotest_lib.client.bin import site_log_reader, utils | |
8 from autotest_lib.client.common_lib import error | 7 from autotest_lib.client.common_lib import error |
9 from autotest_lib.client.cros import constants as chromeos_constants, login | 8 from autotest_lib.client.cros import constants as chromeos_constants, login |
| 9 from autotest_lib.client.cros import crash_test |
10 | 10 |
11 class logging_CrashServices(site_crash_test.CrashTest): | 11 class logging_CrashServices(crash_test.CrashTest): |
12 version = 1 | 12 version = 1 |
13 | 13 |
14 process_list = ["/usr/sbin/acpid", | 14 process_list = ["/usr/sbin/acpid", |
15 "/sbin/agetty", | 15 "/sbin/agetty", |
16 "/usr/sbin/cashewd", | 16 "/usr/sbin/cashewd", |
17 "/opt/google/chrome/chrome", | 17 "/opt/google/chrome/chrome", |
18 "/usr/bin/chromeos-wm", | 18 "/usr/bin/chromeos-wm", |
19 "/usr/sbin/console-kit-daemon", | 19 "/usr/sbin/console-kit-daemon", |
20 "/usr/sbin/cryptohomed", | 20 "/usr/sbin/cryptohomed", |
21 "/usr/libexec/devkit-daemon", | 21 "/usr/libexec/devkit-daemon", |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 # run crash_sender and watch for successful send in logs | 81 # run crash_sender and watch for successful send in logs |
82 result = self._call_sender_one_crash(report=self._find_dmp()) | 82 result = self._call_sender_one_crash(report=self._find_dmp()) |
83 if not result["send_success"]: | 83 if not result["send_success"]: |
84 raise error.TestFail("Crash sending unsuccessful") | 84 raise error.TestFail("Crash sending unsuccessful") |
85 if self._find_dmp(): | 85 if self._find_dmp(): |
86 raise error.TestFail(".dmp files were not removed") | 86 raise error.TestFail(".dmp files were not removed") |
87 | 87 |
88 | 88 |
89 def initialize(self): | 89 def initialize(self): |
90 site_crash_test.CrashTest.initialize(self) | 90 crash_test.CrashTest.initialize(self) |
91 self._reset_rate_limiting() | 91 self._reset_rate_limiting() |
92 self._clear_spooled_crashes() | 92 self._clear_spooled_crashes() |
93 self._push_consent() | 93 self._push_consent() |
94 self._set_consent(True) | 94 self._set_consent(True) |
95 | 95 |
96 | 96 |
97 def cleanup(self): | 97 def cleanup(self): |
98 site_crash_test.CrashTest.cleanup(self) | 98 crash_test.CrashTest.cleanup(self) |
99 | 99 |
100 | 100 |
101 def run_once(self, process_path=None): | 101 def run_once(self, process_path=None): |
102 if process_path: | 102 if process_path: |
103 self._test_process(process_path) | 103 self._test_process(process_path) |
104 return | 104 return |
105 | 105 |
106 # log in | 106 # log in |
107 (username, password) = chromeos_constants.CREDENTIALS["$default"] | 107 (username, password) = chromeos_constants.CREDENTIALS["$default"] |
108 login.attempt_login(username, password) | 108 login.attempt_login(username, password) |
109 | 109 |
110 # test processes | 110 # test processes |
111 for process_path in self.process_list: | 111 for process_path in self.process_list: |
112 self.job.run_test("logging_CrashServices", | 112 self.job.run_test("logging_CrashServices", |
113 process_path=process_path, | 113 process_path=process_path, |
114 tag=os.path.basename(process_path)) | 114 tag=os.path.basename(process_path)) |
115 | 115 |
116 # killing session manager logs out, so this will probably fail | 116 # killing session manager logs out, so this will probably fail |
117 try: | 117 try: |
118 login.attempt_logout() | 118 login.attempt_logout() |
119 pass | 119 pass |
OLD | NEW |