Add .flash extn to supported raw firmware files

Some compact firmware files when extracted produce raw firmware files
with .flash extension. This adds support for those firmware file types.
Modified a test case to include the supported raw firmware file types.

Closes-Bug: #1568792
Change-Id: I911ad3dc26d43547546b10500ed640602a338a7c
This commit is contained in:
Debayan Ray
2016-04-11 04:14:44 -07:00
parent 56bab01427
commit da7a4830bb
2 changed files with 4 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ LOG = log.get_logger(__name__)
SUPPORTED_FIRMWARE_UPDATE_COMPONENTS = ['ilo', 'cpld', 'power_pic', 'bios',
'chassis']
# Supported raw firmware file extensions
RAW_FIRMWARE_EXTNS = ['.hex', '.bin', '.vme']
RAW_FIRMWARE_EXTNS = ['.hex', '.bin', '.vme', '.flash']
def check_firmware_update_component(func):

View File

@@ -106,11 +106,11 @@ class FirmwareControllerModuleTestCase(unittest.TestCase):
_extract_rpm_file_mock.assert_called_once_with(
fw_img_extractor, 'some_target_file', 'some_extract_path')
def test_no_op_extract_gets_invoked_for_raw_firmware_file(self):
@ddt.data('any_file.hex', 'any_file.bin', 'any_file.vme', 'any_file.flash')
def test_no_op_extract_gets_invoked_for_raw_firmware_file(self,
any_raw_file):
# no_op extract when fw_img_extractor is initialized
# with raw firmware file
# | GIVEN |
any_raw_file = 'any_file.bin'
# | WHEN |
fw_img_extractor = firmware_controller.get_fw_extractor(any_raw_file)
return_result, is_extracted = fw_img_extractor.extract()