xref: /aosp_15_r20/external/autotest/server/site_tests/firmware_Cr50RMAOpen/control (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Copyright 2018 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_Cr50RMAOpen"
9PURPOSE = "Verify RMA Open"
10ATTRIBUTES = "suite:faft_cr50_pvt, suite:faft_cr50_prepvt"
11TIME = "SHORT"
12TEST_TYPE = "server"
13DEPENDENCIES = "servo_state:WORKING"
14PY_VERSION = 3
15
16DOC = """
17Verify Cr50 RMA behavoior
18
19Verify a couple of things:
20    - basic open from AP and command line
21    - Rate limiting
22    - Authcodes can't be reused once another challenge is generated.
23    - if the image is prod signed with mp flags, it isn't using test keys
24
25Generate the challenge and calculate the response using rma_reset -c. Verify
26open works and enables all of the ccd features.
27
28If the generated challenge has the wrong version, make sure the challenge
29generated with the test key fails.
30"""
31
32if 'args_dict' not in locals():
33    args_dict = {}
34
35args_dict.update(utils.args_to_dict(args))
36servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
37
38def run(machine):
39    host = hosts.create_host(machine, servo_args=servo_args)
40
41    iterations = int(args_dict.get("iterations", 1))
42
43    job.run_test("firmware_Cr50RMAOpen", host=host, cmdline_args=args,
44                 full_args=args_dict, iterations=iterations)
45
46parallel_simple(run, machines)
47