From: Mathieu Desnoyers Date: Wed, 29 Jan 2014 15:47:37 +0000 (-0500) Subject: tests: Add stop_lttng_relayd_nocheck X-Git-Tag: v2.5.0-rc1~231 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1fb2388876f2db46d5c253b9c00cda0990a5f762;p=lttng-tools.git tests: Add stop_lttng_relayd_nocheck Used in cases where the relay daemon might not be running. Signed-off-by: Mathieu Desnoyers --- 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 }