X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Flttng%2Frun-ust-global-tests.sh;fp=tests%2Flttng%2Frun-ust-global-tests.sh;h=bfcb974bf22c67566dd6d6ed7d1e712f39e167ba;hp=0000000000000000000000000000000000000000;hb=69c0b621c0c998a393da0e7fa093201d8de01e88;hpb=9beed4cb465347c778e4f982c330cef78f2628b7 diff --git a/tests/lttng/run-ust-global-tests.sh b/tests/lttng/run-ust-global-tests.sh new file mode 100755 index 000000000..bfcb974bf --- /dev/null +++ b/tests/lttng/run-ust-global-tests.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +SESSIOND_BIN="lttng-sessiond" + +tmpdir=`mktemp -d` +tests=( ust_global_event_basic ust_global_all_events_basic ) +exit_code=0 + +function start_tests () +{ + for bin in ${tests[@]}; + do + ./$bin $tmpdir + # Test must return 0 to pass. + if [ $? -ne 0 ]; then + exit_code=1 + break + fi + # Cleaning up + rm -rf $tmpdir + done +} + +echo -e "\n-------------------------------------------" +echo -e "UST tracer - GLOBAL DOMAIN (LTTNG_DOMAIN_UST)" +echo -e "---------------------------------------------" + +if [ -z $(pidof $SESSIOND_BIN) ]; then + echo -n "Starting session daemon... " + ../lttng-sessiond/$SESSIOND_BIN --daemonize --quiet + if [ $? -eq 1 ]; then + echo -e '\e[1;31mFAILED\e[0m' + rm -rf $tmpdir + exit 1 + else + echo -e "\e[1;32mOK\e[0m" + fi +fi + +PID_SESSIOND=`pidof lt-$SESSIOND_BIN` + +# Simply wait for the session daemon bootstrap +sleep 1 + +start_tests + +echo -e -n "\nKilling session daemon... " +kill $PID_SESSIOND >/dev/null 2>&1 +if [ $? -eq 1 ]; then + echo -e '\e[1;31mFAILED\e[0m' +else + echo -e "\e[1;32mOK\e[0m" +fi + +exit $exit_code