1# Copyright 2020 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 = "Cr50 FW team"
8NAME = "firmware_Cr50CCDFirmwareUpdate"
9PURPOSE = "Verify flashing firmware through ccd_cr50"
10ATTRIBUTES = "suite:faft_cr50_prepvt, suite:faft_cr50_pvt"
11# We mark TIME as 'FAST' intentionally to have this test scheduled later than
12# other tests (having longer TIME attribute) among the test suite.
13# This is to minimize a side-effect of this test failures on the rest of
14# scheduled tests.
15TIME = "FAST"
16TEST_TYPE = "server"
17DEPENDENCIES = "servo_state:WORKING"
18
19DOC = """
20This is a test to program both EC and AP firmware through ccd_cr50 device.
21
22If you intend to backup and restore the original firmware, then add
23'--args="backup_fw=True"' to your test_that command line.
24"""
25
26if 'args_dict' not in locals():
27    args_dict = {}
28
29args_dict.update(utils.args_to_dict(args))
30servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
31
32def run(machine):
33    host = hosts.create_host(machine, servo_args=servo_args)
34    job.run_test('firmware_Cr50CCDFirmwareUpdate', host=host, cmdline_args=args,
35                 full_args=args_dict, rw_only=False)
36
37parallel_simple(run, machines)
38