diff options
author | Bob Fournier <bfournie@redhat.com> | 2021-03-31 14:58:26 -0400 |
---|---|---|
committer | Bob Fournier <bfournie@redhat.com> | 2021-03-31 15:02:57 -0400 |
commit | 8bd25a9882e64ae378974e974c39b874d4b9b0e8 (patch) | |
tree | 031e12c128f90310c91240b0503626dd000d2ed2 /ironic/tests/unit/drivers/modules/redfish/test_management.py | |
parent | c9f9c2ca9be7baeb72265de73feec0bf51645274 (diff) | |
download | ironic-8bd25a9882e64ae378974e974c39b874d4b9b0e8.tar.gz |
Restrict syncing of boot mode to Supermicro
The fix for https://storyboard.openstack.org/#!/story/2008252 synced
the boot mode after changing the boot device, because Supermicro nodes
reset the boot mode if not included in the boot device set. However this
can cause a problem on Dell nodes when changing the mode uefi->bios or
bios->uefi. Restrict the syncing of the boot mode to Supermicro.
Story: 2008712
Task: 42046
Change-Id: I9f305cb3f33766c1c93cf4347368b1ce025fc635
Diffstat (limited to 'ironic/tests/unit/drivers/modules/redfish/test_management.py')
-rw-r--r-- | ironic/tests/unit/drivers/modules/redfish/test_management.py | 23 |
1 files changed, 12 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 c2a1bacf7..a74e3d8e1 100644 --- a/ironic/tests/unit/drivers/modules/redfish/test_management.py +++ b/ironic/tests/unit/drivers/modules/redfish/test_management.py @@ -127,8 +127,7 @@ class RedfishManagementTestCase(db_base.DbTestCase): # Asserts 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)]) + enabled=sushy.BOOT_SOURCE_ENABLED_ONCE)]) mock_get_system.assert_called_with(task.node) self.assertNotIn('redfish_boot_device', task.node.driver_internal_info) @@ -154,8 +153,7 @@ class RedfishManagementTestCase(db_base.DbTestCase): 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)]) + enabled=expected)]) mock_get_system.assert_called_with(task.node) self.assertNotIn('redfish_boot_device', task.node.driver_internal_info) @@ -182,8 +180,7 @@ class RedfishManagementTestCase(db_base.DbTestCase): task, boot_devices.PXE, persistent=target) 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.call(sushy.BOOT_SOURCE_TARGET_PXE, enabled=None)]) mock_get_system.assert_called_with(task.node) # Reset mocks @@ -289,11 +286,15 @@ class RedfishManagementTestCase(db_base.DbTestCase): shared=False) as task: task.driver.management.set_boot_device( task, boot_devices.PXE, persistent=True) - - 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)]) + if vendor == 'SuperMicro': + 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)]) + else: + fake_system.set_system_boot_options.assert_has_calls( + [mock.call(sushy.BOOT_SOURCE_TARGET_PXE, + enabled=expected)]) # Reset mocks fake_system.set_system_boot_options.reset_mock() |