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