X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Futils.sh;h=e83001ee517815174d19aedac404c1bebcfbdc22;hb=dcb543b0c69e80f58cfc7d26f1a07f7eae978090;hp=01e8eae21b3886c0bd532f0e438610e94e74c8cf;hpb=fd4dfcecf4a21f7797d350e8dcd291c6f0c64e86;p=lttng-tools.git diff --git a/tests/utils.sh b/tests/utils.sh index 01e8eae21..e83001ee5 100644 --- a/tests/utils.sh +++ b/tests/utils.sh @@ -41,15 +41,16 @@ function validate_kernel_version () function start_sessiond () { + echo "" + echo -n "Starting session daemon... " validate_kernel_version if [ $? -ne 0 ]; then - echo -e "\n*** Kernel to old for session daemon tests ***\n" + echo -e "\n*** Kernel too old for session daemon tests ***\n" return 2 fi - if [ -z $(pidof $SESSIOND_BIN) ]; then - echo -n "Starting session daemon... " - $TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --daemonize --quiet + if [ -z $(pidof lt-$SESSIOND_BIN) ]; then + $TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --daemonize --quiet --consumerd32-path="$(pwd)/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$(pwd)/../src/bin/lttng-consumerd/lttng-consumerd" if [ $? -eq 1 ]; then echo -e "\e[1;31mFAILED\e[0m" return 1 @@ -71,6 +72,11 @@ function stop_sessiond () echo -e "\e[1;31mFAILED\e[0m" return 1 else + out=1 + while [ -n "$out" ]; do + out=$(pidof lt-$SESSIOND_BIN) + sleep 0.5 + done echo -e "\e[1;32mOK\e[0m" fi } @@ -154,6 +160,12 @@ function trace_matches () nr_iter=$2 trace_path=$3 + which $BABELTRACE_BIN >/dev/null + if [ $? -eq 1 ]; then + echo "Babeltrace binary not found. Skipping trace matches" + return 0 + fi + echo -n "Looking for $nr_iter $event_name in $trace_path " count=$($BABELTRACE_BIN $trace_path | grep $event_name | wc -l)