3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-19 02:39:29 +01:00

autotests: Clean up iwd process

If the process is launched by the test, then clean it up when the test
is cleaned up
This commit is contained in:
Denis Kenzior 2016-12-20 12:40:27 -06:00
parent cec1546fce
commit ed69774dbc

View File

@ -511,6 +511,7 @@ class IWD(AsyncOpAbstract):
_object_manager_if = None
_agent_manager_if = None
_known_network_manager_if = None
_iwd_proc = None
def __init__(self, start_iwd_daemon = False,
iwd_config_dir = IWD_CONFIG_DIR):
@ -531,6 +532,15 @@ class IWD(AsyncOpAbstract):
tries += 1
time.sleep(0.05)
self._iwd_proc = iwd_proc
def __del__(self):
if self._iwd_proc is None:
return
self._iwd_proc.terminate()
self._iwd_proc.wait()
@property
def _object_manager(self):
if self._object_manager_if is None: