2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

[master] fix statschannel with no libjson

4246.	[test]		Ensure the statschannel system test runs when BIND
			is not built with libjson. [RT #40944]
This commit is contained in:
Evan Hunt
2015-10-28 20:19:31 -07:00
parent eadee66609
commit aa9b64060f
6 changed files with 72 additions and 25 deletions

View File

@@ -1,3 +1,6 @@
4246. [test] Ensure the statschannel system test runs when BIND
is not built with libjson. [RT #40944]
4245. [placeholder]
4244. [bug] The parser was not reporting that use-ixfr is obsolete.

View File

@@ -101,6 +101,14 @@ else
TESTSOCK6=false
fi
#
# Determine if we support various optional features.
#
CHECK_DSA=@CHECK_DSA@
XMLSTATS=@XMLSTATS@
JSONSTATS=@JSONSTATS@
ZLIB=@ZLIB@
. ${TOP}/version
export NAMED LWRESD DIG NSUPDATE KEYGEN KEYFRLAB SIGNER KEYSIGNER KEYSETTOOL \

View File

@@ -19,7 +19,11 @@ SYSTEMTESTTOP=..
DIGCMD="$DIG @10.53.0.2 -p 5300"
if $PERL -e 'use JSON;' 2>/dev/null
if [ ! "$JSONSTATS" ]
then
unset PERL_JSON
echo "I:JSON was not configured; skipping" >&2
elif $PERL -e 'use JSON;' 2>/dev/null
then
PERL_JSON=1
else
@@ -27,7 +31,11 @@ else
echo "I:JSON tests require JSON library; skipping" >&2
fi
if $PERL -e 'use XML::Simple;' 2>/dev/null
if [ ! "$XMLSTATS" ]
then
unset PERL_XML
echo "I:XML was not configured; skipping" >&2
elif $PERL -e 'use XML::Simple;' 2>/dev/null
then
PERL_XML=1
else
@@ -165,13 +173,18 @@ if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
ret=0
echo "I:checking consistency between regular and compressed output ($n)"
$CURL -D regular.headers \
http://10.53.0.2:8853/xml/v3/server 2>/dev/null | \
if [ "$XMLSTATS" ];
then
URL=http://10.53.0.2:8853/xml/v3/server
else
URL=http://10.53.0.2:8853/json/v1/server
fi
$CURL -D regular.headers $URL 2>/dev/null | \
sed -e "s#<current-time>.*</current-time>##g" > regular.out
$CURL -D compressed.headers --compressed \
http://10.53.0.2:8853/xml/v3/server 2>/dev/null | \
$CURL -D compressed.headers --compressed $URL 2>/dev/null | \
sed -e "s#<current-time>.*</current-time>##g" > compressed.out
diff regular.out compressed.out >/dev/null || ret=1
if [ $ret != 0 ]; then echo "I: failed"; fi
@@ -180,6 +193,8 @@ n=`expr $n + 1`
ret=0
echo "I:checking if compressed output is really compressed ($n)"
if [ "$ZLIB" ];
then
REGSIZE=`cat regular.headers | \
grep -i Content-Length | sed -e "s/.*: \([0-9]*\).*/\1/"`
COMPSIZE=`cat compressed.headers | \
@@ -187,7 +202,9 @@ COMPSIZE=`cat compressed.headers | \
if [ ! `expr $REGSIZE / $COMPSIZE` -gt 2 ]; then
ret=1
fi
else
echo "I:skipped"
fi
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`

21
configure vendored
View File

@@ -814,6 +814,9 @@ IRIX_DNSSEC_WARNINGS_HACK
MKDEPPROG
MKDEPCFLAGS
MKDEPCC
ZLIB
JSONSTATS
XMLSTATS
PKCS11_TEST
PKCS11_GOST
PKCS11_ECDSA
@@ -16547,11 +16550,13 @@ rm -f core conftest.err conftest.$ac_objext \
$as_echo "#define HAVE_LIBXML2 1" >>confdefs.h
XMLSTATS=1
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
#
# was --with-libjson specified?
#
@@ -16696,8 +16701,10 @@ $as_echo "#define HAVE_JSON 1" >>confdefs.h
$as_echo "#define HAVE_JSON_C 1" >>confdefs.h
fi
JSONSTATS=1
fi
#
# was --with-zlib specified?
#
@@ -16814,15 +16821,18 @@ else
$as_echo "no" >&6; }
fi
ZLIB=
if test "X${have_zlib}" != "X"
then
CFLAGS="$CFLAGS $zlib_cflags"
$as_echo "#define HAVE_ZLIB 1" >>confdefs.h
ZLIB=1
fi
#
# In solaris 10, SMF can manage named service
#
@@ -24915,9 +24925,9 @@ if test "$enable_full_report" = "yes"; then
test "X$CRYPTO" = "X" -o "$want_native_pkcs11" = "yes" || \
echo " OpenSSL cryptography/DNSSEC (--with-openssl)"
test "X$PYTHON" = "X" || echo " Python tools (--with-python)"
test "X$libxml2_libs" = "X" || echo " XML statistics (--with-libxml2)"
test "X$have_libjson" = "X" || echo " JSON statistics (--with-libjson)"
test "X$have_zlib" = "X" || echo " HTTP zlib compression (--with-zlib)"
test "X$XMLSTATS" = "X" || echo " XML statistics (--with-libxml2)"
test "X$JSONSTATS" = "X" || echo " JSON statistics (--with-libjson)"
test "X$ZLIB" = "X" || echo " HTTP zlib compression (--with-zlib)"
fi
if test "$use_pkcs11" != "no"; then
@@ -25006,8 +25016,9 @@ test "$use_libtool" = "yes" || echo " Use GNU libtool (--with-libtool)"
test "$atf" = "no" && echo " Automated Testing Framework (--with-atf)"
test "X$PYTHON" = "X" && echo " Python tools (--with-python)"
test "X$libxml2_libs" = "X" && echo " XML statistics (--with-libxml2)"
test "X$have_libjson" = "X" && echo " JSON statistics (--with-libjson)"
test "X$XMLSTATS" = "X" && echo " XML statistics (--with-libxml2)"
test "X$JSONSTATS" = "X" && echo " JSON statistics (--with-libjson)"
test "X$ZLIB" = "X" && echo " HTTP zlib compression (--with-zlib)"
if test "X$ac_unrecognized_opts" != "X"; then
echo

View File

@@ -2097,9 +2097,11 @@ then
AC_MSG_RESULT(yes),
AC_MSG_ERROR(xml2-config returns badness))
AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
XMLSTATS=1
else
AC_MSG_RESULT(no)
fi
AC_SUBST(XMLSTATS)
#
# was --with-libjson specified?
@@ -2177,7 +2179,9 @@ then
then
AC_DEFINE(HAVE_JSON_C, 1, [Define if json-c was found])
fi
JSONSTATS=1
fi
AC_SUBST(JSONSTATS)
#
# was --with-zlib specified?
@@ -2231,11 +2235,14 @@ else
AC_MSG_RESULT(no)
fi
ZLIB=
if test "X${have_zlib}" != "X"
then
CFLAGS="$CFLAGS $zlib_cflags"
AC_DEFINE(HAVE_ZLIB, 1, [Define if zlib was found])
ZLIB=1
fi
AC_SUBST(ZLIB)
#
@@ -4913,9 +4920,9 @@ if test "$enable_full_report" = "yes"; then
test "X$CRYPTO" = "X" -o "$want_native_pkcs11" = "yes" || \
echo " OpenSSL cryptography/DNSSEC (--with-openssl)"
test "X$PYTHON" = "X" || echo " Python tools (--with-python)"
test "X$libxml2_libs" = "X" || echo " XML statistics (--with-libxml2)"
test "X$have_libjson" = "X" || echo " JSON statistics (--with-libjson)"
test "X$have_zlib" = "X" || echo " HTTP zlib compression (--with-zlib)"
test "X$XMLSTATS" = "X" || echo " XML statistics (--with-libxml2)"
test "X$JSONSTATS" = "X" || echo " JSON statistics (--with-libjson)"
test "X$ZLIB" = "X" || echo " HTTP zlib compression (--with-zlib)"
fi
if test "$use_pkcs11" != "no"; then
@@ -5004,8 +5011,9 @@ test "$use_libtool" = "yes" || echo " Use GNU libtool (--with-libtool)"
test "$atf" = "no" && echo " Automated Testing Framework (--with-atf)"
test "X$PYTHON" = "X" && echo " Python tools (--with-python)"
test "X$libxml2_libs" = "X" && echo " XML statistics (--with-libxml2)"
test "X$have_libjson" = "X" && echo " JSON statistics (--with-libjson)"
test "X$XMLSTATS" = "X" && echo " XML statistics (--with-libxml2)"
test "X$JSONSTATS" = "X" && echo " JSON statistics (--with-libjson)"
test "X$ZLIB" = "X" && echo " HTTP zlib compression (--with-zlib)"
if test "X$ac_unrecognized_opts" != "X"; then
echo

View File

@@ -2056,7 +2056,7 @@
./bin/tests/system/statschannel/prereq.sh SH 2015
./bin/tests/system/statschannel/server-json.pl PERL 2015
./bin/tests/system/statschannel/server-xml.pl PERL 2015
./bin/tests/system/statschannel/tests.sh SH 2015
./bin/tests/system/statschannel/tests.sh.in SH 2015
./bin/tests/system/statschannel/traffic-json.pl PERL 2015
./bin/tests/system/statschannel/traffic-xml.pl PERL 2015
./bin/tests/system/statschannel/traffic.expect.1 X 2015