Home | History | Annotate | Download | only in hardware_DiskFirmwareUpgrade
      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 
      5 AUTHOR = "gwendal"
      6 NAME = 'hardware_DiskFirmwareUpgrade_Server'
      7 PURPOSE = 'Verify diskfirmware upgrade is not broken'
      8 TIME = 'SHORT'
      9 TEST_CLASS = 'hardware'
     10 TEST_TYPE = 'server'
     11 DEPENDENCIES = 'storage:ssd'
     12 ATTRIBUTES = "suite:experimental"
     13 SUITE = 'experimental'
     14 
     15 DOC = """
     16 The test uses a list of firmware packages and applies them to the DUT.
     17 Each package is in a directory listed below.
     18 Each directory normaly contains a rule file and bzipped firmware image.
     19 After each tries, the package present in the base image is applied, to be
     20 in a good state for the next package.
     21 For each package, a list of 2 parameters is needed:
     22 1 - the expected return code of chromeos-disk-firmware-update.sh:
     23 The test verifies the returned error code matches the expected value.
     24 2 - 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.
     27 The tests depend on the storage device installed on the machine.
     28 A regex allows separating the tests based on the device installed.
     29 """
     30 
     31 DISK_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     r'(4d4147324743|484247346505|445332303136|KINGSTON RBU-SUS.*|LITEON CS1-SP.*)' : {
     43         'test_firmware' : [0, True], # revert to previous firmware
     44     },
     45     r'.*' : {
     46         'missing_rules': [120, False], # rule file is missing.
     47     }
     48 }
     49 
     50 def run_hardware_disk_firmware_upgrade(machine):
     51     job.run_test('hardware_DiskFirmwareUpgrade',
     52                  host=hosts.create_host(machine),
     53                  disk_fw_packages=DISK_FW_PACKAGES)
     54 
     55 job.parallel_simple(run_hardware_disk_firmware_upgrade, machines)
     56 
     57