tast-tests: Introduce testexec package.

The new package is a wrapper of the standard os/exec package
optimized for use cases of Tast. It is designed as a drop-in
replacement of os/exec, but differs in mainly two points:

- Automatic log collection. os/exec sends stdout/stderr to
  /dev/null unless explicitly specified to collect them. This
  default behavior makes it very difficult to debug external
  command failures. This wrapper automatically collects those
  uncaptured logs and allows to log them later.

- Process group handling. On timeout, os/exec kills the direct
  child process only. This can often leave orphaned subprocesses
  in DUT and interfere with later tests. To avoid this issue,
  this wrapper will kill the whole tree of subprocesses on
  timeout by setting process group ID appropriately.

BUG=None
TEST=tast -verbose run caroline-DUT '(bvt)'
TEST=go test chromiumos/tast/local/testexec/...

Change-Id: I1e29b2118a739033564a29fbed96bf4f13b6f2a3
Reviewed-on: https://chromium-review.googlesource.com/1104085
Commit-Ready: Shuhei Takahashi <nya@chromium.org>
Tested-by: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Shuhei Takahashi <nya@chromium.org>
8 files changed
tree: 2fe1f86c09eace5e9ce3aec1245cc8ed48842e45
  1. src/
  2. .gitignore
  3. README.md
README.md

Tast (tests)

This repository contains integration tests that are run by Tast.

Directory structure

  • src/chromiumos/tast/
    • local/ - Code related to local (i.e. on-device or “client”) tests.
      • bundles/ - Local test bundles.
        • cros/ - The “cros” local test bundle, containing standard Chrome OS tests. Tests are packaged by category.
      • ... - Packages used only by local tests.
    • remote/ - Code related to remote (i.e. off-device or “server”) tests.
      • bundles/ - Remote test bundles.
        • cros/ - The “cros” remote test bundle, containing standard Chrome OS tests. Tests are packaged by category.
      • ... - Packages used only by remote tests.

Shared code, the main tast executable, the local_test_runner and remote_test_runner executables responsible for running bundles, and documentation are located in the tast repository.

GoDoc