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::
|
||||
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()
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user