mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
uitests: Add connection tick failure testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
@@ -38,3 +38,12 @@ class UITestConnection(uiutils.UITestCase):
|
||||
self.sleep(.5)
|
||||
uiutils.check(
|
||||
lambda: "test-many-devices" not in self.app.topwin.fmt_nodes())
|
||||
|
||||
def testConnectionConnCrash(self):
|
||||
self.app.open(
|
||||
extra_opts=["--test-options=conn-crash"])
|
||||
manager = self.app.topwin
|
||||
|
||||
self.sleep(1)
|
||||
manager.find(r"^test testdriver.xml - Not Connected", "table cell")
|
||||
uiutils.check(lambda: manager.active)
|
||||
|
||||
@@ -1205,6 +1205,12 @@ class vmmConnection(vmmGObject):
|
||||
elif obj.is_nodedev() and not pollnodedev:
|
||||
continue
|
||||
|
||||
if self.config.CLITestOptions.conn_crash:
|
||||
self._backend.close()
|
||||
e = libvirt.libvirtError("fake error")
|
||||
e.err = [libvirt.VIR_ERR_SYSTEM_ERROR]
|
||||
raise e
|
||||
|
||||
obj.tick(stats_update=stats_update)
|
||||
except Exception as e:
|
||||
log.exception("Tick for %s failed", obj)
|
||||
|
||||
Reference in New Issue
Block a user