tests: fix exec fails when grep exists with status other than 0 (#9066)

Co-authored-by: lizhaolong.lzl <lizhaolong.lzl@B-54MPMD6R-0221.local>
This commit is contained in:
ZhaolongLi
2021-07-25 14:58:21 +08:00
committed by GitHub
parent 9ca5e8c547
commit 8d00493485

View File

@@ -1,7 +1,11 @@
set testmodule [file normalize tests/modules/fork.so]
proc count_log_message {pattern} {
set result [exec grep -c $pattern < [srv 0 stdout]]
set status [catch {exec grep -c $pattern < [srv 0 stdout]} result]
if {$status == 1} {
set result 0
}
return $result
}
start_server {tags {"modules"}} {