"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ironic/tests/unit/drivers/modules/redfish/test_boot.py" between
ironic-17.0.2.tar.gz and ironic-17.0.3.tar.gz

About: OpenStack Ironic (Optional Service: Bare-Metal Provisioning) aims to provision bare metal machines instead of virtual machines, forked from the Nova baremetal driver.
The "Wallaby" series (latest release).

test_boot.py  (ironic-17.0.2):test_boot.py  (ironic-17.0.3)
skipping to change at line 220 skipping to change at line 220
'http://ramdisk/img', actual_instance_info['ramdisk']) 'http://ramdisk/img', actual_instance_info['ramdisk'])
def test_parse_deploy_info_exc(self): def test_parse_deploy_info_exc(self):
with task_manager.acquire(self.context, self.node.uuid, with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task: shared=True) as task:
self.assertRaises(exception.MissingParameterValue, self.assertRaises(exception.MissingParameterValue,
redfish_boot._parse_deploy_info, redfish_boot._parse_deploy_info,
task.node) task.node)
@mock.patch.object(redfish_utils, 'parse_driver_info', autospec=True) @mock.patch.object(redfish_utils, 'parse_driver_info', autospec=True)
@mock.patch.object(deploy_utils, 'validate_image_properties', def test_validate_local(self, mock_parse_driver_info):
autospec=True)
@mock.patch.object(boot_mode_utils, 'get_boot_mode_for_deploy',
autospec=True)
def test_validate_uefi_boot(self, mock_get_boot_mode,
mock_validate_image_properties,
mock_parse_driver_info):
with task_manager.acquire(self.context, self.node.uuid, with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task: shared=True) as task:
task.node.instance_info.update( task.node.instance_info = {}
{'kernel': 'kernel',
'ramdisk': 'ramdisk',
'image_source': 'http://image/source'}
)
task.node.driver_info.update( task.node.driver_info.update(
{'deploy_kernel': 'kernel', {'deploy_kernel': 'kernel',
'deploy_ramdisk': 'ramdisk', 'deploy_ramdisk': 'ramdisk',
'bootloader': 'bootloader'} 'bootloader': 'bootloader'}
) )
mock_get_boot_mode.return_value = 'uefi'
task.driver.boot.validate(task) task.driver.boot.validate(task)
mock_validate_image_properties.assert_called_once_with( @mock.patch.object(deploy_utils, 'get_boot_option', lambda node: 'ramdisk')
mock.ANY, mock.ANY, mock.ANY)
@mock.patch.object(redfish_utils, 'parse_driver_info', autospec=True) @mock.patch.object(redfish_utils, 'parse_driver_info', autospec=True)
@mock.patch.object(deploy_utils, 'validate_image_properties', @mock.patch.object(deploy_utils, 'validate_image_properties',
autospec=True) autospec=True)
@mock.patch.object(boot_mode_utils, 'get_boot_mode_for_deploy', def test_validate_kernel_ramdisk(self, mock_validate_image_properties,
autospec=True) mock_parse_driver_info):
def test_validate_bios_boot(self, mock_get_boot_mode,
mock_validate_image_properties,
mock_parse_driver_info):
with task_manager.acquire(self.context, self.node.uuid, with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task: shared=True) as task:
task.node.instance_info.update( task.node.instance_info.update(
{'kernel': 'kernel', {'kernel': 'kernel',
'ramdisk': 'ramdisk', 'ramdisk': 'ramdisk',
'image_source': 'http://image/source'} 'image_source': 'http://image/source'}
) )
task.node.driver_info.update( task.node.driver_info.update(
{'deploy_kernel': 'kernel', {'deploy_kernel': 'kernel',
'deploy_ramdisk': 'ramdisk', 'deploy_ramdisk': 'ramdisk',
'bootloader': 'bootloader'} 'bootloader': 'bootloader'}
) )
mock_get_boot_mode.return_value = 'bios'
task.driver.boot.validate(task) task.driver.boot.validate(task)
mock_validate_image_properties.assert_called_once_with( mock_validate_image_properties.assert_called_once_with(
mock.ANY, mock.ANY, mock.ANY) task.context, mock.ANY, ['kernel', 'ramdisk'])
@mock.patch.object(deploy_utils, 'get_boot_option', lambda node: 'ramdisk')
@mock.patch.object(redfish_utils, 'parse_driver_info', autospec=True) @mock.patch.object(redfish_utils, 'parse_driver_info', autospec=True)
@mock.patch.object(deploy_utils, 'validate_image_properties', @mock.patch.object(deploy_utils, 'validate_image_properties',
autospec=True) autospec=True)
@mock.patch.object(boot_mode_utils, 'get_boot_mode_for_deploy', def test_validate_boot_iso(self, mock_validate_image_properties,
autospec=True) mock_parse_driver_info):
def test_validate_bios_boot_iso(self, mock_get_boot_mode,
mock_validate_image_properties,
mock_parse_driver_info):
with task_manager.acquire(self.context, self.node.uuid, with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task: shared=True) as task:
task.node.instance_info.update( task.node.instance_info.update(
{'boot_iso': 'http://localhost/file.iso'} {'boot_iso': 'http://localhost/file.iso'}
) )
task.node.driver_info.update( task.node.driver_info.update(
{'deploy_kernel': 'kernel', {'deploy_kernel': 'kernel',
'deploy_ramdisk': 'ramdisk', 'deploy_ramdisk': 'ramdisk',
'bootloader': 'bootloader'} 'bootloader': 'bootloader'}
) )
# NOTE(TheJulia): Boot mode doesn't matter for this
# test scenario.
mock_get_boot_mode.return_value = 'bios'
task.driver.boot.validate(task)
mock_validate_image_properties.assert_called_once_with(
mock.ANY, mock.ANY, mock.ANY)
@mock.patch.object(redfish_utils, 'parse_driver_info', autospec=True)
@mock.patch.object(deploy_utils, 'validate_image_properties',
autospec=True)
@mock.patch.object(boot_mode_utils, 'get_boot_mode_for_deploy',
autospec=True)
def test_validate_bios_boot_iso_conflicting_image_source(
self, mock_get_boot_mode,
mock_validate_image_properties,
mock_parse_driver_info):
with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task:
task.node.instance_info.update(
{'boot_iso': 'http://localhost/file.iso',
'image_source': 'http://localhost/file.img'}
)
task.node.driver_info.update(
{'deploy_kernel': 'kernel',
'deploy_ramdisk': 'ramdisk',
'bootloader': 'bootloader'}
)
# NOTE(TheJulia): Boot mode doesn't matter for this
# test scenario.
mock_get_boot_mode.return_value = 'bios'
task.driver.boot.validate(task) task.driver.boot.validate(task)
mock_validate_image_properties.assert_called_once_with( mock_validate_image_properties.assert_called_once_with(
mock.ANY, mock.ANY, mock.ANY) task.context, mock.ANY, ['boot_iso'])
@mock.patch.object(redfish_utils, 'parse_driver_info', autospec=True) @mock.patch.object(redfish_utils, 'parse_driver_info', autospec=True)
@mock.patch.object(deploy_utils, 'validate_image_properties', @mock.patch.object(deploy_utils, 'validate_image_properties',
autospec=True) autospec=True)
def test_validate_correct_vendor(self, mock_validate_image_properties, def test_validate_correct_vendor(self, mock_validate_image_properties,
mock_parse_driver_info): mock_parse_driver_info):
with task_manager.acquire(self.context, self.node.uuid, with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task: shared=True) as task:
task.node.instance_info.update( task.node.instance_info.update(
{'kernel': 'kernel', {'kernel': 'kernel',
 End of changes. 11 change blocks. 
64 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)