From 576a561dd89ab27f4d91e402609d3cca69e298d6 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 19 Dec 2012 17:38:52 -0500 Subject: Add get_backdoor_port to cert. This adds a get_backdoor_port function to the cert service which enables returning the eventlet_backdoor port from rpc for the service. Change-Id: Iea2b1f9587ea2749c2def921d6a0d1e86f1645ee --- nova/tests/cert/test_rpcapi.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'nova/tests') diff --git a/nova/tests/cert/test_rpcapi.py b/nova/tests/cert/test_rpcapi.py index 8db8a0f6c..f61d42408 100644 --- a/nova/tests/cert/test_rpcapi.py +++ b/nova/tests/cert/test_rpcapi.py @@ -33,8 +33,12 @@ class CertRpcAPITestCase(test.TestCase): ctxt = context.RequestContext('fake_user', 'fake_project') rpcapi = cert_rpcapi.CertAPI() expected_retval = 'foo' + expected_version = kwargs.pop('version', rpcapi.BASE_RPC_API_VERSION) expected_msg = rpcapi.make_msg(method, **kwargs) - expected_msg['version'] = rpcapi.BASE_RPC_API_VERSION + expected_msg['version'] = expected_version + + if method == 'get_backdoor_port': + del expected_msg['args']['host'] self.call_ctxt = None self.call_topic = None @@ -84,3 +88,7 @@ class CertRpcAPITestCase(test.TestCase): def test_decrypt_text(self): self._test_cert_api('decrypt_text', project_id='fake_project_id', text='blah') + + def test_get_backdoor_port(self): + self._test_cert_api('get_backdoor_port', host='fake_host', + version='1.1') -- cgit