tests: encourage to release the lock after completing the setup
Many functions and especially standalone tools takes the lock itself, so to prevent deadlocks, as a rule execute the tests with lock released. Also reload qubes.xml before cleanup.
This commit is contained in:
parent
ae6ca5c0a3
commit
67ea5bc441
@ -187,8 +187,8 @@ class SystemTestsMixin(object):
|
|||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
This method instantiates QubesVmCollection acquires write lock for
|
This method instantiates QubesVmCollection acquires write lock for
|
||||||
it. You can use is as :py:attr:`qc`. Do not release the lock
|
it. You can use is as :py:attr:`qc`. You can (and probably
|
||||||
yourself.
|
should) release the lock at the end of setUp in subclass
|
||||||
'''
|
'''
|
||||||
|
|
||||||
super(SystemTestsMixin, self).setUp()
|
super(SystemTestsMixin, self).setUp()
|
||||||
@ -205,6 +205,10 @@ class SystemTestsMixin(object):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
super(SystemTestsMixin, self).tearDown()
|
super(SystemTestsMixin, self).tearDown()
|
||||||
|
|
||||||
|
try: self.qc.lock_db_for_writing()
|
||||||
|
except qubes.qubes.QubesException: pass
|
||||||
|
self.qc.load()
|
||||||
|
|
||||||
self.remove_test_vms()
|
self.remove_test_vms()
|
||||||
|
|
||||||
self.qc.save()
|
self.qc.save()
|
||||||
|
@ -47,6 +47,7 @@ class TC_00_AppVM(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase):
|
|||||||
template=self.qc.get_default_template())
|
template=self.qc.get_default_template())
|
||||||
self.testvm2.create_on_disk(verbose=False)
|
self.testvm2.create_on_disk(verbose=False)
|
||||||
self.qc.save()
|
self.qc.save()
|
||||||
|
self.qc.unlock_db()
|
||||||
|
|
||||||
|
|
||||||
def test_000_start_shutdown(self):
|
def test_000_start_shutdown(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user