From ed69774dbc7e2221c17eb69acfb95ea51c449552 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 20 Dec 2016 12:40:27 -0600 Subject: [PATCH] autotests: Clean up iwd process If the process is launched by the test, then clean it up when the test is cleaned up --- autotests/util/iwd.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index 7e3dd146..a7c77207 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -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: