"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ironic/tests/unit/drivers/modules/redfish/test_management.py" between
ironic-16.0.2.tar.gz and ironic-16.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 "Victoria" series (latest release).

test_management.py  (ironic-16.0.2):test_management.py  (ironic-16.0.3)
skipping to change at line 1095 skipping to change at line 1095
self.node.save() self.node.save()
management = redfish_mgmt.RedfishManagement() management = redfish_mgmt.RedfishManagement()
with task_manager.acquire(self.context, self.node.uuid, with task_manager.acquire(self.context, self.node.uuid,
shared=False) as task: shared=False) as task:
management._check_node_firmware_update(task) management._check_node_firmware_update(task)
self.assertTrue(mock_log.called) self.assertTrue(mock_log.called)
@mock.patch.object(manager_utils, 'cleaning_error_handler', autospec=True) @mock.patch.object(manager_utils, 'cleaning_error_handler', autospec=True)
@mock.patch.object(redfish_mgmt.LOG, 'error', autospec=True)
@mock.patch.object(redfish_utils, 'get_update_service', autospec=True) @mock.patch.object(redfish_utils, 'get_update_service', autospec=True)
def test__check_node_firmware_update_fail(self, def test__check_node_firmware_update_fail(self,
mock_get_update_service, mock_get_update_service,
mock_log,
mock_cleaning_error_handler): mock_cleaning_error_handler):
mock_sushy_task = mock.Mock() mock_sushy_task = mock.Mock()
mock_sushy_task.task_state = 'exception' mock_sushy_task.task_state = 'exception'
mock_message_unparsed = mock.Mock() mock_message_unparsed = mock.Mock()
mock_message_unparsed.message = None mock_message_unparsed.message = None
mock_message = mock.Mock() mock_message = mock.Mock()
mock_message.message = 'Firmware upgrade failed' mock_message.message = 'Firmware upgrade failed'
messages = mock.PropertyMock(side_effect=[[mock_message_unparsed], messages = mock.PropertyMock(side_effect=[[mock_message_unparsed],
[mock_message]]) [mock_message]])
type(mock_sushy_task).messages = messages type(mock_sushy_task).messages = messages
skipping to change at line 1133 skipping to change at line 1131
management._continue_firmware_updates = mock.Mock() management._continue_firmware_updates = mock.Mock()
with task_manager.acquire(self.context, self.node.uuid, with task_manager.acquire(self.context, self.node.uuid,
shared=False) as task: shared=False) as task:
task.upgrade_lock = mock.Mock() task.upgrade_lock = mock.Mock()
task.process_event = mock.Mock() task.process_event = mock.Mock()
management._check_node_firmware_update(task) management._check_node_firmware_update(task)
task.upgrade_lock.assert_called_once_with() task.upgrade_lock.assert_called_once_with()
self.assertTrue(mock_log.called)
self.assertEqual({'something': 'else'}, self.assertEqual({'something': 'else'},
task.node.driver_internal_info) task.node.driver_internal_info)
mock_cleaning_error_handler.assert_called_once() mock_cleaning_error_handler.assert_called_once()
management._continue_firmware_updates.assert_not_called() management._continue_firmware_updates.assert_not_called()
@mock.patch.object(redfish_mgmt.LOG, 'info', autospec=True) @mock.patch.object(redfish_mgmt.LOG, 'info', autospec=True)
@mock.patch.object(redfish_utils, 'get_update_service', autospec=True) @mock.patch.object(redfish_utils, 'get_update_service', autospec=True)
def test__check_node_firmware_update_done(self, def test__check_node_firmware_update_done(self,
mock_get_update_service, mock_get_update_service,
mock_log): mock_log):
 End of changes. 3 change blocks. 
3 lines changed or deleted 0 lines changed or added

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