add test to verify Cr50 update and recovery from erased nvmem

This test can be used to verify the cr50-update process, or recovery
from erased nvmem.

This test will update to the given dev image. After that, each iteration
of the test will start by rolling back to the oldest release image. It
will then use the cr50-update script to update to each image in order of
lowest to highest version. After all of the iterations are complete, the
test will reflash the Cr50 image that the dut had at the start of the
test.

This test verifies that the device updated and the update script did not
exit with any unexpected exit codes.

If erase_nvmem is being tested then nvmem will also be erased during
rollback.

There are four parameters in each control file: test_type, dev_image
release_image, and old_release_image. The image parameters are the
locations of the test images. If the test type is erase_nvmem then cr50
will erase nvmem before rolling back to the release image. The
old_release_image needs to have the oldest version if it is being used.
dev_image needs to have a version higher than release_image,
old_release_image, and whatever image is running on the DUT. If this is
not the case, the test cannot guarantee the original state of the dut is
restored.

There are two control files: control and control.erase_nvmem.
control.erase_nvmem will ignore 'old_release_image' and make sure the
test_type is set to 'erase_nvmem'.

CQ-DEPEND=CL:456624
BUG=b:35833679
BUG=b:35833781
BRANCH=none
TEST=test_that $DUT_IP firmware_Cr50Update
--args="iterations=3 old_release_image=$OLD_RELEASE
release_image=$RELEASE_IMAGE dev_image=$DEV_IMAGE"

Change-Id: I4e2f6c3a720f873e44caa6426f251fe0119cba30
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/456523
Reviewed-by: Wai-Hong Tam <waihong@google.com>
5 files changed
tree: 6f73e343613d7d99418a66992079975e97f4538d
  1. .gitignore
  2. .quickmerge_sentinel
  3. COMMIT-QUEUE.ini
  4. LGPL_LICENSE
  5. LICENSE
  6. PRESUBMIT.cfg
  7. README.md
  8. __init__.py
  9. apache/
  10. cli/
  11. client/
  12. common.py
  13. contrib/
  14. database/
  15. docs/
  16. frontend/
  17. global_config.ini
  18. logs/
  19. metadata.chromium
  20. moblab_config.ini
  21. packages/
  22. puppylab/
  23. results/
  24. scheduler/
  25. server/
  26. site_utils/
  27. ssp_deploy_config.json
  28. test_suites/
  29. tko/
  30. utils/
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