• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2017 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5from autotest_lib.server import utils
6
7AUTHOR = "mruthven"
8NAME = "firmware_Cr50BID"
9PURPOSE = "Verify cr50 response to board id"
10ATTRIBUTES = "suite:cr50_stress_flaky"
11TIME = "LONG"
12TEST_TYPE = "server"
13DEPENDENCIES = "servo"
14
15DOC = """
16Verify cr50 board id behavior on a board id locked image.
17
18Check that cr50 will not accept mismatched board ids when it is running a board
19id locked image.
20
21Set the board id on a non board id locked image and verify cr50 will rollback
22when it is updated to a mismatched board id image.
23
24All of the path args are optional. If they are given, then the test will use
25the local images to run the test. If they aren't, the test will download the
26needed cr50 images.
27
28The board id locked test image will be found using the given bid_path or
29downloaded from google storage using the information in bid, bid_mask, and
30bid_flags. If these aren't given the debug image with TEST:0xffff:0xff00 will
31be used.
32
33@param iterations: Number of times to run the test
34@param dev_path: local path for the dev image
35@param bid_path: local path for the board id locked image. If this is given, the
36                 board id, mask and flags will be gotten from the image. Bid,
37                 bid_mask, and bid_flags will be ignored.
38@param release_ver: The version string. ${rw_ver}/${image_bid}. This is needed
39                    to run the test with a released board id locked image.
40@param test_subset: a ',' separated string with the index of each test case to
41                    run.
42"""
43
44args_dict = utils.args_to_dict(args)
45servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
46
47def run(machine):
48    host = hosts.create_host(machine, servo_args=servo_args)
49
50    iterations = int(args_dict.get("iterations", 1))
51    dev_path = args_dict.get("dev_path", "")
52    bid_path = args_dict.get("bid_path", "")
53    release_ver = args_dict.get("release_ver", "")
54    test_subset = args_dict.get("test_subset", "")
55
56    job.run_test("firmware_Cr50BID", host=host, cmdline_args=args,
57                 iterations=iterations, dev_path=dev_path, bid_path=bid_path,
58                 release_ver=release_ver, test_subset=test_subset)
59
60parallel_simple(run, machines)
61