X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Futils%2Futils.sh;h=88304eb80083629b9e26a729ff046ae8855abda4;hp=1595f1d16816f0fd3568b9bbfafc5b9e015376a1;hb=1fb2388876f2db46d5c253b9c00cda0990a5f762;hpb=b2064f542c84041bf0b991d7d83f9e85db8adc19 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 }