xref: /aosp_15_r20/external/autotest/server/site_tests/hardware_DiskFirmwareUpgrade/control (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Copyright (c) 2013 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
5AUTHOR = "gwendal"
6NAME = 'hardware_DiskFirmwareUpgrade_Server'
7PURPOSE = 'Verify diskfirmware upgrade is not broken'
8TIME = 'SHORT'
9TEST_CLASS = 'hardware'
10TEST_TYPE = 'server'
11DEPENDENCIES = 'storage:ssd'
12ATTRIBUTES = "suite:experimental"
13PY_VERSION = 3
14
15DOC = """
16The test uses a list of firmware packages and applies them to the DUT.
17Each package is in a directory listed below.
18Each directory normaly contains a rule file and bzipped firmware image.
19After each tries, the package present in the base image is applied, to be
20in a good state for the next package.
21For each package, a list of 2 parameters is needed:
221 - the expected return code of chromeos-disk-firmware-update.sh:
23The test verifies the returned error code matches the expected value.
242 - A boolean:
25 - True if the update script should upgrade the firmware on the SSD.
26 - False if the update script is not supposed to touch the firmware on the SSD.
27The tests depend on the storage device installed on the machine.
28A regex allows separating the tests based on the device installed.
29"""
30
31DISK_FW_PACKAGES = {
32    r'LITEONIT LSS-.*' : {
33        'broken_firmware_liteon': [0, True], # revert to previous firmware
34        'missing_firmware_liteon': [1, False], # package without fw image
35        'invalid_firmware_liteon': [5, False], # package with invalid fw image.
36        'invalid_revision_liteon': [121, True], # with wrong target revision.
37    },
38    # eMMC device in hexa:
39    # MAG2GC:      4d4147324743
40    # HBG4e\05:    484247346505
41    # DS2016:      445332303136
42    # Samsung 128GB : 4455524d3452
43    r'(4d4147324743|484247346505|445332303136|4455524d3452)' : {
44        'test_firmware' : [0, True], # revert to previous firmware
45    },
46    # SATA
47    r'(KINGSTON RBU-S.S.*|LITEON CS1-SP.*)' : {
48        'test_firmware' : [0, True], # revert to previous firmware
49    },
50    # NVMe
51    r'(SAMSUNG KUS040205M-B001)' : {
52        'test_firmware' : [0, True], # revert to previous firmware
53    },
54    r'.*' : {
55        'missing_rules': [120, False], # rule file is missing.
56    }
57}
58
59def run_hardware_disk_firmware_upgrade(machine):
60    job.run_test('hardware_DiskFirmwareUpgrade',
61                 host=hosts.create_host(machine),
62                 disk_fw_packages=DISK_FW_PACKAGES)
63
64job.parallel_simple(run_hardware_disk_firmware_upgrade, machines)
65
66