diff --git a/tests/__init__.py b/tests/__init__.py index 0feaf1e6..ef9e92be 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -187,8 +187,8 @@ class SystemTestsMixin(object): .. warning:: This method instantiates QubesVmCollection acquires write lock for - it. You can use is as :py:attr:`qc`. Do not release the lock - yourself. + it. You can use is as :py:attr:`qc`. You can (and probably + should) release the lock at the end of setUp in subclass ''' super(SystemTestsMixin, self).setUp() @@ -205,6 +205,10 @@ class SystemTestsMixin(object): def tearDown(self): super(SystemTestsMixin, self).tearDown() + try: self.qc.lock_db_for_writing() + except qubes.qubes.QubesException: pass + self.qc.load() + self.remove_test_vms() self.qc.save() diff --git a/tests/vm_qrexec_gui.py b/tests/vm_qrexec_gui.py index 660e63b8..0878ea98 100644 --- a/tests/vm_qrexec_gui.py +++ b/tests/vm_qrexec_gui.py @@ -47,6 +47,7 @@ class TC_00_AppVM(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase): template=self.qc.get_default_template()) self.testvm2.create_on_disk(verbose=False) self.qc.save() + self.qc.unlock_db() def test_000_start_shutdown(self):