lib:util: Add test for talloc_keep_secret()
[nivanova/samba-autobuild/.git] / selftest / tests.py
index 3de981f7e1324656c000411195cbd71025ca0d68..133f227ab82dd8d5e29352eecb9e4444fd46d680 100644 (file)
@@ -47,9 +47,9 @@ with_pam = ("WITH_PAM" in config_hash)
 pam_wrapper_so_path = config_hash["LIBPAM_WRAPPER_SO_PATH"]
 pam_set_items_so_path = config_hash["PAM_SET_ITEMS_SO_PATH"]
 
-planpythontestsuite("none", "samba.tests.source", py3_compatible=True)
+planpythontestsuite("none", "samba.tests.source")
 if have_man_pages_support:
-    planpythontestsuite("none", "samba.tests.docs", py3_compatible=True)
+    planpythontestsuite("none", "samba.tests.docs")
 
 try:
     import testscenarios
@@ -57,112 +57,160 @@ except ImportError:
     skiptestsuite("subunit", "testscenarios not available")
 else:
     planpythontestsuite("none", "subunit.tests.test_suite")
-planpythontestsuite("none", "samba.tests.blackbox.ndrdump", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.blackbox.check_output", py3_compatible=True)
+planpythontestsuite("none", "samba.tests.blackbox.ndrdump")
+planpythontestsuite("none", "samba.tests.blackbox.check_output")
 planpythontestsuite("none", "api", name="ldb.python", extra_path=['lib/ldb/tests/python'])
-planpythontestsuite("none", "samba.tests.credentials", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.registry", py3_compatible=True)
-planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.get_opt", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.security", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.dcerpc.misc", py3_compatible=True)
+planpythontestsuite("none", "samba.tests.credentials")
+planpythontestsuite("none", "samba.tests.registry")
+planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth")
+planpythontestsuite("none", "samba.tests.get_opt")
+planpythontestsuite("none", "samba.tests.security")
+planpythontestsuite("none", "samba.tests.dcerpc.misc")
 planpythontestsuite("none", "samba.tests.dcerpc.integer")
-planpythontestsuite("none", "samba.tests.param", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.upgrade", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.core", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.common", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.provision", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.password_quality", py3_compatible=True)
+planpythontestsuite("none", "samba.tests.param")
+planpythontestsuite("none", "samba.tests.upgrade")
+planpythontestsuite("none", "samba.tests.core")
+planpythontestsuite("none", "samba.tests.common")
+planpythontestsuite("none", "samba.tests.provision")
+planpythontestsuite("none", "samba.tests.password_quality")
 planpythontestsuite("none", "samba.tests.strings")
 planpythontestsuite("none", "samba.tests.netcmd")
-planpythontestsuite("none", "samba.tests.dcerpc.rpc_talloc", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.dcerpc.array", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.dcerpc.string", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.hostconfig", py3_compatible=True)
-planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.messaging",
-                    py3_compatible=True)
-planpythontestsuite("none", "samba.tests.s3param", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.s3passdb", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.s3registry", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.s3windb", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.s3idmapdb", py3_compatible=True)
+planpythontestsuite("none", "samba.tests.dcerpc.rpc_talloc")
+planpythontestsuite("none", "samba.tests.dcerpc.array")
+planpythontestsuite("none", "samba.tests.dcerpc.string_tests")
+planpythontestsuite("none", "samba.tests.hostconfig")
+planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.messaging")
+planpythontestsuite("none", "samba.tests.s3param")
+planpythontestsuite("none", "samba.tests.s3passdb")
+planpythontestsuite("none", "samba.tests.s3registry")
+planpythontestsuite("none", "samba.tests.s3windb")
+planpythontestsuite("none", "samba.tests.s3idmapdb")
 planpythontestsuite("none", "samba.tests.samba3sam")
 planpythontestsuite(
     "none", "wafsamba.tests.test_suite",
     extra_path=[os.path.join(samba4srcdir, "..", "buildtools"),
                 os.path.join(samba4srcdir, "..", "third_party", "waf")])
+
+
+def cmdline(script, *args):
+    """
+    Prefix PYTHON env var and append --configurefile option to abs script path.
+
+    script.sh arg1 arg2
+    -->
+    PYTHON=python /path/to/bbdir/script.sh arg1 arg2 \
+    --configurefile $SMB_CONF_FILE
+    """
+    return [
+        "PYTHON=%s" % python,
+        os.path.join(bbdir, script),
+    ] + list(args) + [configuration]
+
+
 plantestsuite(
     "samba4.blackbox.demote-saveddb", "none",
-    ["PYTHON=%s" % python, os.path.join(bbdir, "demote-saveddb.sh"),
-     '$PREFIX_ABS/demote', configuration])
+    cmdline('demote-saveddb.sh', '$PREFIX_ABS/demote'))
+
 plantestsuite(
     "samba4.blackbox.dbcheck.alpha13", "none",
-    ["PYTHON=%s" % python, os.path.join(bbdir, "dbcheck-oldrelease.sh"),
-     '$PREFIX_ABS/provision', 'alpha13', configuration])
+    cmdline('dbcheck-oldrelease.sh', '$PREFIX_ABS/provision',
+            'alpha13'))
+
+# same test as above but skip member link checks
+plantestsuite(
+    "samba4.blackbox.dbcheck.alpha13.quick", "none",
+    cmdline('dbcheck-oldrelease.sh', '$PREFIX_ABS/provision',
+            'alpha13', '--quick-membership-checks'))
+
 plantestsuite(
     "samba4.blackbox.dbcheck.release-4-0-0", "none",
-    ["PYTHON=%s" % python, os.path.join(bbdir, "dbcheck-oldrelease.sh"),
-     '$PREFIX_ABS/provision', 'release-4-0-0', configuration])
+    cmdline('dbcheck-oldrelease.sh', '$PREFIX_ABS/provision',
+            'release-4-0-0'))
+
+# same test as above but skip member link checks
+plantestsuite(
+    "samba4.blackbox.dbcheck.release-4-0-0.quick", "none",
+    cmdline('dbcheck-oldrelease.sh', '$PREFIX_ABS/provision',
+            'release-4-0-0', '--quick-membership-checks'))
+
 plantestsuite(
     "samba4.blackbox.dbcheck.release-4-1-0rc3", "none",
-    ["PYTHON=%s" % python, os.path.join(bbdir, "dbcheck-oldrelease.sh"),
-     '$PREFIX_ABS/provision', 'release-4-1-0rc3', configuration])
+    cmdline('dbcheck-oldrelease.sh', '$PREFIX_ABS/provision',
+            'release-4-1-0rc3'))
+
+# same test as above but skip member link checks
+plantestsuite(
+    "samba4.blackbox.dbcheck.release-4-1-0rc3.quick", "none",
+    cmdline('dbcheck-oldrelease.sh', '$PREFIX_ABS/provision',
+            'release-4-1-0rc3', '--quick-membership-checks'))
+
 plantestsuite(
     "samba4.blackbox.dbcheck.release-4-1-6-partial-object", "none",
-    ["PYTHON=%s" % python, os.path.join(bbdir, "dbcheck-oldrelease.sh"),
-     '$PREFIX_ABS/provision', 'release-4-1-6-partial-object', configuration])
+    cmdline('dbcheck-oldrelease.sh', '$PREFIX_ABS/provision',
+            'release-4-1-6-partial-object'))
+
+# same test as above but skip member link checks
+plantestsuite(
+    "samba4.blackbox.dbcheck.release-4-1-6-partial-object.quick", "none",
+    cmdline('dbcheck-oldrelease.sh', '$PREFIX_ABS/provision',
+            'release-4-1-6-partial-object', '--quick-membership-checks'))
+
 plantestsuite(
     "samba4.blackbox.dbcheck.release-4-5-0-pre1", "none",
-    ["PYTHON=%s" % python,
-     os.path.join(bbdir, "dbcheck-oldrelease.sh"),
-     '$PREFIX_ABS/provision', 'release-4-5-0-pre1', configuration])
+    cmdline('dbcheck-oldrelease.sh', '$PREFIX_ABS/provision',
+            'release-4-5-0-pre1'))
+
+# same test as above but skip member link checks
+plantestsuite(
+    "samba4.blackbox.dbcheck.release-4-5-0-pre1.quick", "none",
+    cmdline('dbcheck-oldrelease.sh', '$PREFIX_ABS/provision',
+            'release-4-5-0-pre1', '--quick-membership-checks'))
+
 plantestsuite(
     "samba4.blackbox.upgradeprovision.alpha13", "none",
-    ["PYTHON=%s" % python,
-     os.path.join(bbdir, "upgradeprovision-oldrelease.sh"),
-     '$PREFIX_ABS/provision', 'alpha13', configuration])
+    cmdline('upgradeprovision-oldrelease.sh', '$PREFIX_ABS/provision',
+            'alpha13'))
+
 plantestsuite(
     "samba4.blackbox.upgradeprovision.release-4-0-0", "none",
-    ["PYTHON=%s" % python,
-     os.path.join(bbdir, "upgradeprovision-oldrelease.sh"),
-     '$PREFIX_ABS/provision', 'release-4-0-0', configuration])
+    cmdline('upgradeprovision-oldrelease.sh', '$PREFIX_ABS/provision',
+            'release-4-0-0'))
+
 plantestsuite(
     "samba4.blackbox.tombstones-expunge.release-4-5-0-pre1", "none",
-    ["PYTHON=%s" % python,
-     os.path.join(bbdir, "tombstones-expunge.sh"),
-     '$PREFIX_ABS/provision', 'release-4-5-0-pre1', configuration])
+    cmdline('tombstones-expunge.sh', '$PREFIX_ABS/provision',
+            'release-4-5-0-pre1'))
+
 plantestsuite(
     "samba4.blackbox.dbcheck-links.release-4-5-0-pre1", "none",
-    ["PYTHON=%s" % python,
-     os.path.join(bbdir, "dbcheck-links.sh"),
-     '$PREFIX_ABS/provision', 'release-4-5-0-pre1', configuration])
+    cmdline('dbcheck-links.sh', '$PREFIX_ABS/provision',
+            'release-4-5-0-pre1'))
+
 plantestsuite(
     "samba4.blackbox.runtime-links.release-4-5-0-pre1", "none",
-    ["PYTHON=%s" % python,
-     os.path.join(bbdir, "runtime-links.sh"),
-     '$PREFIX_ABS/provision', 'release-4-5-0-pre1', configuration])
+    cmdline('runtime-links.sh', '$PREFIX_ABS/provision',
+            'release-4-5-0-pre1'))
+
 plantestsuite(
     "samba4.blackbox.schemaupgrade", "none",
-    ["PYTHON=%s" % python,
-     os.path.join(bbdir, "schemaupgrade.sh"),
-     '$PREFIX_ABS/provision', configuration])
+    cmdline('schemaupgrade.sh', '$PREFIX_ABS/provision'))
+
 plantestsuite(
     "samba4.blackbox.functionalprep", "none",
-    ["PYTHON=%s" % python,
-     os.path.join(bbdir, "functionalprep.sh"),
-     '$PREFIX_ABS/provision', configuration])
-planpythontestsuite("none", "samba.tests.upgradeprovision", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.xattr", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.ntacls", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.policy", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.kcc.graph", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.kcc.graph_utils", py3_compatible=True)
+    cmdline('functionalprep.sh', '$PREFIX_ABS/provision'))
+
+planpythontestsuite("none", "samba.tests.upgradeprovision")
+planpythontestsuite("none", "samba.tests.xattr")
+planpythontestsuite("none", "samba.tests.ntacls")
+planpythontestsuite("none", "samba.tests.policy")
+planpythontestsuite("none", "samba.tests.kcc.graph")
+planpythontestsuite("none", "samba.tests.kcc.graph_utils")
 planpythontestsuite("none", "samba.tests.kcc.ldif_import_export")
-planpythontestsuite("none", "samba.tests.graph", py3_compatible=True)
+planpythontestsuite("none", "samba.tests.graph")
 plantestsuite("wafsamba.duplicate_symbols", "none", [os.path.join(srcdir(), "buildtools/wafsamba/test_duplicate_symbol.sh")])
-planpythontestsuite("none", "samba.tests.glue", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.tdb_util", py3_compatible=True)
-planpythontestsuite("none", "samba.tests.samdb_api", py3_compatible=True)
+planpythontestsuite("none", "samba.tests.glue")
+planpythontestsuite("none", "samba.tests.tdb_util")
+planpythontestsuite("none", "samba.tests.samdb_api")
 
 if with_pam:
     plantestsuite("samba.tests.pam_winbind(local)", "ad_member",
@@ -198,6 +246,9 @@ plantestsuite("samba.unittests.lib_util_modules", "none",
 plantestsuite("samba.unittests.smb1cli_session", "none",
               [os.path.join(bindir(), "default/libcli/smb/test_smb1cli_session")])
 
+plantestsuite("samba.unittests.talloc_keep_secret", "none",
+              [os.path.join(bindir(), "default/lib/util/test_talloc_keep_secret")])
+
 plantestsuite("samba.unittests.tldap", "none",
               [os.path.join(bindir(), "default/source3/test_tldap")])
 plantestsuite("samba.unittests.rfc1738", "none",
@@ -208,3 +259,7 @@ plantestsuite("samba.unittests.ms_fnmatch", "none",
               [os.path.join(bindir(), "default/lib/util/test_ms_fnmatch")])
 plantestsuite("samba.unittests.ntlm_check", "none",
               [os.path.join(bindir(), "default/libcli/auth/test_ntlm_check")])
+plantestsuite("samba.unittests.test_registry_regfio", "none",
+              [os.path.join(bindir(), "default/source3/test_registry_regfio")])
+plantestsuite("samba.unittests.test_oLschema2ldif", "none",
+              [os.path.join(bindir(), "default/source4/utils/oLschema2ldif/test_oLschema2ldif")])