From: Günther Deschner Date: Tue, 18 Mar 2025 13:41:08 +0000 (+0100) Subject: s3-selftest: only run prometheus exporter tests when configured X-Git-Tag: tevent-0.17.0~334 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5231a159db6af9caf1e0b2d88a3fc3e9676cee05;p=thirdparty%2Fsamba.git s3-selftest: only run prometheus exporter tests when configured Extract the configure info for building with prometheus exporter and only run the blackbox test in case it is enabled. Guenther Signed-off-by: Guenther Deschner Reviewed-by: Ralph Boehme --- diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 98d7084048f..bf7e699c912 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -951,15 +951,18 @@ plantestsuite("samba3.blackbox.smbclient_old_dir", "fileserver_smb1", "script/tests/test_old_dirlisting.sh"), timelimit, smbclient3]) +with_prometheus_exporter = ("WITH_PROMETHEUS_EXPORTER" in config_hash) + for env in ["fileserver:local"]: plantestsuite("samba3.blackbox.net_usershare", env, [os.path.join(samba3srcdir, "script/tests/test_net_usershare.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient3]) plantestsuite("samba3.blackbox.smbstatus", env, [os.path.join(samba3srcdir, "script/tests/test_smbstatus.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', smbclient3, smbstatus, configuration, "SMB3"]) plantestsuite("samba3.blackbox.net_registry_import", env, [os.path.join(samba3srcdir, "script/tests/test_net_registry_import.sh"), '$SERVER', '$LOCAL_PATH', '$USERNAME', '$PASSWORD']) - plantestsuite("samba3.blackbox.smb_prometheus_endpoint", env, - [os.path.join(samba3srcdir, "script/tests/test_smb_prometheus_endpoint.sh"), - '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCK_DIR', '$PREFIX', - smb_prometheus_endpoint, smbclient3, configuration, "SMB3"]) + if with_prometheus_exporter: + plantestsuite("samba3.blackbox.smb_prometheus_endpoint", env, + [os.path.join(samba3srcdir, "script/tests/test_smb_prometheus_endpoint.sh"), + '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$LOCK_DIR', '$PREFIX', + smb_prometheus_endpoint, smbclient3, configuration, "SMB3"]) env = 'ad_member' plantestsuite("samba3.blackbox.smbget", diff --git a/source3/wscript b/source3/wscript index c0a9c65f724..b64eb9e30c6 100644 --- a/source3/wscript +++ b/source3/wscript @@ -211,6 +211,7 @@ long ret = splice(0,0,1,0,400,SPLICE_F_MOVE); Logs.info("Checking for libevent existence") if conf.CHECK_HEADERS('event2/http.h') and conf.CHECK_LIB('event', shlib=True): conf.CHECK_FUNCS_IN('evhttp_new', 'event') + conf.DEFINE('WITH_PROMETHEUS_EXPORTER', 1) if not conf.CONFIG_SET('HAVE_EVHTTP_NEW'): conf.fatal("libevent support not found. " "Try installing libevent-dev or libevent-devel. "