From: Evan Hunt Date: Tue, 21 Jul 2015 02:01:29 +0000 (-0700) Subject: [master] portability X-Git-Tag: v9.11.0a1~643 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=9501aa9d5ac5686045848601557295b9819df56c;p=thirdparty%2Fbind9.git [master] portability --- diff --git a/bin/tests/system/statschannel/tests.sh b/bin/tests/system/statschannel/tests.sh index 001996c042d..0581ae3ec0f 100644 --- a/bin/tests/system/statschannel/tests.sh +++ b/bin/tests/system/statschannel/tests.sh @@ -35,7 +35,7 @@ else echo "I:XML tests require XML::Simple; skipping" >&2 fi -if [ ! $PERL_JSON -a ! $PERL_XML ]; then +if [ ! "$PERL_JSON" -a ! "$PERL_XML" ]; then echo "I:skipping all tests" exit 0 fi @@ -144,8 +144,10 @@ if [ $PERL_XML ]; then 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=${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=${xml_txt_count:-0} [ "$txt_count" -eq "$xml_txt_count" ] || ret=1 fi if [ $PERL_JSON ]; then @@ -153,8 +155,10 @@ if [ $PERL_JSON ]; then mv $file json.stats $PERL server-xml.pl > json.fmtstats 2> /dev/null 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=${json_txt_count:-0} [ "$txt_count" -eq "$json_txt_count" ] || ret=1 fi if [ $ret != 0 ]; then echo "I: failed"; fi