uitests: console: Add live lxc serial test

This commit is contained in:
Cole Robinson
2018-01-21 12:40:15 -05:00
parent d774d01e1c
commit a10fda6b5c
4 changed files with 30 additions and 0 deletions

View File

@@ -123,3 +123,13 @@ class Console(uiutils.UITestCase):
return self._checkPassword()
@_vm_wrapper("uitests-lxc-serial", uri="lxc:///")
def testConsoleLXCSerial(self):
"""
Ensure LXC has serial open, and we can send some data
"""
win = self.app.topwin
term = win.find("Serial Terminal")
self.assertTrue(term.showing)
term.typeText("help\n")
self.assertTrue("COMMANDS" in term.text)

View File

@@ -0,0 +1,14 @@
<domain type='lxc'>
<name>uitests-lxc-serial</name>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64'>exe</type>
<init>/bin/sh</init>
</os>
<devices>
<console type='pty'/>
</devices>
</domain>

View File

@@ -6165,6 +6165,11 @@
<object class="GtkNotebook" id="serial-pages">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="serial-pages-atkobject">
<property name="AtkObject::accessible-name">serial-pages</property>
</object>
</child>
</object>
<packing>
<property name="position">2</property>

View File

@@ -336,6 +336,7 @@ class vmmSerialConsole(vmmGObject):
self.terminal = Vte.Terminal()
self.terminal.set_scrollback_lines(1000)
self.terminal.set_audible_bell(False)
self.terminal.get_accessible().set_name("Serial Terminal")
self.terminal.connect("button-press-event", self.show_serial_rcpopup)
self.terminal.connect("commit", self.console.send_data, self.terminal)