diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 86511ccf7..1a55b7ca1 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -314,12 +314,12 @@ function waitforlisten() { fi if hash ss; then - if $ns_cmd ss -lx | grep -q $rpc_addr; then + if $ns_cmd ss -lx | egrep -q "\s+$rpc_addr\s+"; then ret=0 fi else # if system doesn't have ss, just assume it has netstat - if $ns_cmd netstat -an -x | grep -iw LISTENING | grep -q $rpc_addr; then + if $ns_cmd netstat -an -x | grep -iw LISTENING | egrep -q "\s+$rpc_addr\$"; then ret=0 fi fi