mirror of https://github.com/status-im/consul.git
test: switch envoy integration tests to use pkill instead of ps+grep+awk+kill (#10097)
This commit is contained in:
parent
066bacc80c
commit
a524593d66
|
@ -505,26 +505,11 @@ function docker_consul_exec {
|
||||||
docker_exec envoy_consul-${DC}_1 "$@"
|
docker_exec envoy_consul-${DC}_1 "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_envoy_pid {
|
|
||||||
local BOOTSTRAP_NAME=$1
|
|
||||||
local DC=${2:-primary}
|
|
||||||
run ps aux
|
|
||||||
[ "$status" == 0 ]
|
|
||||||
echo "$output" 1>&2
|
|
||||||
PID="$(echo "$output" | grep "envoy -c /workdir/$DC/envoy/${BOOTSTRAP_NAME}-bootstrap.json" | awk '{print $1}')"
|
|
||||||
[ -n "$PID" ]
|
|
||||||
|
|
||||||
echo "$PID"
|
|
||||||
}
|
|
||||||
|
|
||||||
function kill_envoy {
|
function kill_envoy {
|
||||||
local BOOTSTRAP_NAME=$1
|
local BOOTSTRAP_NAME=$1
|
||||||
local DC=${2:-primary}
|
local DC=${2:-primary}
|
||||||
|
|
||||||
PID="$(get_envoy_pid $BOOTSTRAP_NAME "$DC")"
|
pkill -TERM -f "envoy -c /workdir/$DC/envoy/${BOOTSTRAP_NAME}-bootstrap.json"
|
||||||
echo "PID = $PID"
|
|
||||||
|
|
||||||
kill -TERM $PID
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function must_match_in_statsd_logs {
|
function must_match_in_statsd_logs {
|
||||||
|
|
Loading…
Reference in New Issue