tests: Add stop_lttng_relayd_nocheck
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 29 Jan 2014 15:47:37 +0000 (10:47 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 29 Jan 2014 16:32:56 +0000 (11:32 -0500)
Used in cases where the relay daemon might not be running.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/utils/utils.sh

index 1595f1d16816f0fd3568b9bbfafc5b9e015376a1..88304eb80083629b9e26a729ff046ae8855abda4 100644 (file)
@@ -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
 }
This page took 0.026228 seconds and 4 git commands to generate.