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 14 DOC = """ 15 The test uses a list of firmware packages and applies them to the DUT. 16 Each package is in a directory listed below. 17 Each directory normaly contains a rule file and bzipped firmware image. 18 After each tries, the package present in the base image is applied, to be 19 in a good state for the next package. 20 For each package, a list of 2 parameters is needed: 21 1 - the expected return code of chromeos-disk-firmware-update.sh: 22 The test verifies the returned error code matches the expected value. 23 2 - 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. 26 The tests depend on the storage device installed on the machine. 27 A regex allows separating the tests based on the device installed. 28 """ 29 30 DISK_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 r'(4d4147324743|484247346505|445332303136)' : { 42 'test_firmware' : [0, True], # revert to previous firmware 43 }, 44 # SATA 45 r'(KINGSTON RBU-S.S.*|LITEON CS1-SP.*)' : { 46 'test_firmware' : [0, True], # revert to previous firmware 47 }, 48 # NVMe 49 r'(SAMSUNG KUS040205M-B001)' : { 50 'test_firmware' : [0, True], # revert to previous firmware 51 }, 52 r'.*' : { 53 'missing_rules': [120, False], # rule file is missing. 54 } 55 } 56 57 def run_hardware_disk_firmware_upgrade(machine): 58 job.run_test('hardware_DiskFirmwareUpgrade', 59 host=hosts.create_host(machine), 60 disk_fw_packages=DISK_FW_PACKAGES) 61 62 job.parallel_simple(run_hardware_disk_firmware_upgrade, machines) 63 64