summaryrefslogtreecommitdiff
path: root/ironic/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-11-02 02:45:02 +0000
committerGerrit Code Review <review@openstack.org>2020-11-02 02:45:02 +0000
commitb7f0d1230fa049e0a862142e9bb773db5002645d (patch)
treee2cd65787aa9e39ecc8358c67601cf4781c82984 /ironic/tests
parent619c6052aef3f0935e6b4bb9d2df5205859d895c (diff)
parent861e91c8616db39e589589629bd5305909067331 (diff)
downloadironic-b7f0d1230fa049e0a862142e9bb773db5002645d.tar.gz
Merge "Sync boot mode when changing the boot device via Redfish" into stable/victoria
Diffstat (limited to 'ironic/tests')
-rw-r--r--ironic/tests/unit/drivers/modules/redfish/test_management.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/ironic/tests/unit/drivers/modules/redfish/test_management.py b/ironic/tests/unit/drivers/modules/redfish/test_management.py
index 827dbf9bb..f592c0865 100644
--- a/ironic/tests/unit/drivers/modules/redfish/test_management.py
+++ b/ironic/tests/unit/drivers/modules/redfish/test_management.py
@@ -101,9 +101,11 @@ class RedfishManagementTestCase(db_base.DbTestCase):
task.driver.management.set_boot_device(task, target)
# Asserts
- fake_system.set_system_boot_options.assert_called_once_with(
- expected, enabled=sushy.BOOT_SOURCE_ENABLED_ONCE)
- mock_get_system.assert_called_once_with(task.node)
+ fake_system.set_system_boot_options.assert_has_calls(
+ [mock.call(expected,
+ enabled=sushy.BOOT_SOURCE_ENABLED_ONCE),
+ mock.call(mode=sushy.BOOT_SOURCE_MODE_BIOS)])
+ mock_get_system.assert_called_with(task.node)
self.assertNotIn('redfish_boot_device',
task.node.driver_internal_info)
@@ -126,9 +128,11 @@ class RedfishManagementTestCase(db_base.DbTestCase):
task.driver.management.set_boot_device(
task, boot_devices.PXE, persistent=target)
- fake_system.set_system_boot_options.assert_called_once_with(
- sushy.BOOT_SOURCE_TARGET_PXE, enabled=expected)
- mock_get_system.assert_called_once_with(task.node)
+ fake_system.set_system_boot_options.assert_has_calls(
+ [mock.call(sushy.BOOT_SOURCE_TARGET_PXE,
+ enabled=expected),
+ mock.call(mode=sushy.BOOT_SOURCE_MODE_BIOS)])
+ mock_get_system.assert_called_with(task.node)
self.assertNotIn('redfish_boot_device',
task.node.driver_internal_info)
@@ -153,9 +157,10 @@ class RedfishManagementTestCase(db_base.DbTestCase):
task.driver.management.set_boot_device(
task, boot_devices.PXE, persistent=target)
- fake_system.set_system_boot_options.assert_called_once_with(
- sushy.BOOT_SOURCE_TARGET_PXE, enabled=None)
- mock_get_system.assert_called_once_with(task.node)
+ fake_system.set_system_boot_options.assert_has_calls(
+ [mock.call(sushy.BOOT_SOURCE_TARGET_PXE, enabled=None),
+ mock.call(mode=sushy.BOOT_SOURCE_MODE_BIOS)])
+ mock_get_system.assert_called_with(task.node)
# Reset mocks
fake_system.set_system_boot_options.reset_mock()
@@ -220,6 +225,7 @@ class RedfishManagementTestCase(db_base.DbTestCase):
fake_system.set_system_boot_options.side_effect = [
sushy.exceptions.SushyError(),
None,
+ None
]
mock_get_system.return_value = fake_system
with task_manager.acquire(self.context, self.node.uuid,
@@ -230,9 +236,9 @@ class RedfishManagementTestCase(db_base.DbTestCase):
mock.call(sushy.BOOT_SOURCE_TARGET_PXE,
enabled=sushy.BOOT_SOURCE_ENABLED_CONTINUOUS),
mock.call(sushy.BOOT_SOURCE_TARGET_PXE,
- enabled=sushy.BOOT_SOURCE_ENABLED_ONCE),
+ enabled=sushy.BOOT_SOURCE_ENABLED_ONCE)
])
- mock_get_system.assert_called_once_with(task.node)
+ mock_get_system.assert_called_with(task.node)
task.node.refresh()
self.assertEqual(