diff options
author | Dmitry Tantsur <dtantsur@protonmail.com> | 2021-01-20 12:11:54 +0100 |
---|---|---|
committer | Dmitry Tantsur <dtantsur@protonmail.com> | 2021-01-28 16:41:45 +0100 |
commit | 121b3348c813eb075ca38bd264a9315ee3acc2fe (patch) | |
tree | d5d142ae8da3cf56a4bb198c2d42ccc9ba5bbcd0 /ironic/tests/unit/drivers/modules/redfish/test_management.py | |
parent | fd34d3c437e15dd53c0acac39bdf600123fbb1de (diff) | |
download | ironic-121b3348c813eb075ca38bd264a9315ee3acc2fe.tar.gz |
Refactor vendor detection and add Redfish implementation
Get rid of the TODO in the code and prepare for more management
interfaces supporting detect_vendor(). Vendor detecting now runs
during transition to manageable and on power state sync (essentially
same as before but for all drivers not only IPMI).
Update the IPMI implementation to no longer hide exceptions since
they're not handled on the upper level. Simplify the regex and fix
the docstring.
Add the Redfish implementation as a foundation for future
vendor-specific changes.
Change-Id: Ie521cf2295613dde5842cbf9a053540a40be4b9c
Diffstat (limited to 'ironic/tests/unit/drivers/modules/redfish/test_management.py')
-rw-r--r-- | ironic/tests/unit/drivers/modules/redfish/test_management.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ironic/tests/unit/drivers/modules/redfish/test_management.py b/ironic/tests/unit/drivers/modules/redfish/test_management.py index a1fb4e8d0..dc67e17d6 100644 --- a/ironic/tests/unit/drivers/modules/redfish/test_management.py +++ b/ironic/tests/unit/drivers/modules/redfish/test_management.py @@ -702,6 +702,14 @@ class RedfishManagementTestCase(db_base.DbTestCase): self.assertEqual(indicator_states.ON, state) + @mock.patch.object(redfish_utils, 'get_system', autospec=True) + def test_detect_vendor(self, mock_get_system): + mock_get_system.return_value.manufacturer = "Fake GmbH" + with task_manager.acquire(self.context, self.node.uuid, + shared=True) as task: + response = task.driver.management.detect_vendor(task) + self.assertEqual("Fake GmbH", response) + @mock.patch.object(manager_utils, 'node_power_action', autospec=True) @mock.patch.object(deploy_utils, 'get_async_step_return_state', autospec=True) |