From 4c439cda21b11d002269e22c5ef2626f3baabf4b Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 22 Aug 2020 14:21:49 -0400 Subject: [PATCH] uitests: Add vsockdetails full coverage Signed-off-by: Cole Robinson --- tests/testdriver.xml | 9 ++++++--- tests/uitests/test_details.py | 10 ++++++++-- virtManager/device/vsockdetails.py | 5 +---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/testdriver.xml b/tests/testdriver.xml index 4edbd4c3..872c5a6f 100644 --- a/tests/testdriver.xml +++ b/tests/testdriver.xml @@ -687,14 +687,14 @@ Foo bar baz & yeah boii < > yeahfoo Test alternate devices that can't be crammed in test-many-devices, like an alternate RNG, EOL OS ID, title field - test alternate devs (title) + test alternate devs title - 8388608 - 2097152 + 128 + 64 2 @@ -710,6 +710,9 @@ test-many-devices, like an alternate RNG, EOL OS ID, title field /dev/hwrng + + + diff --git a/tests/uitests/test_details.py b/tests/uitests/test_details.py index 2dd02624..82ebf443 100644 --- a/tests/uitests/test_details.py +++ b/tests/uitests/test_details.py @@ -37,12 +37,12 @@ class Details(uiutils.UITestCase): # Test cases # ############## - def testDetailsHardwareSmokeTest(self): + def _testSmokeTest(self, vmname): """ Open the VM with all the crazy hardware and just verify that each 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") self._walkUIList(win, lst, lambda: False) @@ -50,6 +50,12 @@ class Details(uiutils.UITestCase): win.find("XML", "page tab").click() 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): win = self._open_details_window(origname) diff --git a/virtManager/device/vsockdetails.py b/virtManager/device/vsockdetails.py index 6f765e98..3f31cb12 100644 --- a/virtManager/device/vsockdetails.py +++ b/virtManager/device/vsockdetails.py @@ -51,10 +51,7 @@ class vmmVsockDetails(vmmGObjectUI): self.reset_state() is_auto = bool(dev.auto_cid) - if dev.cid is not None: - cid = int(dev.cid) - else: - cid = self.MIN_GUEST_CID + cid = int(dev.cid or self.MIN_GUEST_CID) label = self.widget("vsock-auto").get_label().split(" (")[0] if is_auto and self.vm.is_active():