From d2495a092c2720eb4d7e795c9c03a9b217ab471e Mon Sep 17 00:00:00 2001 From: Iury Gregory Melo Ferreira Date: Wed, 3 Feb 2021 14:44:41 +0100 Subject: [PATCH] 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 --- ironic_python_agent/tests/unit/extensions/test_standby.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ironic_python_agent/tests/unit/extensions/test_standby.py b/ironic_python_agent/tests/unit/extensions/test_standby.py index 68b2c5d76..57a99a84c 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)