From 3333f9c94d5d5bb66cdc9c8fed8b877f4a4c3b70 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 4 Sep 2024 12:52:22 +1000 Subject: [PATCH] Properly detect when libxml2 or json-c is not available (cherry picked from commit 7de939609b72aef11bdba98e8cf68098c0ec53a1) --- bin/tests/system/statschannel/tests.sh | 32 +++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/tests/system/statschannel/tests.sh b/bin/tests/system/statschannel/tests.sh index dad9f34dd5..cb5fb2303f 100644 --- a/bin/tests/system/statschannel/tests.sh +++ b/bin/tests/system/statschannel/tests.sh @@ -150,7 +150,7 @@ $RNDCCMD 10.53.0.2 stats 2>&1 | sed 's/^/I:ns1 /' query_count=$(awk '/QUERY/ {print $1}' ns2/named.stats) txt_count=$(awk '/TXT/ {print $1}' ns2/named.stats) noerror_count=$(awk '/NOERROR/ {print $1}' ns2/named.stats) -if [ $PERL_XML ]; then +if [ "$PERL_XML" ]; then file=$($PERL fetch.pl -p ${EXTRAPORT1} xml/v3/server) mv $file xml.stats $PERL server-xml.pl >xml.fmtstats 2>/dev/null @@ -164,7 +164,7 @@ if [ $PERL_XML ]; then xml_noerror_count=${xml_noerror_count:-0} [ "$noerror_count" -eq "$xml_noerror_count" ] || ret=1 fi -if [ $PERL_JSON ]; then +if [ "$PERL_JSON" ]; then file=$($PERL fetch.pl -p ${EXTRAPORT1} json/v1/server) mv $file json.stats $PERL server-json.pl >json.fmtstats 2>/dev/null @@ -184,7 +184,7 @@ n=$((n + 1)) ret=0 echo_i "checking malloced memory statistics xml/json ($n)" -if [ $PERL_XML ]; then +if [ "$PERL_XML" ]; then file=$($PERL fetch.pl -p ${EXTRAPORT1} xml/v3/mem) mv $file xml.mem $PERL mem-xml.pl $file >xml.fmtmem @@ -192,7 +192,7 @@ if [ $PERL_XML ]; then grep "'malloced' => '[0-9][0-9]*'" xml.fmtmem >/dev/null || ret=1 grep "'maxmalloced' => '[0-9][0-9]*'" xml.fmtmem >/dev/null || ret=1 fi -if [ $PERL_JSON ]; then +if [ "$PERL_JSON" ]; then file=$($PERL fetch.pl -p ${EXTRAPORT1} json/v1/mem) mv $file json.mem grep '"malloced":[0-9][0-9]*,' json.mem >/dev/null || ret=1 @@ -270,11 +270,11 @@ cat zones.expect | sort >zones.expect.$n rm -f zones.expect # Fetch and check the dnssec sign statistics. echo_i "fetching zone '$zone' stats data after zone maintenance at startup ($n)" -if [ $PERL_XML ]; then +if [ "$PERL_XML" ]; then getzones xml $zone x$n || ret=1 cmp zones.out.x$n zones.expect.$n || ret=1 fi -if [ $PERL_JSON ]; then +if [ "$PERL_JSON" ]; then getzones json 0 j$n || ret=1 cmp zones.out.j$n zones.expect.$n || ret=1 fi @@ -300,11 +300,11 @@ cat zones.expect | sort >zones.expect.$n rm -f zones.expect # Fetch and check the dnssec sign statistics. echo_i "fetching zone '$zone' stats data after dynamic update ($n)" -if [ $PERL_XML ]; then +if [ "$PERL_XML" ]; then getzones xml $zone x$n || ret=1 cmp zones.out.x$n zones.expect.$n || ret=1 fi -if [ $PERL_JSON ]; then +if [ "$PERL_JSON" ]; then getzones json 0 j$n || ret=1 cmp zones.out.j$n zones.expect.$n || ret=1 fi @@ -327,11 +327,11 @@ echo "${sign_prefix} ${ksk_id}: 2" >>zones.expect cat zones.expect | sort >zones.expect.$n rm -f zones.expect # Fetch and check the dnssec sign statistics. -if [ $PERL_XML ]; then +if [ "$PERL_XML" ]; then getzones xml $zone x$n || ret=1 cmp zones.out.x$n zones.expect.$n || ret=1 fi -if [ $PERL_JSON ]; then +if [ "$PERL_JSON" ]; then getzones json 0 j$n || ret=1 cmp zones.out.j$n zones.expect.$n || ret=1 fi @@ -368,11 +368,11 @@ cat zones.expect | sort >zones.expect.$n rm -f zones.expect # Fetch and check the dnssec sign statistics. echo_i "fetching zone '$zone' stats data after zone maintenance at startup ($n)" -if [ $PERL_XML ]; then +if [ "$PERL_XML" ]; then getzones xml $zone x$n || ret=1 cmp zones.out.x$n zones.expect.$n || ret=1 fi -if [ $PERL_JSON ]; then +if [ "$PERL_JSON" ]; then getzones json 2 j$n || ret=1 cmp zones.out.j$n zones.expect.$n || ret=1 fi @@ -406,11 +406,11 @@ cat zones.expect | sort >zones.expect.$n rm -f zones.expect # Fetch and check the dnssec sign statistics. echo_i "fetching zone '$zone' stats data after dynamic update ($n)" -if [ $PERL_XML ]; then +if [ "$PERL_XML" ]; then getzones xml $zone x$n || ret=1 cmp zones.out.x$n zones.expect.$n || ret=1 fi -if [ $PERL_JSON ]; then +if [ "$PERL_JSON" ]; then getzones json 2 j$n || ret=1 cmp zones.out.j$n zones.expect.$n || ret=1 fi @@ -435,11 +435,11 @@ cat zones.expect | sort >zones.expect.$n rm -f zones.expect # Fetch and check the dnssec sign statistics. echo_i "fetching zone '$zone' stats data after dnssec-policy change ($n)" -if [ $PERL_XML ]; then +if [ "$PERL_XML" ]; then getzones xml $zone x$n || ret=1 cmp zones.out.x$n zones.expect.$n || ret=1 fi -if [ $PERL_JSON ]; then +if [ "$PERL_JSON" ]; then getzones json 2 j$n || ret=1 cmp zones.out.j$n zones.expect.$n || ret=1 fi