Home | History | Annotate | Download | only in firmware_Cr50BID
      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 
      5 from autotest_lib.server import utils
      6 
      7 AUTHOR = "mruthven"
      8 NAME = "firmware_Cr50BID"
      9 PURPOSE = "Verify cr50 response to board id"
     10 ATTRIBUTES = "suite:cr50_stress_flaky"
     11 TIME = "LONG"
     12 TEST_TYPE = "server"
     13 DEPENDENCIES = "servo"
     14 
     15 DOC = """
     16 Verify cr50 board id behavior on a board id locked image.
     17 
     18 Check that cr50 will not accept mismatched board ids when it is running a board
     19 id locked image.
     20 
     21 Set the board id on a non board id locked image and verify cr50 will rollback
     22 when it is updated to a mismatched board id image.
     23 
     24 All of the path args are optional. If they are given, then the test will use
     25 the local images to run the test. If they aren't, the test will download the
     26 needed cr50 images.
     27 
     28 The board id locked test image will be found using the given bid_path or
     29 downloaded from google storage using the information in bid, bid_mask, and
     30 bid_flags. If these aren't given the debug image with TEST:0xffff:0xff00 will
     31 be 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 
     44 args_dict = utils.args_to_dict(args)
     45 servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
     46 
     47 def 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 
     60 parallel_simple(run, machines)
     61