Add support for SPICE consoles

While in theory both VNC and SPICE can be enabled at the same
time, this is not expected to be common. Thus, rather than
adding a 'SPICE console' tab, this renames the existing
'VNC console' tab to simply be 'Console'. This tab is setup
to prefer exposing a VNC console, but if that is not enabled,
then expose the SPICE console. The reason for this order is
that the noVNC widget has had much more testing than the
current spice-html5 widget. Thus if both VNC & SPICE are
enabled, VNC is likely a more reliable choice at this point
in time.

Blueprint: libvirt-spice
Change-Id: If3d3769fe8e29c5930ac8b42d841c92182c4be72
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange
2013-01-02 18:35:04 +00:00
parent 9f89dc4f37
commit 59b7e6011b
12 changed files with 130 additions and 41 deletions

View File

@@ -61,7 +61,7 @@ class ComputeApiTests(test.APITestCase):
def test_server_vnc_console(self):
server = self.servers.first()
console = self.servers.console_data
console = self.servers.vnc_console_data
console_type = console["console"]["type"]
novaclient = self.stub_novaclient()
@@ -75,6 +75,22 @@ class ComputeApiTests(test.APITestCase):
console_type)
self.assertIsInstance(ret_val, api.nova.VNCConsole)
def test_server_spice_console(self):
server = self.servers.first()
console = self.servers.spice_console_data
console_type = console["console"]["type"]
novaclient = self.stub_novaclient()
novaclient.servers = self.mox.CreateMockAnything()
novaclient.servers.get_spice_console(server.id,
console_type).AndReturn(console)
self.mox.ReplayAll()
ret_val = api.nova.server_spice_console(self.request,
server.id,
console_type)
self.assertIsInstance(ret_val, api.nova.SPICEConsole)
def test_server_list(self):
servers = self.servers.list()