1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

python: selftest: Add possibility to run old Python test suites with Python 3

Add possibility to execute old Python test suites with Python 3
and enable tests with Python 3 of ported samba.gensec module.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Lumir Balhar 2017-01-17 11:05:44 +01:00 committed by Andrew Bartlett
parent 64bc64ce64
commit 4ebd877ec0
2 changed files with 10 additions and 4 deletions

View File

@ -46,7 +46,7 @@ else:
has_perl_test_more = False
python = os.getenv("PYTHON", "python")
extra_python = os.getenv("EXTRA_PYTHON", "python3")
extra_python = os.getenv("EXTRA_PYTHON", None)
tap2subunit = python + " " + os.path.join(srcdir(), "selftest", "tap2subunit")
@ -137,7 +137,7 @@ def planpythontestsuite(env, module, name=None, extra_path=[], py3_compatible=Fa
if pypath:
args.insert(0, "PYTHONPATH=%s" % ":".join(["$PYTHONPATH"] + pypath))
plantestsuite_loadlist(name, env, args)
if py3_compatible:
if py3_compatible and extra_python is not None:
# Plan one more test for Python 3 compatible module
args[0] = extra_python
plantestsuite_loadlist(name, env, args)

View File

@ -537,7 +537,9 @@ for env in ["ad_dc:local", "s4member:local", "nt4_dc:local", "ad_member:local",
skiptestsuite("samba.nss.test using winbind(%s)" % env, "nsstest not available")
subunitrun = valgrindify(python) + " " + os.path.join(samba4srcdir, "scripting/bin/subunitrun")
def planoldpythontestsuite(env, module, name=None, extra_path=[], environ={}, extra_args=[]):
if extra_python is not None:
subunitrun3 = valgrindify(extra_python) + " " + os.path.join(samba4srcdir, "scripting/bin/subunitrun")
def planoldpythontestsuite(env, module, name=None, extra_path=[], environ={}, extra_args=[], py3_compatible=False):
environ = dict(environ)
py_path = list(extra_path)
if py_path:
@ -548,8 +550,12 @@ def planoldpythontestsuite(env, module, name=None, extra_path=[], environ={}, ex
if name is None:
name = module
plantestsuite_loadlist(name, env, args)
if py3_compatible and extra_python is not None:
args[0] = subunitrun3
plantestsuite_loadlist(name, env, args)
planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.gensec", extra_args=['-U"$USERNAME%$PASSWORD"'])
planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.gensec", extra_args=['-U"$USERNAME%$PASSWORD"'], py3_compatible=True)
planoldpythontestsuite("none", "simple", extra_path=["%s/lib/tdb/python/tests" % srcdir()], name="tdb.python")
planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.sam")
planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dsdb")