| # Copyright 2017 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. |
| |
| AUTHOR = "mruthven" |
| NAME = "firmware_Cr50Update.erase_nvmem" |
| PURPOSE = "Verify Cr50 update" |
| TIME = "SHORT" |
| TEST_TYPE = "server" |
| |
| DOC = """ |
| This test verifies Cr50 can recover from erased nvmem. |
| |
| The test will update to the dev image and then rollback to the release image. |
| During the rollback Cr50 will erase nvmem. The test verifies the device boots |
| into normal mode and not recovery after nvmem has been erased. |
| |
| The release_image needs to have a version lower than the dev_image. The |
| dev_image needs to have a higher version than the release image and whatever |
| image is running on Cr50 at the start of the test to guarantee that the |
| original state can be restored. |
| |
| After the test is complete the original Cr50 image will be reflashed onto the |
| device. |
| |
| @param iterations: the number of iterations to run |
| @param dev_image: the location of the dev image. Must be built with CR50_DEV=1 |
| @param release_image: the location of the release image |
| """ |
| |
| from autotest_lib.client.common_lib import error |
| from autotest_lib.server import utils |
| |
| args_dict = utils.args_to_dict(args) |
| servo_args = hosts.CrosHost.get_servo_arguments(args_dict) |
| |
| iterations = int(args_dict.get("iterations", 1)) |
| release_image = args_dict.get("release_image", "") |
| dev_image = args_dict.get("dev_image", "") |
| test = "erase_nvmem" |
| |
| def run(machine): |
| host = hosts.create_host(machine, servo_args=servo_args) |
| |
| job.run_test("firmware_Cr50Update", host=host, cmdline_args=args, |
| release_image=release_image, dev_image=dev_image, |
| test=test, iterations=iterations) |
| |
| parallel_simple(run, machines) |