python/samba/tests: Ensure samba_dnsupdate called with correct python version
authorNoel Power <noel.power@suse.com>
Tue, 30 Oct 2018 13:22:11 +0000 (13:22 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 14 Nov 2018 04:07:17 +0000 (05:07 +0100)
We need to examine the contents of PYTHON env variable which should defined the
python version to be used when running tests.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/__init__.py

index 66067fcf8b9b0d87bb7e65e7679e7b2c106e5072..d79fcfbb997466bb0b7f4cb0854e3b6b61fd98d7 100644 (file)
@@ -384,8 +384,9 @@ class BlackboxTestCase(TestCaseInTempDir):
         cmd = parts[0]
         exe = os.path.join(BINDIR, cmd)
         if os.path.exists(exe):
+            python_cmds = ["samba-tool", "samba_dnsupdate"]
             parts[0] = exe
-            if cmd =='samba-tool' and os.getenv("PYTHON", None):
+            if cmd in python_cmds and os.getenv("PYTHON", None):
                 parts.insert(0, os.environ["PYTHON"])
 
         if not isinstance(line, list):