uitests: Add vsockdetails full coverage

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-08-22 14:21:49 -04:00
parent bc9d6cf6d5
commit 4c439cda21
3 changed files with 15 additions and 9 deletions

View File

@ -687,14 +687,14 @@ Foo bar baz &amp; yeah boii &lt; &gt; yeahfoo
<description>Test alternate devices that can't be crammed in <description>Test alternate devices that can't be crammed in
test-many-devices, like an alternate RNG, EOL OS ID, title field test-many-devices, like an alternate RNG, EOL OS ID, title field
</description> </description>
<title>test alternate devs (title)</title> <title>test alternate devs title</title>
<metadata> <metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/msdos/6.22"/> <libosinfo:os id="http://microsoft.com/msdos/6.22"/>
</libosinfo:libosinfo> </libosinfo:libosinfo>
</metadata> </metadata>
<memory>8388608</memory> <memory unit='GiB'>128</memory>
<currentMemory>2097152</currentMemory> <currentMemory unit='GiB'>64</currentMemory>
<vcpu>2</vcpu> <vcpu>2</vcpu>
<cpu mode='host-model'/> <cpu mode='host-model'/>
<os> <os>
@ -710,6 +710,9 @@ test-many-devices, like an alternate RNG, EOL OS ID, title field
<rate bytes='123' period='1234'/> <rate bytes='123' period='1234'/>
<backend model='random'>/dev/hwrng</backend> <backend model='random'>/dev/hwrng</backend>
</rng> </rng>
<vsock model='virtio'>
<cid auto='yes'/>
</vsock>
</devices> </devices>
</domain> </domain>

View File

@ -37,12 +37,12 @@ class Details(uiutils.UITestCase):
# Test cases # # Test cases #
############## ##############
def testDetailsHardwareSmokeTest(self): def _testSmokeTest(self, vmname):
""" """
Open the VM with all the crazy hardware and just verify that each Open the VM with all the crazy hardware and just verify that each
HW panel shows itself without raising any error. HW panel shows itself without raising any error.
""" """
win = self._open_details_window(double=True) win = self._open_details_window(vmname=vmname, double=True)
lst = win.find("hw-list", "table") lst = win.find("hw-list", "table")
self._walkUIList(win, lst, lambda: False) self._walkUIList(win, lst, lambda: False)
@ -50,6 +50,12 @@ class Details(uiutils.UITestCase):
win.find("XML", "page tab").click() win.find("XML", "page tab").click()
self._walkUIList(win, lst, lambda: False, reverse=True) self._walkUIList(win, lst, lambda: False, reverse=True)
def testDetailsHardwareSmokeTest(self):
self._testSmokeTest(None)
def testDetailsHardwareSmokeTestAlternate(self):
self._testSmokeTest("test alternate devs title")
def _testRename(self, origname, newname): def _testRename(self, origname, newname):
win = self._open_details_window(origname) win = self._open_details_window(origname)

View File

@ -51,10 +51,7 @@ class vmmVsockDetails(vmmGObjectUI):
self.reset_state() self.reset_state()
is_auto = bool(dev.auto_cid) is_auto = bool(dev.auto_cid)
if dev.cid is not None: cid = int(dev.cid or self.MIN_GUEST_CID)
cid = int(dev.cid)
else:
cid = self.MIN_GUEST_CID
label = self.widget("vsock-auto").get_label().split(" (")[0] label = self.widget("vsock-auto").get_label().split(" (")[0]
if is_auto and self.vm.is_active(): if is_auto and self.vm.is_active():