summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authortermie <github@anarkystic.com>2011-05-25 15:42:24 -0700
committertermie <github@anarkystic.com>2011-05-25 15:42:24 -0700
commitfdd27860724cd57db6df059a97e98289f88ce6ac (patch)
tree16df4112803d456994bf98bec56ffa25816edd35 /nova/tests
parentdb18a792414240cbdb1221d0e79e8a63313f103e (diff)
add support to rpc for multicall
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_rpc.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/nova/tests/test_rpc.py b/nova/tests/test_rpc.py
index 44d7c91eb..92ddfcffc 100644
--- a/nova/tests/test_rpc.py
+++ b/nova/tests/test_rpc.py
@@ -49,6 +49,17 @@ class RpcTestCase(test.TestCase):
"args": {"value": value}})
self.assertEqual(value, result)
+ def test_multicall_succeed_three_times(self):
+ """Get a value through rpc call"""
+ value = 42
+ result = rpc.multicall(self.context,
+ 'test',
+ {"method": "echo_three_times",
+ "args": {"value": value}})
+
+ for x in result:
+ self.assertEqual(value, x)
+
def test_context_passed(self):
"""Makes sure a context is passed through rpc call"""
value = 42
@@ -127,6 +138,12 @@ class TestReceiver(object):
return context.to_dict()
@staticmethod
+ def echo_three_times(context, value):
+ context.reply(value)
+ context.reply(value)
+ context.reply(value)
+
+ @staticmethod
def fail(context, value):
"""Raises an exception with the value sent in"""
raise Exception(value)