From: Noel Power Date: Fri, 7 Dec 2018 18:52:17 +0000 (+0000) Subject: selftest: Convert samba4.ldap.sort.python to planoldpythontest X-Git-Tag: tdb-1.3.17~326 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d20f06986ee8f176106446c8ae32f0900ea4e4cf;p=thirdparty%2Fsamba.git selftest: Convert samba4.ldap.sort.python to planoldpythontest Currently the test only runs fully under python2. As an interim measure while we figure out how to get this to work property under python3 I have converted the test to planoldpythontest so it also can run under python2 Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/tests/python/sort.py b/source4/dsdb/tests/python/sort.py index 0b87442af39..f9c7ecd37bb 100644 --- a/source4/dsdb/tests/python/sort.py +++ b/source4/dsdb/tests/python/sort.py @@ -43,7 +43,10 @@ if len(args) < 1: parser.print_usage() sys.exit(1) -host = args[0] +host = os.getenv("SERVER", None) +if not host: + print("Please specify the host with env variable SERVER") + sys.exit(1) lp = sambaopts.get_loadparm() creds = credopts.get_credentials(lp) @@ -387,6 +390,3 @@ if "://" not in host: host = "tdb://%s" % host else: host = "ldap://%s" % host - - -TestProgram(module=__name__, opts=subunitopts) diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index e8ff47c5ef4..5be30673ccc 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -869,7 +869,8 @@ plantestsuite_loadlist("samba4.ldap.match_rules.python", "ad_dc_ntvfs", [python, plantestsuite_loadlist("samba4.ldap.notification.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/notification.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT']) plantestsuite_loadlist("samba4.ldap.sites.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sites.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT']) -plantestsuite_loadlist("samba4.ldap.sort.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/sort.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT']) +planoldpythontestsuite("ad_dc_ntvfs", "sort", environ={'SERVER' : '$SERVER'}, name="samba4.ldap.sort.python", extra_path=[os.path.join(samba4srcdir, 'dsdb/tests/python')], extra_args=['-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN'], py3_compatible=True) + plantestsuite_loadlist("samba4.ldap.vlv.python(ad_dc_ntvfs)", "ad_dc_ntvfs", [python, os.path.join(samba4srcdir, "dsdb/tests/python/vlv.py"), '$SERVER', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT']) plantestsuite_loadlist("samba4.ldap.linked_attributes.python(ad_dc_ntvfs)", "ad_dc_ntvfs:local", [python, os.path.join(samba4srcdir, "dsdb/tests/python/linked_attributes.py"), '$PREFIX_ABS/ad_dc_ntvfs/private/sam.ldb', '-U"$USERNAME%$PASSWORD"', '--workgroup=$DOMAIN', '$LOADLIST', '$LISTOPT'])