1*9c5db199SXin Li# Autotest: Automated integration testing for Android and ChromeOS Devices 2*9c5db199SXin Li 3*9c5db199SXin LiAutotest is a framework for fully automated testing. It was originally designed 4*9c5db199SXin Lito test the Linux kernel, and expanded by the ChromeOS team to validate 5*9c5db199SXin Licomplete system images of ChromeOS and Android. 6*9c5db199SXin Li 7*9c5db199SXin LiAutotest is composed of a number of modules that will help you to do stand alone 8*9c5db199SXin Litests or setup a fully automated test grid, depending on what you are up to. 9*9c5db199SXin LiA non extensive list of functionality is: 10*9c5db199SXin Li 11*9c5db199SXin Li* A body of code to run tests on the device under test. In this setup, test 12*9c5db199SXin Li logic executes on the machine being tested, and results are written to files 13*9c5db199SXin Li for later collection from a development machine or lab infrastructure. 14*9c5db199SXin Li 15*9c5db199SXin Li* A body of code to run tests against a remote device under test. In this 16*9c5db199SXin Li setup, test logic executes on a development machine or piece of lab 17*9c5db199SXin Li infrastructure, and the device under test is controlled remotely via 18*9c5db199SXin Li SSH/adb/some combination of the above. 19*9c5db199SXin Li 20*9c5db199SXin Li* Developer tools to execute one or more tests. `test_that` for ChromeOS and 21*9c5db199SXin Li `test_droid` for Android allow developers to run tests against a device 22*9c5db199SXin Li connected to their development machine on their desk. These tools are written 23*9c5db199SXin Li so that the same test logic that runs in the lab will run at their desk, 24*9c5db199SXin Li reducing the number of configurations under which tests are run. 25*9c5db199SXin Li 26*9c5db199SXin Li* Lab infrastructure to automate the running of tests. This infrastructure is 27*9c5db199SXin Li capable of managing and running tests against thousands of devices in various 28*9c5db199SXin Li lab environments. This includes code for both synchronous and asynchronous 29*9c5db199SXin Li scheduling of tests. Tests are run against this hardware daily to validate 30*9c5db199SXin Li every build of ChromeOS. 31*9c5db199SXin Li 32*9c5db199SXin Li* Infrastructure to set up miniature replicas of a full lab. A full lab does 33*9c5db199SXin Li entail a certain amount of administrative work which isn't appropriate for 34*9c5db199SXin Li a work group interested in automated tests against a small set of devices. 35*9c5db199SXin Li Since this scale is common during device bringup, a special setup, called 36*9c5db199SXin Li Moblab, allows a natural progressing from desk -> mini lab -> full lab. 37*9c5db199SXin Li 38*9c5db199SXin Li## Run some autotests 39*9c5db199SXin Li 40*9c5db199SXin LiSee the guides to `test_that` and `test_droid`: 41*9c5db199SXin Li 42*9c5db199SXin Li[test\_droid Basic Usage](docs/test-droid.md) 43*9c5db199SXin Li 44*9c5db199SXin Li[test\_that Basic Usage](docs/test-that.md) 45*9c5db199SXin Li 46*9c5db199SXin Li## Write some autotests 47*9c5db199SXin Li 48*9c5db199SXin LiSee the best practices guide, existing tests, and comments in the code. 49*9c5db199SXin Li 50*9c5db199SXin Li[Autotest Best Practices](docs/best-practices.md) 51*9c5db199SXin Li 52*9c5db199SXin Li 53*9c5db199SXin Li## Grabbing the latest source 54*9c5db199SXin Li 55*9c5db199SXin Li`git clone https://chromium.googlesource.com/chromiumos/third_party/autotest` 56*9c5db199SXin Li 57*9c5db199SXin Li## Hacking and submitting patches 58*9c5db199SXin Li 59*9c5db199SXin LiSee the coding style guide for guidance on submitting patches. 60*9c5db199SXin Li 61*9c5db199SXin Li[Coding Style](docs/coding-style.md) 62*9c5db199SXin Li 63*9c5db199SXin Li## Pre-upload hook dependencies 64*9c5db199SXin Li 65*9c5db199SXin LiYou need to run `utils/build_externals.py` to set up the dependencies 66*9c5db199SXin Lifor pre-upload hook tests. 67*9c5db199SXin Li 68*9c5db199SXin Li## Setting up Lucifer 69*9c5db199SXin Li 70*9c5db199SXin Li[Setting up Lucifer](docs/lucifer-setup.md) 71