crash: Refactor test for user crash reporting
The logging_UserCrash test contains code that should be shared with the
ARC counterpart, specifically the crasher executable and Python helpers.
This CL pulls this into a UserCrashTest base class. The only functional
change is that the crasher executable is copied if an alternate path is
passed to _run_crasher_process. The ARC test needs a copy in the chroot.
This CL also fixes several lint errors.
BUG=b:27503472
TEST=logging_UserCrash
Change-Id: Ia8d92d1041b97624a369a7731a7fa927abeb9b0e
Reviewed-on: https://chromium-review.googlesource.com/338846
Commit-Ready: Dominik Laskowski <domlaskowski@google.com>
Tested-by: Dominik Laskowski <domlaskowski@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/client/cros/crash/common.py b/client/cros/crash/common.py
new file mode 100644
index 0000000..882a563
--- /dev/null
+++ b/client/cros/crash/common.py
@@ -0,0 +1,18 @@
+# Copyright 2016 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.
+
+"""This module provides access to the autotest_lib.client namespace. It must be
+ included before any of the modules from that namespace."""
+
+import os, sys
+
+dirname = os.path.dirname(sys.modules[__name__].__file__)
+client_dir = os.path.abspath(os.path.join(dirname, "..", ".."))
+sys.path.insert(0, client_dir)
+
+import setup_modules
+
+sys.path.pop(0)
+setup_modules.setup(base_path=client_dir,
+ root_module_name="autotest_lib.client")