1# Copyright (c) 2009 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
5from autotest_lib.client.bin.site_sysinfo import purgeable_logdir
6
7AUTHOR = "Chrome OS Team"
8NAME = "KernelCrashServer"
9TIME = "SHORT"
10TEST_CATEGORY = "Benchmark"
11TEST_CLASS = "platform"
12TEST_TYPE = "server"
13
14DOC = """
15This test crashes the client and verifies the kernel crash was collected.
16
17Fails if any of the following conditions occur:
18  - kernel does not support crash dumping
19  - kernel crash dump doesn't appear after crash
20  - crash dump does not appear to be correct
21  - crash report is not sent properly
22"""
23
24def run_it(machine):
25    # We have set up our autotest to copy off the crashes in /var/spool/crash
26    # and purge its content after each test pass.  This test executes several
27    # client-side tests and require that the content of /var/spool/crash be
28    # preserved between each client-side tests.  So we'll need to remove the
29    # /var/spool/crash entry from the test_loggables so that autotest doesn't
30    # purge the content.
31    for log in job.sysinfo.test_loggables:
32      if type(log) is purgeable_logdir and log.dir == '/var/spool/crash':
33        job.sysinfo.test_loggables.remove(log)
34        break
35    host = hosts.create_host(machine)
36    job.run_test("logging_KernelCrashServer", host=host)
37
38parallel_simple(run_it, machines)
39