diff options
author | Zuul <zuul@review.opendev.org> | 2022-09-05 09:26:57 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-09-05 09:26:57 +0000 |
commit | 7f933a1bedfc7576cfd1909cff3c610f27f37759 (patch) | |
tree | 94953f3275339e0e6501339a6383938a95601a53 /ironic/tests | |
parent | 9eec746660136b412d4a78f956b48798b2d8d961 (diff) | |
parent | c2ba869040f535e4bb83481d1fe9468e7e6991d8 (diff) | |
download | ironic-7f933a1bedfc7576cfd1909cff3c610f27f37759.tar.gz |
Merge "Redfish: Consider password part of the session cache"
Diffstat (limited to 'ironic/tests')
-rw-r--r-- | ironic/tests/unit/drivers/modules/redfish/test_utils.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ironic/tests/unit/drivers/modules/redfish/test_utils.py b/ironic/tests/unit/drivers/modules/redfish/test_utils.py index ca8aba9da..01b7089c7 100644 --- a/ironic/tests/unit/drivers/modules/redfish/test_utils.py +++ b/ironic/tests/unit/drivers/modules/redfish/test_utils.py @@ -252,6 +252,7 @@ class RedfishUtilsAuthTestCase(db_base.DbTestCase): redfish_utils.get_system(self.node) redfish_utils.get_system(self.node) self.assertEqual(1, mock_sushy.call_count) + self.assertEqual(len(redfish_utils.SessionCache._sessions), 1) @mock.patch.object(sushy, 'Sushy', autospec=True) def test_ensure_new_session_address(self, mock_sushy): @@ -270,6 +271,21 @@ class RedfishUtilsAuthTestCase(db_base.DbTestCase): self.assertEqual(2, mock_sushy.call_count) @mock.patch.object(sushy, 'Sushy', autospec=True) + def test_ensure_new_session_password(self, mock_sushy): + d_info = self.node.driver_info + d_info['redfish_username'] = 'foo' + d_info['redfish_password'] = 'bar' + self.node.driver_info = d_info + self.node.save() + redfish_utils.get_system(self.node) + d_info['redfish_password'] = 'foo' + self.node.driver_info = d_info + self.node.save() + redfish_utils.SessionCache._sessions = collections.OrderedDict() + redfish_utils.get_system(self.node) + self.assertEqual(2, mock_sushy.call_count) + + @mock.patch.object(sushy, 'Sushy', autospec=True) @mock.patch('ironic.drivers.modules.redfish.utils.' 'SessionCache.AUTH_CLASSES', autospec=True) @mock.patch('ironic.drivers.modules.redfish.utils.SessionCache._sessions', |