From d4018451a4eb6c042b5ab5bb20c6ef0f812dc887 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 5 Apr 2012 15:49:32 -0400 Subject: [PATCH] Add channel command in utils.sh of tests Signed-off-by: David Goulet --- tests/utils.sh | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) 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 } -- 2.34.1