blob: 04081c9acea80c9f85fe1d9abd38e5eff782a52e [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_FirmwareInstallVersion"
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 to a specific version using fwupd.",
"purpose": "Flashes the firmware of a device to a specific version using fwupd."
}
TIME = "SHORT"
TEST_TYPE = "client"
ATTRIBUTES = "suite:fwupd_install_version"
DOC = """
Installs a specific firmware version in a selected device. The device is
supposed to be working and updatable, the firmware version is expected
to be available in the default fwupd remotes and fwupd is expected to
work normally. Exceptional cases are treated as test errors.
"""
# Arguments 'device_id' and 'version' are mandatory. 'device_id' can be
# the fwupd instance id of the device or any of its GUIDs, 'version' is
# the FW version string as defined by the FW release
# 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:
version = args_dict.get('version', version)
except NameError:
version = args_dict.get('version', '')
job.run_test('fwupd_FirmwareInstallVersion', device_id=device_id, version=version, cert_id=cert_id)