core-admin/qubes/ext
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
..
__init__.py Fix issues found by pylint 2.0 2018-07-15 23:51:15 +02:00
admin.py ext/admin: workaround for extension's __init__() called multiple times 2020-03-31 01:57:22 +02:00
audio.py audio/gui: use simply vm.tags instead of list() 2020-03-08 17:07:29 +01:00
block.py ext/block: prefer connecting cdrom as xvdd 2019-11-19 14:03:21 +01:00
core_features.py Support qubes.VMExec call 2020-01-24 16:57:13 +01:00
gui.py audio/gui: use simply vm.tags instead of list() 2020-03-08 17:07:29 +01:00
pci.py ext/pci: handle 'qubes-close' event 2020-01-11 03:54:30 +01:00
qubesmanager.py Change license to LGPL v2.1+ 2017-10-12 00:11:50 +02:00
r3compatibility.py Do not generate R3 compat firewall rules if R4 format is supported 2018-10-15 06:05:05 +02:00
services.py Ensure empty service value delete /var/run/qubes-service/ file 2020-03-08 23:08:48 +01:00
windows.py factor out utils.coro_maybe() 2019-06-28 10:29:24 +00:00