From: Andrew Bartlett Date: Sun, 11 Feb 2018 22:03:25 +0000 (+1300) Subject: selftest: Require jansson support for selftest of the AD DC X-Git-Tag: tevent-0.9.36~92 X-Git-Url: http://git.samba.org/samba.git/?p=nivanova%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=8e54bc463adcfbc322249ba626e2c503ca13a864 selftest: Require jansson support for selftest of the AD DC This avoids this code becoming untested if a package is not installed or the configure test is accidentially broken. Signed-off-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- diff --git a/auth/wscript_configure b/auth/wscript_configure index 47943fa1e9c..9d930bab61c 100644 --- a/auth/wscript_configure +++ b/auth/wscript_configure @@ -1,7 +1,16 @@ #!/usr/bin/env python +import Options, Utils + conf.SET_TARGET_TYPE('jansson', 'EMPTY') if conf.CHECK_CFG(package='jansson', args='--cflags --libs', msg='Checking for jansson'): conf.CHECK_FUNCS_IN('json_object', 'jansson') + +if not conf.CONFIG_GET('HAVE_JSON_OBJECT') and \ + conf.CONFIG_GET('ENABLE_SELFTEST') and \ + (not Options.options.without_ad_dc): + raise Utils.WafError('jansson JSON library required for ' + '--enable-selftest ' + 'when building the AD DC') diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index 49d1bbbd072..2ccc1d95cc2 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -68,7 +68,6 @@ finally: have_tls_support = ("ENABLE_GNUTLS" in config_hash) have_heimdal_support = ("SAMBA4_USES_HEIMDAL" in config_hash) -have_jansson_support = ("HAVE_JANSSON" in config_hash) if have_tls_support: for options in ['-U"$USERNAME%$PASSWORD"']: @@ -622,7 +621,7 @@ planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.registry", extra planoldpythontestsuite("ad_dc_ntvfs", "samba.tests.dcerpc.dnsserver", extra_args=['-U"$USERNAME%$PASSWORD"']) planoldpythontestsuite("ad_dc", "samba.tests.dcerpc.dnsserver", extra_args=['-U"$USERNAME%$PASSWORD"']) planoldpythontestsuite("ad_dc", "samba.tests.dcerpc.raw_protocol", extra_args=['-U"$USERNAME%$PASSWORD"']) -if have_jansson_support and have_heimdal_support: +if have_heimdal_support: planoldpythontestsuite("ad_dc:local", "samba.tests.auth_log", extra_args=['-U"$USERNAME%$PASSWORD"'], environ={'CLIENT_IP': '127.0.0.11', 'SOCKET_WRAPPER_DEFAULT_IFACE': 11})