Add channel command in utils.sh of tests
authorDavid Goulet <dgoulet@efficios.com>
Thu, 5 Apr 2012 19:49:32 +0000 (15:49 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 5 Apr 2012 19:50:20 +0000 (15:50 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
tests/utils.sh

index f0a2e25dd7fde160e603f57f8b16b65c1fae6428..8a0640bd0e2f391f61654a530180005c83dc7c01 100644 (file)
@@ -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
 }
 
This page took 0.025835 seconds and 4 git commands to generate.