python/samba/tests: PY3 make sure traffic_learner is called with correct python
authorNoel Power <noel.power@suse.com>
Mon, 19 Nov 2018 09:39:06 +0000 (09:39 +0000)
committerNoel Power <npower@samba.org>
Mon, 10 Dec 2018 09:38:23 +0000 (10:38 +0100)
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 <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/__init__.py

index a3f0652750d258b612d61a96d42bd37a43ac79cc..2eaf9785a1d03f2dcf1b6e71e0a60b246d9b77d5 100644 (file)
@@ -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)