"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ironic/tests/unit/drivers/modules/drac/test_inspect.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_inspect.py  (ironic-17.0.2):test_inspect.py  (ironic-17.0.3)
skipping to change at line 636 skipping to change at line 636
@mock.patch.object(redfish_utils, 'get_system', autospec=True) @mock.patch.object(redfish_utils, 'get_system', autospec=True)
def test__get_pxe_port_macs_without_boot_mode(self, mock_get_system): def test__get_pxe_port_macs_without_boot_mode(self, mock_get_system):
system_mock = self.init_system_mock(mock_get_system.return_value) system_mock = self.init_system_mock(mock_get_system.return_value)
system_mock.boot.mode = None system_mock.boot.mode = None
expected_pxe_mac = [] expected_pxe_mac = []
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:
pxe_port_macs = task.driver.inspect._get_pxe_port_macs(task) pxe_port_macs = task.driver.inspect._get_pxe_port_macs(task)
self.assertEqual(expected_pxe_mac, pxe_port_macs) self.assertEqual(expected_pxe_mac, pxe_port_macs)
@mock.patch.object(redfish_utils, 'get_system', autospec=True)
def test__get_pxe_port_macs_missing_oem(self, mock_get_system):
mock_system = self.init_system_mock(mock_get_system.return_value)
mock_manager = mock.MagicMock()
mock_system.boot.mode = 'bios'
mock_system.managers = [mock_manager]
set_mgr = (
mock_manager.get_oem_extension.return_value.get_pxe_port_macs_bios)
set_mgr.side_effect = sushy.exceptions.OEMExtensionNotFoundError
with task_manager.acquire(self.context, self.node.uuid,
shared=False) as task:
self.assertRaises(exception.RedfishError,
task.driver.inspect._get_pxe_port_macs,
task)
@mock.patch.object(redfish_utils, 'get_system', autospec=True)
def test__get_pxe_port_macs_no_manager(self, mock_get_system):
mock_system = self.init_system_mock(mock_get_system.return_value)
mock_system.boot.mode = 'bios'
mock_system.managers = []
with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task:
self.assertRaises(exception.RedfishError,
task.driver.inspect._get_pxe_port_macs,
task)
@mock.patch.object(redfish_inspect.RedfishInspect, 'inspect_hardware', @mock.patch.object(redfish_inspect.RedfishInspect, 'inspect_hardware',
autospec=True) autospec=True)
@mock.patch.object(inspect_utils, 'create_ports_if_not_exist', @mock.patch.object(inspect_utils, 'create_ports_if_not_exist',
autospec=True) autospec=True)
def test_inspect_hardware_with_ethernet_interfaces_mac( def test_inspect_hardware_with_ethernet_interfaces_mac(
self, mock_create_ports_if_not_exist, mock_inspect_hardware): self, mock_create_ports_if_not_exist, mock_inspect_hardware):
ethernet_interfaces_mac = {'NIC.Integrated.1-1-1': ethernet_interfaces_mac = {'NIC.Integrated.1-1-1':
'24:6E:96:70:49:00'} '24:6E:96:70:49:00'}
mock_inspect_hardware.return_value = states.MANAGEABLE mock_inspect_hardware.return_value = states.MANAGEABLE
with task_manager.acquire(self.context, self.node.uuid, with task_manager.acquire(self.context, self.node.uuid,
 End of changes. 1 change blocks. 
27 lines changed or deleted 0 lines changed or added

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