From: David Goulet Date: Thu, 5 Apr 2012 19:49:32 +0000 (-0400) Subject: Add channel command in utils.sh of tests X-Git-Tag: v2.1.0-rc1~161 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d4018451a4eb6c042b5ab5bb20c6ef0f812dc887;p=lttng-tools.git Add channel command in utils.sh of tests Signed-off-by: David Goulet --- diff --git a/tests/utils.sh b/tests/utils.sh index f0a2e25dd..8a0640bd0 100644 --- a/tests/utils.sh +++ b/tests/utils.sh @@ -112,14 +112,43 @@ function create_lttng_session () sess_name=$1 trace_path=$2 - echo -n "Creating lttng session $SESSION_NAME in $TRACE_PATH " + echo -n "Creating lttng session $sess_name in $trace_path" $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $sess_name -o $trace_path >/dev/null 2>&1 if [ $? -eq 1 ]; then echo -e "\e[1;31mFAILED\e[0m" return 1 else echo -e "\e[1;32mOK\e[0m" - #echo $out | grep "written in" | cut -d' ' -f6 + fi +} + +function enable_lttng_channel() +{ + sess_name=$1 + channel_name=$2 + + echo -n "Enabling lttng channel $channel_name for session $sess_name" + $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel $channel_name -s $sess_name >/dev/null 2>&1 + if [ $? -eq 1 ]; then + echo -e "\e[1;31mFAILED\e[0m" + return 1 + else + echo -e "\e[1;32mOK\e[0m" + fi +} + +function disable_lttng_channel() +{ + sess_name=$1 + channel_name=$2 + + echo -n "Disabling lttng channel $channel_name for session $sess_name" + $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-channel $channel_name -s $sess_name >/dev/null 2>&1 + if [ $? -eq 1 ]; then + echo -e "\e[1;31mFAILED\e[0m" + return 1 + else + echo -e "\e[1;32mOK\e[0m" fi }