[autotest] provision.py refactor

This commit is the combination of multiple commits.  Their commit
messages are as follows:

commit 74fd09c73d5a0b00de3b2b26c254f7fd2589d762
Author: Allen Li <ayatane@chromium.org>
Date:   Wed Feb 22 18:04:46 2017 -0800

    [autotest] Privatize action_for()

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: I89fe2f368f521f7670d8627dc5fd1425f5b33809

commit a7d2f9408185f8cba30952aa18ba40c2b4fb7b96
Author: Allen Li <ayatane@chromium.org>
Date:   Tue Apr 4 15:14:22 2017 -0700

    [autotest] Inline _action_for()

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: Iec003558376b4d98901b209cc4793ca2443c3904

commit 01995f7dc53fcf82502b3abacdcd5d6c616ab847
Author: Allen Li <ayatane@chromium.org>
Date:   Tue Apr 4 15:18:10 2017 -0700

    [autotest] Replace label logic in _sort_actionable_labels()

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: Ib083b558d5627bdf8149604680f4a16d0372e141

commit 0a871fa273f3f4801ce20025aa6a1abca4f7034f
Author: Allen Li <ayatane@chromium.org>
Date:   Tue Apr 4 15:19:35 2017 -0700

    [autotest] Remove useless comment

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: I482610b597248528eb15272713d7a8ccbf663680

commit bff7f7f92e2945bc3fca2937b6bd07ef40e80213
Author: Allen Li <ayatane@chromium.org>
Date:   Tue Apr 4 15:25:10 2017 -0700

    [autotest] Extract _get_action_priority()

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: I33f19161700372f1e9f22e01210cac8786b3d296

commit 4f6fc86b0b2d8d6be7615a868d18e863f9fd75dd
Author: Allen Li <ayatane@chromium.org>
Date:   Tue Apr 4 15:26:14 2017 -0700

    [autotest] Inline sort key

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: I9f5a801d87fdf2a677d26ab167a78074c02ced88

commit 94eb973f8b433398de545eb21727b17af63a097b
Author: Allen Li <ayatane@chromium.org>
Date:   Tue Apr 4 15:33:53 2017 -0700

    [autotest] Extract _filter_unactionable_labels()

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: Ia020fd61b14fc7e18dd8c28c7cc76205bb33cb0c

commit 1ff8574b845214114d6fdbcb395a1b1bcbdc2046
Author: Allen Li <ayatane@chromium.org>
Date:   Tue Apr 4 15:34:58 2017 -0700

    [autotest] Extract _filter_actionable_labels()

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: Ia835f03d5d63c1f558700b0e04cdb1b176345790

commit 8ccb77cd5299ed5c3411824881ba079ad9adcde0
Author: Allen Li <ayatane@chromium.org>
Date:   Tue Apr 4 15:36:10 2017 -0700

    [autotest] Remove partition usage

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: I71538cef1500eb4ef7a44b62d3920ac117c05e60

commit 272781d81936f37c01d838ca5f1832fe23c5a141
Author: Allen Li <ayatane@chromium.org>
Date:   Tue Apr 4 15:37:54 2017 -0700

    [autotest] Inline _sort_actionable_labels()

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: Ib89a44ad969e95ec9bdae9f134e8bc5833d187a9

commit 87153b8ac2d34081d80b7d6671b1ac1249661bdf
Author: Allen Li <ayatane@chromium.org>
Date:   Tue Apr 4 15:39:19 2017 -0700

    [autotest] Simplify sorting

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: I90a6704d8bcb4bf6a716009df9877ee15f8f69fd

commit 4993d92cda071511d77cfb12f8ad803f36c4071d
Author: Allen Li <ayatane@chromium.org>
Date:   Tue Apr 4 15:44:11 2017 -0700

    [autotest] Extract _actions_and_values_iter()

    BUG=chromium:707999
    TEST=Run unit tests

    Change-Id: I2c39b05c305a8cdf264b42b362ef5ab5c4159321

commit 0242e5e27f15f46ea702412104364b60122588ea
Author: Allen Li <ayatane@chromium.org>
Date:   Fri Apr 28 16:07:27 2017 -0700

    [autotest] Fix warning stack level

    Make the warning report who the caller is.

    BUG=None
    TEST=None

    Change-Id: I7f3cfe6b6a17f0014cb7ef36c33451cda90fb1ba

Change-Id: I2e2638e180c389de556b5ab0ec13e51fc5be3569
Reviewed-on: https://chromium-review.googlesource.com/513226
Commit-Ready: Allen Li <ayatane@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
1 file changed
tree: 2bada23e6b37f5c651b0185c59564db704181ec3
  1. apache/
  2. cli/
  3. client/
  4. contrib/
  5. database/
  6. docs/
  7. frontend/
  8. logs/
  9. packages/
  10. puppylab/
  11. results/
  12. scheduler/
  13. server/
  14. site_utils/
  15. test_suites/
  16. tko/
  17. utils/
  18. .gitignore
  19. .quickmerge_sentinel
  20. __init__.py
  21. COMMIT-QUEUE.ini
  22. common.py
  23. global_config.ini
  24. LGPL_LICENSE
  25. LICENSE
  26. metadata.chromium
  27. moblab_config.ini
  28. PRESUBMIT.cfg
  29. README.md
  30. ssp_deploy_config.json
README.md

Autotest: Automated integration testing for Android and Chrome OS Devices

Autotest is a framework for fully automated testing. It was originally designed to test the Linux kernel, and expanded by the Chrome OS team to validate complete system images of Chrome OS and Android.

Autotest is composed of a number of modules that will help you to do stand alone tests or setup a fully automated test grid, depending on what you are up to. A non extensive list of functionality is:

  • A body of code to run tests on the device under test. In this setup, test logic executes on the machine being tested, and results are written to files for later collection from a development machine or lab infrastructure.

  • A body of code to run tests against a remote device under test. In this setup, test logic executes on a development machine or piece of lab infrastructure, and the device under test is controlled remotely via SSH/adb/some combination of the above.

  • Developer tools to execute one or more tests. test_that for Chrome OS and test_droid for Android allow developers to run tests against a device connected to their development machine on their desk. These tools are written so that the same test logic that runs in the lab will run at their desk, reducing the number of configurations under which tests are run.

  • Lab infrastructure to automate the running of tests. This infrastructure is capable of managing and running tests against thousands of devices in various lab environments. This includes code for both synchronous and asynchronous scheduling of tests. Tests are run against this hardware daily to validate every build of Chrome OS.

  • Infrastructure to set up miniature replicas of a full lab. A full lab does entail a certain amount of administrative work which isn't appropriate for a work group interested in automated tests against a small set of devices. Since this scale is common during device bringup, a special setup, called Moblab, allows a natural progressing from desk -> mini lab -> full lab.

Run some autotests

See the guides to test_that and test_droid:

test_droid Basic Usage

test_that Basic Usage

Write some autotests

See the best practices guide, existing tests, and comments in the code.

Autotest Best Practices

Grabbing the latest source

git clone https://chromium.googlesource.com/chromiumos/third_party/autotest

Hacking and submitting patches

See the coding style guide for guidance on submitting patches.

Coding Style