From 79e6ab31d8cd26aafdccfc8e6c836e3e59fd97ac Mon Sep 17 00:00:00 2001 From: Yossi Gottlieb Date: Sun, 18 Oct 2020 14:50:29 +0300 Subject: [PATCH] Fix tests failure on busybox systems. (#7916) (cherry picked from commit ef92f507dd0c402a916c16435e7f3f92598b7242) --- tests/support/server.tcl | 2 +- tests/support/util.tcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/support/server.tcl b/tests/support/server.tcl index 30d0d4045..ae93ad007 100644 --- a/tests/support/server.tcl +++ b/tests/support/server.tcl @@ -94,7 +94,7 @@ proc kill_server config { proc is_alive config { set pid [dict get $config pid] - if {[catch {exec ps -p $pid} err]} { + if {[catch {exec kill -0 $pid} err]} { return 0 } else { return 1 diff --git a/tests/support/util.tcl b/tests/support/util.tcl index b9a65358f..51125377e 100644 --- a/tests/support/util.tcl +++ b/tests/support/util.tcl @@ -508,7 +508,7 @@ proc populate {num prefix size} { proc get_child_pid {idx} { set pid [srv $idx pid] - if {[string match {*Darwin*} [exec uname -a]]} { + if {[file exists "/usr/bin/pgrep"]} { set fd [open "|pgrep -P $pid" "r"] set child_pid [string trim [lindex [split [read $fd] \n] 0]] } else {