summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIury Gregory Melo Ferreira <iurygregory@gmail.com>2021-02-03 14:44:41 +0100
committerIury Gregory Melo Ferreira <iurygregory@gmail.com>2021-02-03 14:44:41 +0100
commitd2495a092c2720eb4d7e795c9c03a9b217ab471e (patch)
treed16fb719908fe91119eb336280f4ce4cbe459478
parent68a43b9da81b550441da840cb548c5b8fd9ee5dd (diff)
downloadironic-python-agent-d2495a092c2720eb4d7e795c9c03a9b217ab471e.tar.gz
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
-rw-r--r--ironic_python_agent/tests/unit/extensions/test_standby.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ironic_python_agent/tests/unit/extensions/test_standby.py b/ironic_python_agent/tests/unit/extensions/test_standby.py
index 68b2c5d7..57a99a84 100644
--- a/ironic_python_agent/tests/unit/extensions/test_standby.py
+++ b/ironic_python_agent/tests/unit/extensions/test_standby.py
@@ -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)