Fix create configuration unit tests

The unit tests for create_configuration give different result if
ran on a bios or uefi booted machine because they get the
partition table type value based on the utils function
get_node_boot_mode.
Let's mock the boot_mode as we do in other tests to get an
independent result.

Change-Id: Ic0e7daea7ec4ce0806cd126c27166f84690c5d9e
This commit is contained in:
Riccardo Pittau 2022-12-15 11:49:34 +01:00
parent a1670753a2
commit 604c7081db

View File

@ -4492,6 +4492,7 @@ class TestGenericHardwareManager(base.IronicAgentTest):
self.hardware.create_configuration,
self.node, [])
@mock.patch.object(utils, 'get_node_boot_mode', lambda node: 'bios')
@mock.patch.object(raid_utils, 'get_volume_name_of_raid_device',
autospec=True)
@mock.patch.object(raid_utils, '_get_actual_component_devices',
@ -4626,6 +4627,7 @@ class TestGenericHardwareManager(base.IronicAgentTest):
mocked_execute.assert_called_once_with(
'mdadm', '--examine', '/dev/md0', use_standard_locale=True)
@mock.patch.object(utils, 'get_node_boot_mode', lambda node: 'bios')
@mock.patch.object(raid_utils, '_get_actual_component_devices',
autospec=True)
@mock.patch.object(hardware, 'list_all_block_devices', autospec=True)