summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2013-05-15 16:39:04 -0400
committerRussell Bryant <rbryant@redhat.com>2013-05-15 16:39:04 -0400
commitaa89d8b27a86abc1ba84133c655a49fa3ccda798 (patch)
tree04a2a0cf021fa850eb3aac8773a0157ab6ce2604 /tests
parent378701bf3b2c67b3b98e692076f78cb83c2a419e (diff)
downloadoslo-aa89d8b27a86abc1ba84133c655a49fa3ccda798.tar.gz
oslo-aa89d8b27a86abc1ba84133c655a49fa3ccda798.tar.xz
oslo-aa89d8b27a86abc1ba84133c655a49fa3ccda798.zip
Support capping message versions in the client.
When doing a rolling upgrade, we need to be able to tell all rpc clients to hold off on sending newer versions of messages until all nodes understand the new message version. This patch adds the oslo component of this. It's quite simple. The rpc proxy just stores the version cap and will raise an exception if code ever tries to send a message that exceeds this cap. Allowing the cap to be configured and generating different types of messages based on the configured value is the hard part here, but that is left up to the project using the rpc library. Implements blueprint rpc-version-control. Change-Id: Ia69db03a80dc3b1c63d52c7e163ea3cfec80c882
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/rpc/test_proxy.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/unit/rpc/test_proxy.py b/tests/unit/rpc/test_proxy.py
index a84a7ea..db6e5fa 100644
--- a/tests/unit/rpc/test_proxy.py
+++ b/tests/unit/rpc/test_proxy.py
@@ -85,6 +85,12 @@ class RpcProxyTestCase(utils.BaseTestCase):
new_msg['version'] = '1.1'
_check_args(ctxt, topic, new_msg)
+ # override the version to be above a specified cap
+ rpc_proxy.version_cap = '1.0'
+ self.assertRaises(rpc_common.RpcVersionCapError,
+ getattr(rpc_proxy, rpc_method), *args, version='1.1')
+ rpc_proxy.version_cap = None
+
if has_timeout:
# Set a timeout
retval = getattr(rpc_proxy, rpc_method)(ctxt, msg, timeout=42)