1# Copyright 2019 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.faft_cr50_tot" 9PURPOSE = "Verify RMA Open" 10ATTRIBUTES = "suite:faft_cr50_tot" 11TIME = "SHORT" 12TEST_TYPE = "server" 13DEPENDENCIES = "servo_state:WORKING" 14 15DOC = """ 16Verify Cr50 RMA behavoior 17 18Verify a couple of things: 19 - basic open from AP and command line 20 - Rate limiting 21 - Authcodes can't be reused once another challenge is generated. 22 - if the image is prod signed with mp flags, it isn't using test keys 23 24Generate the challenge and calculate the response using rma_reset -c. Verify 25open works and enables all of the ccd features. 26 27If the generated challenge has the wrong version, make sure the challenge 28generated with the test key fails. 29 30This test is applicable when using ToT cr50 module. 31TODO(crbug.com/1014572) Drop this control file once suites can inject test args. 32""" 33 34if 'args_dict' not in locals(): 35 args_dict = {} 36 37args_dict.update(utils.args_to_dict(args)) 38servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 39 40# crbug.com/1014572: Inject test args. 41args_dict['tot_test_run'] = 'true' 42 43def run(machine): 44 host = hosts.create_host(machine, servo_args=servo_args) 45 46 iterations = int(args_dict.get("iterations", 1)) 47 48 job.run_test("firmware_Cr50RMAOpen", host=host, cmdline_args=args, 49 full_args=args_dict, iterations=iterations) 50 51parallel_simple(run, machines) 52