From c11fdae2319afb21727ca02599f67c7b93f02061 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 29 Jan 2014 10:47:37 -0500 Subject: [PATCH] tests: Add stop_lttng_relayd_nocheck Used in cases where the relay daemon might not be running. Signed-off-by: Mathieu Desnoyers --- tests/utils/utils.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 1595f1d16..88304eb80 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -121,22 +121,33 @@ function start_lttng_relayd fi } -function stop_lttng_relayd +function stop_lttng_relayd_nocheck { PID_RELAYD=`pidof lt-$RELAYD_BIN` + diag "Killing lttng-relayd (pid: $PID_RELAYD)" kill $PID_RELAYD >/dev/null 2>&1 + retval=$? - if [ $? -eq 1 ]; then - fail "Kill lttng-relayd (pid: $PID_RELAYD)" - return 1 - else + if [ $retval -eq 1 ]; then out=1 while [ -n "$out" ]; do out=$(pidof lt-$RELAYD_BIN) sleep 0.5 done - pass "Kill lttng-relayd (pid: $PID_RELAYD)" + fi + return $retval +} + +function stop_lttng_relayd +{ + stop_lttng_relayd_nocheck + + if [ $? -eq 1 ]; then + fail "Killed lttng-relayd (pid: $PID_RELAYD)" + return 1 + else + pass "Killed lttng-relayd (pid: $PID_RELAYD)" return 0 fi } -- 2.34.1