[autotest] Delete logging_KernelCrash as it's now dead.

The server side test logging_KernelCrash is part of no suite, and
no one has claimed an interest, so we're declaring it dead.

This change deletes the test test, and everything made dead by the
deletion.

BUG=chromium:216360
TEST=search stainless, see that the test has never run

Change-Id: I98fee0437b14f7f4ba2e2af3fed86b28ef495e56
Reviewed-on: https://chromium-review.googlesource.com/669744
Commit-Ready: Richard Barnette <jrbarnette@google.com>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Congbin Guo <guocb@chromium.org>
diff --git a/client/site_tests/logging_KernelCrash/logging_KernelCrash.py b/client/site_tests/logging_KernelCrash/logging_KernelCrash.py
deleted file mode 100644
index 24308af..0000000
--- a/client/site_tests/logging_KernelCrash/logging_KernelCrash.py
+++ /dev/null
@@ -1,124 +0,0 @@
-# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging, os, re
-from autotest_lib.client.bin import utils
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.cros.crash import crash_test
-
-
-class logging_KernelCrash(crash_test.CrashTest):
-    """
-    Validates the contents of a kernel crash report.
-    """
-    version = 1
-
-    def _test_reporter_startup(self):
-        """Test that the crash_reporter is handling kernel crashes."""
-        if not self._log_reader.can_find('Enabling kernel crash handling'):
-            if not self._log_reader.can_find(
-                'Kernel does not support crash dumping'):
-                raise error.TestFail(
-                    'Could not find kernel crash enabling message')
-
-
-    def _get_kcrash_name(self):
-        filename_match = re.search(r'Stored kcrash to (\S+)',
-            self._log_reader.get_logs())
-        if not filename_match:
-            return None
-        return filename_match.group(1)
-
-
-    def _is_signature_match(self, signature):
-        # Update these as kernels evolve:
-        matches = r'write_breakme'    # for 2.6.38 kernels and 3.0.13 x86
-        matches += r'|breakme_do_bug' # for 3.2 kernels
-        matches += r'|__bug'          # for 3.0.13 ARM
-        matches += r'|lkdtm_do_action'# for 3.8.11 with lkdtm
-        regex = r'kernel-(' + matches + r')-[0-9A-F]{8}$'
-        return (re.match(regex, signature) is not None)
-
-    def _is_handled_reason(self, reason):
-        return (re.match(r'(handling|developer build - always dumping)$',
-                         reason) is not None)
-
-    def _test_reporter_kcrash_storage(self):
-        """Test that crash_reporter has properly stored the kcrash report."""
-        announce_match = re.search(
-            r'Received .* from kernel \(signature ([^\)]+)\) \(([^\)]+)\)',
-            self._log_reader.get_logs())
-
-        if not announce_match:
-            raise error.TestFail('Could not find kernel crash announcement')
-
-        logging.info('Signature: [%s]', announce_match.group(1))
-        logging.info('Reason: [%s]', announce_match.group(2))
-
-        if not self._is_signature_match(announce_match.group(1)):
-            raise error.TestFail(
-                'Kernel crash signature (%s) did not match expected pattern' %
-                announce_match.group(1))
-
-        kcrash_report = self._get_kcrash_name()
-
-        if self._consent:
-            if kcrash_report is None:
-                raise error.TestFail(
-                    'Could not find message with kcrash filename')
-            if not self._is_handled_reason(announce_match.group(2)):
-                raise error.TestFail('Did not announce handling of kcrash ' \
-                                     '(%s)' % (announce_match.group(2)))
-        else:
-            if kcrash_report is not None:
-                raise error.TestFail('Should not have found kcrash filename')
-            if announce_match.group(2) != 'ignoring - no consent':
-                raise error.TestFail('Did not announce ignoring of kcrash ' \
-                                     '(%s)' % (announce_match.group(2)))
-            return
-
-        if not os.path.exists(kcrash_report):
-            raise error.TestFail('Crash report %s gone' % kcrash_report)
-        report_contents = utils.read_file(kcrash_report)
-        src_re = r'kernel BUG at .*(fs/proc/breakme.c|drivers/misc/lkdtm.c)'
-        if re.search(src_re, report_contents) == None:
-            raise error.TestFail('Crash report has unexpected contents')
-
-
-    def _test_sender_send_kcrash(self):
-        """Test that crash_sender properly sends the crash report."""
-        if not self._consent:
-            return
-        kcrash_report = self._get_kcrash_name()
-        if not os.path.exists(kcrash_report):
-            raise error.TestFail('Crash report %s gone' % kcrash_report)
-        result = self._call_sender_one_crash(
-            report=os.path.basename(kcrash_report))
-        if (not result['send_attempt'] or not result['send_success'] or
-            result['report_exists']):
-            raise error.TestFail('kcrash not sent properly')
-        if result['exec_name'] != 'kernel' or result['report_kind'] != 'kcrash':
-            raise error.TestFail('kcrash exec name or report kind wrong ' \
-                                 '(exec_name: [%s] report_kind: [%s]' %
-                                 (result['exec_name'], result['report_kind']))
-        if result['report_payload'] != kcrash_report:
-            raise error.TestFail('Sent the wrong kcrash report')
-        if not self._is_signature_match(result['sig']):
-            raise error.TestFail('Sent the wrong kcrash signature')
-
-
-    def run_once(self, is_before, consent):
-        self._log_reader.set_start_by_reboot(-1)
-        # We manage consent saving across tests.
-        self._automatic_consent_saving = False
-        self._consent = consent
-        if is_before:
-            self.run_crash_tests(['reporter_startup'], must_run_all=False)
-            # Leave crash sending paused for the kernel crash.
-            self._leave_crash_sending = False
-        else:
-            self.run_crash_tests(['reporter_startup',
-                                  'reporter_kcrash_storage',
-                                  'sender_send_kcrash'],
-                                 clear_spool_first=False)
diff --git a/server/site_tests/logging_KernelCrashServer/control b/server/site_tests/logging_KernelCrashServer/control
deleted file mode 100644
index fb7b89e..0000000
--- a/server/site_tests/logging_KernelCrashServer/control
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.client.bin.site_sysinfo import purgeable_logdir
-
-AUTHOR = "Chrome OS Team"
-NAME = "KernelCrashServer"
-TIME = "SHORT"
-TEST_CATEGORY = "Benchmark"
-TEST_CLASS = "platform"
-TEST_TYPE = "server"
-
-DOC = """
-This test crashes the client and verifies the kernel crash was collected.
-
-Fails if any of the following conditions occur:
-  - kernel does not support crash dumping
-  - kernel crash dump doesn't appear after crash
-  - crash dump does not appear to be correct
-  - crash report is not sent properly
-"""
-
-def run_it(machine):
-    # We have set up our autotest to copy off the crashes in /var/spool/crash
-    # and purge its content after each test pass.  This test executes several
-    # client-side tests and require that the content of /var/spool/crash be
-    # preserved between each client-side tests.  So we'll need to remove the
-    # /var/spool/crash entry from the test_loggables so that autotest doesn't
-    # purge the content.
-    for log in job.sysinfo.test_loggables:
-      if type(log) is purgeable_logdir and log.dir == '/var/spool/crash':
-        job.sysinfo.test_loggables.remove(log)
-        break
-    host = hosts.create_host(machine)
-    job.run_test("logging_KernelCrashServer", host=host)
-
-parallel_simple(run_it, machines)
diff --git a/server/site_tests/logging_KernelCrashServer/logging_KernelCrashServer.py b/server/site_tests/logging_KernelCrashServer/logging_KernelCrashServer.py
deleted file mode 100644
index 5bd9c83..0000000
--- a/server/site_tests/logging_KernelCrashServer/logging_KernelCrashServer.py
+++ /dev/null
@@ -1,145 +0,0 @@
-# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging, os
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.cros import cros_logging
-from autotest_lib.client.cros.crash_test import CrashTest as CrashTestDefs
-from autotest_lib.server import autotest, site_host_attributes, test
-
-_CONSENT_FILE = '/home/chronos/Consent To Send Stats'
-_STOWED_CONSENT_FILE = '/var/lib/kernel-crash-server.consent'
-
-
-class logging_KernelCrashServer(test.test):
-    """
-    Prepares a system for generating a kernel crash report, then crashes
-    the system and call logging_KernelCrash client autotest to validate
-    the resulting report.
-    """
-    version = 1
-
-    def _exact_copy(self, source, dest):
-        """Copy remote source to dest, where dest removed if src not present."""
-        self._host.run('rm -f "%s"; cp "%s" "%s" 2>/dev/null; true' %
-                       (dest, source, dest))
-
-    def _exists_on_client(self, f):
-        return self._host.run('ls "%s"' % f,
-                               ignore_status=True).exit_status == 0
-
-    # Taken from KernelErrorPaths, which duplicates it, but is up to date
-    def _enable_consent(self):
-        """ Enable consent so that crashes get stored in /var/spool/crash. """
-        self._consent_files = [
-            (CrashTestDefs._PAUSE_FILE, None, 'chronos'),
-            (CrashTestDefs._CONSENT_FILE, None, 'chronos'),
-            (CrashTestDefs._POLICY_FILE, 'mock_metrics_on.policy', 'root'),
-            (CrashTestDefs._OWNER_KEY_FILE, 'mock_metrics_owner.key', 'root'),
-            ]
-        for dst, src, owner in self._consent_files:
-            if self._exists_on_client(dst):
-                self._host.run('mv "%s" "%s.autotest_backup"' % (dst, dst))
-            if src:
-                full_src = os.path.join(self.autodir, 'client/cros', src)
-                self._host.send_file(full_src, dst)
-            else:
-                self._host.run('touch "%s"' % dst)
-            self._host.run('chown "%s" "%s"' % (owner, dst))
-
-    def _restore_consent_files(self):
-        """ Restore consent files to their previous values. """
-        for f, _, _ in self._consent_files:
-            self._host.run('rm -f "%s"' % f)
-            if self._exists_on_client('%s.autotest_backup' % f):
-                self._host.run('mv "%s.autotest_backup" "%s"' % (f, f))
-
-    def cleanup(self):
-        self._exact_copy(_STOWED_CONSENT_FILE, _CONSENT_FILE)
-        test.test.cleanup(self)
-
-
-    def _can_disable_consent(self):
-        """Returns whether or not host can have consent disabled.
-
-        Presence of /etc/send_metrics causes ui.conf job (which starts
-        after chromeos_startup) to regenerate a consent file if one
-        does not exist.  Therefore, we cannot guarantee that
-        crash-reporter.conf will start with the file gone if we
-        removed it before causing a crash.
-
-        Presence of /root/.leave_core causes crash_reporter to always
-        handle crashes, so consent cannot be disabled in this case too.
-        """
-        always_regen = self._host.run('[ -r /etc/send_metrics ]',
-                                      ignore_status=True).exit_status == 0
-        is_devimg = self._host.run('[ -r /root/.leave_core ]',
-                                   ignore_status=True).exit_status == 0
-        logging.info('always_regen: %d', always_regen)
-        logging.info('is_devimg: %d', is_devimg)
-        return not (always_regen or is_devimg)
-
-
-    def _crash_it(self, consent):
-        """Crash the host after setting the consent as given."""
-        if consent:
-            self._enable_consent()
-        else:
-            self._restore_consent_files()
-        logging.info('KernelCrashServer: crashing %s', self._host.hostname)
-        lkdtm = "/sys/kernel/debug/provoke-crash/DIRECT"
-        if self._exists_on_client(lkdtm):
-            cmd = "echo BUG > %s" % (lkdtm)
-        else:
-            cmd = "echo bug > /proc/breakme"
-            logging.info("Falling back to using /proc/breakme")
-        boot_id = self._host.get_boot_id()
-        self._host.run('sh -c "sync; sleep 1; %s" >/dev/null 2>&1 &' % (cmd))
-        self._host.wait_for_restart(old_boot_id=boot_id)
-
-
-    def _run_while_paused(self, host):
-        self._host = host
-        client_at = autotest.Autotest(host)
-        self._exact_copy(_CONSENT_FILE, _STOWED_CONSENT_FILE)
-
-        client_at.run_test('logging_KernelCrash',
-                           tag='before-crash',
-                           is_before=True,
-                           consent=True)
-
-        client_attributes = site_host_attributes.HostAttributes(host.hostname)
-        if not client_attributes.has_chromeos_firmware:
-            raise error.TestNAError(
-                'This device is unable to report kernel crashes')
-
-        self._crash_it(True)
-
-        # Check for crash handling with consent.
-        client_at.run_test('logging_KernelCrash',
-                           tag='after-crash-consent',
-                           is_before=False,
-                           consent=True)
-
-        if not self._can_disable_consent():
-            logging.info('This device always has metrics enabled, '
-                         'skipping test of metrics disabled mode.')
-        else:
-            self._crash_it(False)
-
-            # Check for crash handling without consent.
-            client_at.run_test('logging_KernelCrash',
-                               tag='after-crash-no-consent',
-                               is_before=False,
-                               consent=False)
-
-    def run_once(self, host=None):
-        # For the entire duration of this server test (across crashes
-        # and boots after crashes) we want to disable log rotation.
-        log_pauser = cros_logging.LogRotationPauser(host)
-        try:
-            log_pauser.begin()
-            self._run_while_paused(host)
-        finally:
-            log_pauser.end()
diff --git a/server/site_tests/platform_KernelErrorPaths/platform_KernelErrorPaths.py b/server/site_tests/platform_KernelErrorPaths/platform_KernelErrorPaths.py
index 0ae4e26..6f49552 100644
--- a/server/site_tests/platform_KernelErrorPaths/platform_KernelErrorPaths.py
+++ b/server/site_tests/platform_KernelErrorPaths/platform_KernelErrorPaths.py
@@ -18,9 +18,7 @@
         try:
             # Simply sending the trigger into lkdtm resets the target
             # immediately, leaving files unsaved to disk and the master ssh
-            # connection wedged for a long time. The sequence below borrowed
-            # from logging_KernelCrashServer.py makes sure that the test
-            # proceeds smoothly.
+            # connection wedged for a long time.
             self.client.run(
                 'sh -c "sync; sleep 1; %s" >/dev/null 2>&1 &' % command)
         except error.AutoservRunError, e:
diff --git a/server/site_tests/platform_TrackpadStressServer/platform_TrackpadStressServer.py b/server/site_tests/platform_TrackpadStressServer/platform_TrackpadStressServer.py
index e71bfb3..3234bfb 100644
--- a/server/site_tests/platform_TrackpadStressServer/platform_TrackpadStressServer.py
+++ b/server/site_tests/platform_TrackpadStressServer/platform_TrackpadStressServer.py
@@ -42,9 +42,7 @@
         try:
             # Simply writing to the crash interface resets the target
             # immediately, leaving files unsaved to disk and the master ssh
-            # connection wedged for a long time. The sequence below borrowed
-            # from logging_KernelCrashServer.py makes sure that the test
-            # proceeds smoothly.
+            # connection wedged for a long time.
             self.client.run(
                 'sh -c "sync; sleep 1; %s" >/dev/null 2>&1 &' % command)
         except error.AutoservRunError, e: