From 0a2d839f1b8b1bc67c3fd3bf5ecc0c4c5ab36b0e Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 10 Nov 2011 21:06:05 -0500 Subject: Converting consoles calls to use instance objects Related to blueprint internal-uuids Change-Id: I39da4d98ff64e8db22eecb1966f6506e8f14361e --- nova/tests/test_compute.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py index a4d86deec..0a0224beb 100644 --- a/nova/tests/test_compute.py +++ b/nova/tests/test_compute.py @@ -1839,4 +1839,33 @@ class ComputeAPITestCase(BaseTestCase): instance = self.compute_api.get(self.context, instance_id) self.compute_api.add_fixed_ip(self.context, instance, '1') self.compute_api.remove_fixed_ip(self.context, instance, '192.168.1.1') + + def test_vnc_console(self): + """Make sure we can a vnc console for an instance.""" + def vnc_rpc_call_wrapper(*args, **kwargs): + return {'token': 'asdf', 'host': '0.0.0.0', 'port': 8080} + + self.stubs.Set(rpc, 'call', vnc_rpc_call_wrapper) + + instance_id = self._create_instance() + instance = self.compute_api.get(self.context, instance_id) + console = self.compute_api.get_vnc_console(self.context, instance) + self.compute_api.delete(self.context, instance) + + def test_ajax_console(self): + """Make sure we can a vnc console for an instance.""" + def ajax_rpc_call_wrapper(*args, **kwargs): + return {'token': 'asdf', 'host': '0.0.0.0', 'port': 8080} + + self.stubs.Set(rpc, 'call', ajax_rpc_call_wrapper) + + instance_id = self._create_instance() + instance = self.compute_api.get(self.context, instance_id) + console = self.compute_api.get_ajax_console(self.context, instance) + self.compute_api.delete(self.context, instance) + + def test_console_output(self): + instance_id = self._create_instance() + instance = self.compute_api.get(self.context, instance_id) + console = self.compute_api.get_console_output(self.context, instance) self.compute_api.delete(self.context, instance) -- cgit