Mock tests to return bios boot mode

When running IPA unit tests on machines configured
with UEFI and GPT partition table, some tests will
fail.

Change-Id: I155a47242b526b8f243a5e94bc14da8431f1ab91
This commit is contained in:
Iury Gregory Melo Ferreira 2021-02-03 14:44:41 +01:00
parent 68a43b9da8
commit d2495a092c
1 changed files with 3 additions and 0 deletions

View File

@ -195,6 +195,7 @@ class TestStandbyExtension(base.IronicAgentTest):
execute_mock.assert_called_once_with(*command, check_exit_code=[0])
@mock.patch.object(utils, 'get_node_boot_mode', lambda self: 'bios')
@mock.patch.object(hardware, 'dispatch_to_managers', autospec=True)
@mock.patch('builtins.open', autospec=True)
@mock.patch('ironic_python_agent.utils.execute', autospec=True)
@ -241,6 +242,7 @@ class TestStandbyExtension(base.IronicAgentTest):
disk_label=disk_label,
cpu_arch=cpu_arch)
@mock.patch.object(utils, 'get_node_boot_mode', lambda self: 'bios')
@mock.patch.object(hardware, 'dispatch_to_managers', autospec=True)
@mock.patch('builtins.open', autospec=True)
@mock.patch('ironic_python_agent.utils.execute', autospec=True)
@ -316,6 +318,7 @@ class TestStandbyExtension(base.IronicAgentTest):
image_mb_mock.assert_called_once_with(image_path)
self.assertFalse(work_on_disk_mock.called)
@mock.patch.object(utils, 'get_node_boot_mode', lambda self: 'bios')
@mock.patch.object(hardware, 'dispatch_to_managers', autospec=True)
@mock.patch('builtins.open', autospec=True)
@mock.patch('ironic_python_agent.utils.execute', autospec=True)