diff --git a/bin/tests/system/statschannel/tests.sh b/bin/tests/system/statschannel/tests.sh index afe941e2da..b13e33022f 100644 --- a/bin/tests/system/statschannel/tests.sh +++ b/bin/tests/system/statschannel/tests.sh @@ -714,10 +714,10 @@ n=$((n + 1)) _wait_for_transfers() { getxfrins xml x$n || return 1 getxfrins json j$n || return 1 - # XML is encoded in one line, use sed to separate each transfer - count=$(sed 's/\(Zone Transfer Request\|First Data\|Receiving AXFR Data\)') + # XML is encoded in one line, use awk to separate each transfer with a newline + count=$(awk '{ gsub("(Zone Transfer Request|First Data|Receiving AXFR Data)') if [ $count != 3 ]; then return 1; fi - count=$(grep -c '"state":"\(Zone Transfer Request\|First Data\|Receiving AXFR Data\)"' xfrins.json.j$n) + count=$(grep -c -E '"state":"(Zone Transfer Request|First Data|Receiving AXFR Data)"' xfrins.json.j$n) if [ $count != 3 ]; then return 1; fi }