blob: f71a91fc6ce7736924cd2367fdbd088c45a58090 [file] [log] [blame]
# Copyright (c) 2023 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
AUTHOR = "Ricardo Canuelo <ricardo.canuelo@collabora.com>"
NAME = "fwupd_FirmwareInstallFile"
METADATA = {
"contacts": ["chromeos-fwupd@google.com", "bleung@google.com", "ricardo.canuelo@collabora.com"],
"bug_component": "b:857851", # ChromeOS > Platform > Services > Peripherals > Firmware Update - fwupd
"hw_agnostic": True,
"author": "Ricardo Canuelo <ricardo.canuelo@collabora.com>",
"criteria": "Test that the FW of a device can be flashed with a specific file using fwupd.",
"purpose": "Flashes a firmware file on a specific device using fwupd."
}
TIME = "SHORT"
TEST_TYPE = "client"
ATTRIBUTES = "suite:fwupd_install_file"
DOC = """
Installs a specific firmware file in a selected device. The device is
supposed to be working and updatable, the firmware file is expected to
be available either in the specified URL or in an external drive with
label=FWUPDTESTS connected to the DUT and fwupd is expected to work
normally. Exceptional cases are treated as test errors.
"""
# Arguments 'device_id' and 'file' are mandatory. 'device_id' can be
# the fwupd instance id of the device or any of its GUIDs, 'file' is
# the URL of the firmware binary or its path in an external drive
# labeled as FWUPDTESTS
# Argument 'cert_id' is the Certificate ID used for signing reports,
# could be omitted.
args_dict = utils.args_to_dict(args)
try:
cert_id = args_dict.get('cert_id', cert_id)
except NameError:
cert_id = args_dict.get('cert_id', '')
try:
device_id = args_dict.get('device_id', device_id)
except NameError:
device_id = args_dict.get('device_id', '')
try:
fwfile = args_dict.get('fwfile', fwfile)
except NameError:
fwfile = args_dict.get('fwfile', '')
job.run_test('fwupd_FirmwareInstallFile', device_id=device_id, fwfile=fwfile, cert_id=cert_id)