From a83419011e76506740e0545b4e9ee9f7836b2e9d Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 26 Apr 2018 16:24:26 -0700 Subject: [PATCH] auto-t: Honor valgrind flag if iwd starts from python Before starting iwd, we check if IWD_TEST_VALGRIND was set by test-runner, and if so, start iwd with the appropriate valgrind options. --- autotests/util/iwd.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index 07fc0819..3e85b9b0 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -617,14 +617,24 @@ class IWD(AsyncOpAbstract): mainloop = GLib.MainLoop() if start_iwd_daemon: + args = [] iwd_wiphys = [wname for wname, wiphy in wiphy.wiphy_map.items() if any(intf for intf in wiphy.values() if intf.use == 'iwd')] whitelist = ','.join(iwd_wiphys) + if os.environ.get('IWD_TEST_VALGRIND', None) == 'on': + args.append('valgrind') + args.append('--leak-check=full') + + args.append('iwd') + args.append('-c') + args.append(iwd_config_dir) + args.append('-p') + args.append(whitelist) + import subprocess - iwd_proc = subprocess.Popen(['iwd', '-c', iwd_config_dir, '-p', - whitelist]) + iwd_proc = subprocess.Popen(args) self._iwd_proc = iwd_proc