OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import logging, os, shutil, time |
| 6 from autotest_lib.client.common_lib import error |
| 7 from autotest_lib.server import autotest, site_host_attributes, test |
| 8 |
| 9 |
| 10 class logging_KernelCrashServer(test.test): |
| 11 version = 1 |
| 12 |
| 13 |
| 14 def run_once(self, host=None): |
| 15 client_at = autotest.Autotest(host) |
| 16 client_at.run_test('logging_KernelCrash', |
| 17 tag='before-crash', |
| 18 is_before=True) |
| 19 |
| 20 client_attributes = site_host_attributes.HostAttributes(host.hostname) |
| 21 if not client_attributes.has_working_kcrash: |
| 22 raise error.TestNAError( |
| 23 'This device is unable to report kernel crashes') |
| 24 # Crash the client |
| 25 logging.info('KernelCrashServer: crashing %s' % host.hostname) |
| 26 boot_id = host.get_boot_id() |
| 27 host.run('sh -c "sleep 1; echo bug > /proc/breakme" >/dev/null 2>&1 &') |
| 28 host.wait_for_restart(old_boot_id=boot_id) |
| 29 |
| 30 # Check for crash handling |
| 31 client_at.run_test('logging_KernelCrash', |
| 32 tag='after-crash', |
| 33 is_before=False) |
OLD | NEW |