core-admin/qubes
Marek Marczykowski-Górecki b11d6e058b
ext/admin: workaround for extension's __init__() called multiple times
... during tests.
qubes.ext.Extension class is a weird thing that tries to make each extension
a singleton. But this unfortunately have a side effect that __init__()
is called separately for each "instance" (created in Qubes()'s
__init__()), even though this is really the same object. During normal
execution this isn't an issue, because there is just one Qubes() object
instance. But during tests, multiple objects are created.

In this particular case, it caused PolicyCache() to be created twice and
the second one overriden the first one - without properly cleaning it
up. This leaks a file descriptor (inotify one). The fact that cleanup()
was called twice too didn't helped, because it was really called on
the same object, the one requiring cleanup was already gone.

Workaround this by checking if policy_cache field is initialize and
avoid re-initialize it. Also, on Qubes() object cleanup remove that
field, so it can be properly initialized on the next test iteration.
2020-03-31 01:57:22 +02:00
..
api api/internal: extract get_system_info() function 2020-03-09 19:25:10 +01:00
ext ext/admin: workaround for extension's __init__() called multiple times 2020-03-31 01:57:22 +02:00
qmemman qmemmand: separate SystemState init xc and xs to a 'init' method 2019-11-22 21:38:27 +01:00
storage Merge remote-tracking branch 'origin/pr/320' 2020-03-09 18:34:49 +01:00
tests tests: teardown fixes 2020-03-28 03:23:29 +01:00
tools Remove python2 compat __future__ imports 2020-02-15 17:33:34 +00:00
vm qubesvm: Let HVMs enter 'Running' state 2020-03-08 22:39:16 -04:00
__init__.py qubes module: Typo fix 2020-03-08 22:39:16 -04:00
app.py Support for AudioVM 2020-03-08 17:05:33 +01:00
backup.py Remove python2 compat __future__ imports 2020-02-15 17:33:34 +00:00
config.py config: fix mistake in path for services 2020-03-08 09:47:09 +01:00
devices.py Make pylint happy 2019-09-27 16:29:20 +02:00
dochelpers.py Fix Sphinx 2 new API for Fedora 31+ 2019-11-22 21:39:31 +01:00
events.py Fix issues found by pylint 2.0 2018-07-15 23:51:15 +02:00
exc.py Fixed Exceptions inferiting from KeyError 2019-12-09 21:02:24 +01:00
features.py qubes/features: check_with_(template_and_)adminvm 2018-12-20 18:28:33 +01:00
firewall.py Make pylint happy 2019-09-27 16:29:20 +02:00
log.py Change license to LGPL v2.1+ 2017-10-12 00:11:50 +02:00
rngdoc.py Remove python2 compat __future__ imports 2020-02-15 17:33:34 +00:00
tarwriter.py Change license to LGPL v2.1+ 2017-10-12 00:11:50 +02:00
utils.py Fix invalid timezone 2019-08-06 18:23:00 -03:00