From: Noel Power Date: Mon, 19 Nov 2018 09:39:06 +0000 (+0000) Subject: python/samba/tests: PY3 make sure traffic_learner is called with correct python X-Git-Tag: tdb-1.3.17~438 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd62f4b66760e574be568516c087e04577121a94;p=thirdparty%2Fsamba.git python/samba/tests: PY3 make sure traffic_learner is called with correct python Also path to traffic_learner is not in the normal 'bin' path so also adjusted the insertion of PYTHON version to cover this Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py index a3f0652750d..2eaf9785a1d 100644 --- a/python/samba/tests/__init__.py +++ b/python/samba/tests/__init__.py @@ -384,11 +384,16 @@ class BlackboxTestCase(TestCaseInTempDir): parts = line.split(" ", 1) cmd = parts[0] exe = os.path.join(BINDIR, cmd) + + python_cmds = ["samba-tool", + "samba_dnsupdate", + "script/traffic_replay", + "script/traffic_learner"] + if os.path.exists(exe): - python_cmds = ["samba-tool", "samba_dnsupdate", "script/traffic_replay"] parts[0] = exe - if cmd in python_cmds and os.getenv("PYTHON", None): - parts.insert(0, os.environ["PYTHON"]) + if cmd in python_cmds and os.getenv("PYTHON", None): + parts.insert(0, os.environ["PYTHON"]) if not isinstance(line, list): line = " ".join(parts)