From 6a85592b51d70db2743a35c2ba2701ce285017d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 26 Jul 2017 03:05:27 +0200 Subject: [PATCH] tests: register libvirt events This is especially needed to have proper domain-shutdown event. --- qubes/tests/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qubes/tests/__init__.py b/qubes/tests/__init__.py index 19eb78b6..48b7a9d5 100644 --- a/qubes/tests/__init__.py +++ b/qubes/tests/__init__.py @@ -94,6 +94,9 @@ try: except libvirt.libvirtError: pass +if in_dom0: + import libvirtaio + try: in_git = subprocess.check_output( ['git', 'rev-parse', '--show-toplevel']).decode().strip() @@ -590,6 +593,7 @@ class SystemTestCase(QubesTestCase): if not in_dom0: self.skipTest('outside dom0') super(SystemTestCase, self).setUp() + libvirtaio.virEventRegisterAsyncIOImpl(loop=self.loop) self.remove_test_vms() # need some information from the real qubes.xml - at least installed @@ -603,6 +607,7 @@ class SystemTestCase(QubesTestCase): shutil.copy(self.host_app.store, XMLPATH) self.app = qubes.Qubes(XMLPATH) os.environ['QUBES_XML_PATH'] = XMLPATH + self.app.vmm.register_event_handlers(self.app) self.qubesd = self.loop.run_until_complete( qubes.api.create_servers(