selftest: Add function for checking whether a module is enabled
authorChristof Schmitt <cs@samba.org>
Wed, 19 Aug 2020 18:54:43 +0000 (11:54 -0700)
committerChristof Schmitt <cs@samba.org>
Tue, 8 Sep 2020 21:35:41 +0000 (21:35 +0000)
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/selftest/tests.py

index 556b50c38f5532df008c25992defe297a874f392..b2217fbea2b4b470e1361a11116ecd8c35fd9261 100755 (executable)
@@ -70,6 +70,12 @@ have_inotify = ("HAVE_INOTIFY" in config_hash)
 have_ldwrap = ("HAVE_LDWRAP" in config_hash)
 with_pthreadpool = ("WITH_PTHREADPOOL" in config_hash)
 
+def is_module_enabled(module):
+    if module in config_hash["STRING_SHARED_MODULES"]:
+        return True
+    if module in config_hash["STRING_STATIC_MODULES"]:
+        return True
+    return False
 
 plantestsuite("samba3.blackbox.success", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_success.sh")])
 plantestsuite("samba3.blackbox.failure", "nt4_dc:local", [os.path.join(samba3srcdir, "script/tests/test_failure.sh")])