| 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 dbus, logging, os, re, shutil, socket, sys, time | 5 import dbus, logging, os, re, shutil, socket, sys, time |
| 6 import common | 6 import common |
| 7 import auth_server, constants as chromeos_constants, cryptohome, dns_server | 7 import auth_server, constants as chromeos_constants, cryptohome, dns_server |
| 8 import cros_logging, cros_ui, login | 8 import cros_logging, cros_ui, login |
| 9 from autotest_lib.client.bin import test, utils | 9 from autotest_lib.client.bin import test, utils |
| 10 from autotest_lib.client.common_lib import error | 10 from autotest_lib.client.common_lib import error |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 method as well. | 283 method as well. |
| 284 """ | 284 """ |
| 285 if hasattr(self, '_authServer'): | 285 if hasattr(self, '_authServer'): |
| 286 self.revert_dns() | 286 self.revert_dns() |
| 287 self._authServer.stop() | 287 self._authServer.stop() |
| 288 self._dnsServer.stop() | 288 self._dnsServer.stop() |
| 289 | 289 |
| 290 | 290 |
| 291 def __log_crashed_processes(self, processes): | 291 def __log_crashed_processes(self, processes): |
| 292 """Runs through the log watched by |watcher| to see if a crash was | 292 """Runs through the log watched by |watcher| to see if a crash was |
| 293 reported for any process names listed in |processes|. | 293 reported for any process names listed in |processes|. SIGABRT crashes in |
| 294 chrome during logout are ignored. |
| 294 """ | 295 """ |
| 295 regex = re.compile(r'Received crash notification for (\w+).+ (sig \d+)', | 296 logout_start_regex = re.compile(login.LOGOUT_ATTEMPT_MSG) |
| 296 re.MULTILINE) | 297 crash_regex = re.compile( |
| 297 for match in regex.finditer(self._log_reader.get_logs()): | 298 'Received crash notification for (\w+).+ (sig \d+)') |
| 298 if match.group(1) not in processes: | 299 logout_complete_regex = re.compile(login.LOGOUT_COMPLETE_MSG) |
| 299 self.job.record('INFO', self.tagged_testname, | 300 |
| 300 "%s crash" % match.group(1), match.group(2)) | 301 in_logout = False |
| 302 for line in self._log_reader.get_logs().split('\n'): |
| 303 if logout_start_regex.search(line): |
| 304 in_logout = True |
| 305 elif logout_complete_regex.search(line): |
| 306 in_logout = False |
| 307 else: |
| 308 match = crash_regex.search(line) |
| 309 if (match and not match.group(1) in processes and |
| 310 not (in_logout and |
| 311 match.group(1) == chromeos_constants.BROWSER and |
| 312 match.group(2) == 'sig 6')): |
| 313 self.job.record('INFO', self.tagged_testname, |
| 314 line[match.start():]) |
| 301 | 315 |
| 302 | 316 |
| 303 def cleanup(self): | 317 def cleanup(self): |
| 304 """Overridden from test.cleanup() to log out when the test is complete. | 318 """Overridden from test.cleanup() to log out when the test is complete. |
| 305 """ | 319 """ |
| 306 logpath = chromeos_constants.CHROME_LOG_DIR | 320 logpath = chromeos_constants.CHROME_LOG_DIR |
| 307 | 321 |
| 308 try: | 322 try: |
| 309 for file in os.listdir(logpath): | 323 for file in os.listdir(logpath): |
| 310 fullpath = os.path.join(logpath, file) | 324 fullpath = os.path.join(logpath, file) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 334 | 348 |
| 335 self.stop_authserver() | 349 self.stop_authserver() |
| 336 self.__log_crashed_processes(self.crash_blacklist) | 350 self.__log_crashed_processes(self.crash_blacklist) |
| 337 | 351 |
| 338 | 352 |
| 339 def get_auth_endpoint_misses(self): | 353 def get_auth_endpoint_misses(self): |
| 340 if hasattr(self, '_authServer'): | 354 if hasattr(self, '_authServer'): |
| 341 return self._authServer.get_endpoint_misses() | 355 return self._authServer.get_endpoint_misses() |
| 342 else: | 356 else: |
| 343 return {} | 357 return {} |
| OLD | NEW |