selftest: Require jansson support for selftest of the AD DC
authorAndrew Bartlett <abartlet@samba.org>
Sun, 11 Feb 2018 22:03:25 +0000 (11:03 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 14 Feb 2018 23:18:29 +0000 (00:18 +0100)
This avoids this code becoming untested if a package is not installed or
the configure test is accidentially broken.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
auth/wscript_configure
source4/selftest/tests.py

index 47943fa1e9ca219b02b081111c73dee5bed56969..9d930bab61c057042ffaff1a0881b96c41fd009c 100644 (file)
@@ -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')
index 49d1bbbd072b9b7d495293d68236aafe704cb8fa..2ccc1d95cc2854c1d9bd8a2156ad659c0b4634cb 100755 (executable)
@@ -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})