[v9_10] fix statschannel with no libjson

4246.	[test]		Ensure the statschannel system test runs when BIND
			is not built with libjson. [RT #40944]

(cherry picked from commit aa9b64060f)
This commit is contained in:
Evan Hunt 2015-10-28 21:05:27 -07:00
parent 84d34a3e2f
commit ed3f67b837
5 changed files with 43 additions and 14 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. [bug] Fix statistics version to match against in bind9.xsl.
[RT #41039]

View file

@ -103,6 +103,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
@ -54,10 +62,10 @@ if [ $PERL_XML ]; then
file=`$PERL fetch.pl xml/v3/server`
mv $file xml.stats
$PERL server-xml.pl > xml.fmtstats 2> /dev/null
xml_query_count=`awk '/opcode QUERY/ { print $NF }' xml.fmtstats`
xml_query_count=`awk '/opcode QUERY/ { print $NF }' xml.fmtstats`
xml_query_count=${xml_query_count:-0}
[ "$query_count" -eq "$xml_query_count" ] || ret=1
xml_txt_count=`awk '/qtype TXT/ { print $NF }' xml.fmtstats`
xml_txt_count=`awk '/qtype TXT/ { print $NF }' xml.fmtstats`
xml_txt_count=${xml_txt_count:-0}
[ "$txt_count" -eq "$xml_txt_count" ] || ret=1
fi
@ -65,10 +73,10 @@ if [ $PERL_JSON ]; then
file=`$PERL fetch.pl json/v1/server`
mv $file json.stats
$PERL server-json.pl > json.fmtstats 2> /dev/null
json_query_count=`awk '/opcode QUERY/ { print $NF }' json.fmtstats`
json_query_count=`awk '/opcode QUERY/ { print $NF }' json.fmtstats`
json_query_count=${json_query_count:-0}
[ "$query_count" -eq "$json_query_count" ] || ret=1
json_txt_count=`awk '/qtype TXT/ { print $NF }' json.fmtstats`
json_txt_count=`awk '/qtype TXT/ { print $NF }' json.fmtstats`
json_txt_count=${json_txt_count:-0}
[ "$txt_count" -eq "$json_txt_count" ] || ret=1
fi

14
configure vendored
View file

@ -807,6 +807,8 @@ IRIX_DNSSEC_WARNINGS_HACK
MKDEPPROG
MKDEPCFLAGS
MKDEPCC
JSONSTATS
XMLSTATS
PKCS11_TEST
PKCS11_GOST
PKCS11_ECDSA
@ -16591,11 +16593,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?
#
@ -16740,8 +16744,10 @@ $as_echo "#define HAVE_JSON 1" >>confdefs.h
$as_echo "#define HAVE_JSON_C 1" >>confdefs.h
fi
JSONSTATS=1
fi
#
# In solaris 10, SMF can manage named service
#
@ -24572,8 +24578,8 @@ 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$XMLSTATS" = "X" || echo " XML statistics (--with-libxml2)"
test "X$JSONSTATS" = "X" || echo " JSON statistics (--with-libjson)"
fi
if test "$use_pkcs11" != "no"; then
@ -24663,8 +24669,8 @@ 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)"
if test "X$ac_unrecognized_opts" != "X"; then
echo

View file

@ -2143,9 +2143,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?
@ -2223,7 +2225,9 @@ then
then
AC_DEFINE(HAVE_JSON_C, 1, [Define if json-c was found])
fi
JSONSTATS=1
fi
AC_SUBST(JSONSTATS)
#
# In solaris 10, SMF can manage named service
@ -4841,8 +4845,8 @@ 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$XMLSTATS" = "X" || echo " XML statistics (--with-libxml2)"
test "X$JSONSTATS" = "X" || echo " JSON statistics (--with-libjson)"
fi
if test "$use_pkcs11" != "no"; then
@ -4932,8 +4936,8 @@ 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)"
if test "X$ac_unrecognized_opts" != "X"; then
echo