diff options
author | Zuul <zuul@review.opendev.org> | 2020-07-09 16:38:09 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-07-09 16:38:09 +0000 |
commit | a63672f48505e6cb20aaef17e69bf53bc243db2c (patch) | |
tree | 1120790eec914dae46b0f533054c73623b7a472a /ironic/tests/unit/conductor | |
parent | dd98265fc7f04f1f9b7e6d0132bb89b7b5cf6504 (diff) | |
parent | f73338c995c184fdd3762ee0bb168c5e77df8773 (diff) | |
download | ironic-a63672f48505e6cb20aaef17e69bf53bc243db2c.tar.gz |
Merge "Minor agent token log handling"
Diffstat (limited to 'ironic/tests/unit/conductor')
-rw-r--r-- | ironic/tests/unit/conductor/test_manager.py | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/ironic/tests/unit/conductor/test_manager.py b/ironic/tests/unit/conductor/test_manager.py index c7cbf0024..91067d770 100644 --- a/ironic/tests/unit/conductor/test_manager.py +++ b/ironic/tests/unit/conductor/test_manager.py @@ -7185,9 +7185,10 @@ class DoNodeAdoptionTestCase(mgr_utils.ServiceSetUpMixin, db_base.DbTestCase): mock_spawn.side_effect = self._fake_spawn - self.assertRaises( - exception.InvalidParameterValue, self.service.heartbeat, + exc = self.assertRaises( + messaging.rpc.ExpectedException, self.service.heartbeat, self.context, node.uuid, 'http://callback', agent_token=None) + self.assertEqual(exception.InvalidParameterValue, exc.exc_info[0]) self.assertFalse(mock_heartbeat.called) @mock.patch('ironic.drivers.modules.fake.FakeDeploy.heartbeat', @@ -7260,10 +7261,11 @@ class DoNodeAdoptionTestCase(mgr_utils.ServiceSetUpMixin, db_base.DbTestCase): mock_spawn.side_effect = self._fake_spawn - self.assertRaises(exception.InvalidParameterValue, - self.service.heartbeat, self.context, - node.uuid, 'http://callback', - agent_token='evil', agent_version='5.0.0b23') + exc = self.assertRaises(messaging.rpc.ExpectedException, + self.service.heartbeat, self.context, + node.uuid, 'http://callback', + agent_token='evil', agent_version='5.0.0b23') + self.assertEqual(exception.InvalidParameterValue, exc.exc_info[0]) self.assertFalse(mock_heartbeat.called) @mock.patch('ironic.drivers.modules.fake.FakeDeploy.heartbeat', @@ -7287,10 +7289,11 @@ class DoNodeAdoptionTestCase(mgr_utils.ServiceSetUpMixin, db_base.DbTestCase): mock_spawn.side_effect = self._fake_spawn # Intentionally sending an older client in case something fishy # occurs. - self.assertRaises(exception.InvalidParameterValue, - self.service.heartbeat, self.context, - node.uuid, 'http://callback', - agent_token='evil', agent_version='4.0.0') + exc = self.assertRaises(messaging.rpc.ExpectedException, + self.service.heartbeat, self.context, + node.uuid, 'http://callback', + agent_token='evil', agent_version='4.0.0') + self.assertEqual(exception.InvalidParameterValue, exc.exc_info[0]) self.assertFalse(mock_heartbeat.called) @mock.patch('ironic.drivers.modules.fake.FakeDeploy.heartbeat', @@ -7312,10 +7315,11 @@ class DoNodeAdoptionTestCase(mgr_utils.ServiceSetUpMixin, db_base.DbTestCase): mock_spawn.side_effect = self._fake_spawn - self.assertRaises(exception.InvalidParameterValue, - self.service.heartbeat, self.context, - node.uuid, 'http://callback', - agent_token=None, agent_version='6.1.5') + exc = self.assertRaises(messaging.rpc.ExpectedException, + self.service.heartbeat, self.context, + node.uuid, 'http://callback', + agent_token=None, agent_version='6.1.5') + self.assertEqual(exception.InvalidParameterValue, exc.exc_info[0]) self.assertFalse(mock_heartbeat.called) |