diff --git a/bin/tests/system/statschannel/tests.sh b/bin/tests/system/statschannel/tests.sh index 314eb0ab19..c535e85de2 100644 --- a/bin/tests/system/statschannel/tests.sh +++ b/bin/tests/system/statschannel/tests.sh @@ -734,19 +734,19 @@ _wait_for_transfers() { if [ $count != 1 ]; then return 1; fi fi - if [ "$PERL_JSON" ]; then + if [ "$PERL_JSON" ] && [ -x "$JQ" ]; then getxfrins json j$n || return 1 # We expect 4 transfers - count=$(grep -c -E '"state":"(Zone Transfer Request|First Data|Receiving AXFR Data)"' xfrins.json.j$n) + count=$("$JQ" '.views._default.xfrins | length' /dev/null || ret=1 + test $("${JQ}" ".nsstats.${synthesized}" <$json) -eq $count || ret=1 else - grep '"'$synthesized'":' $json >/dev/null && ret=1 + "${JQ}" -e '.nsstats | has("'"${synthesized}"'")' <$json >/dev/null && ret=1 fi n=$((n + 1)) if [ $ret != 0 ]; then echo_i "failed"; fi