Refactor: test: wrapper for enable_ust_lttng_channel
[lttng-tools.git] / tests / utils / utils.sh
index 12dabc52ccd87a9bbd17372511186198fdcd0790..f44a7376f2a46ae0212a36c3f690447597db1808 100644 (file)
@@ -393,15 +393,15 @@ function create_lttng_session_fail ()
 }
 
 
-function enable_ust_lttng_channel()
+function enable_ust_lttng_channel ()
 {
-       local sess_name=$1
-       local channel_name=$2
-       local expect_fail=$3
+       local expect_fail=$1
+       local sess_name=$2
+       local channel_name=$3
 
        $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -u $channel_name -s $sess_name >$OUTPUT_DEST
        ret=$?
-       if [[ $expect_fail ]]; then
+       if [[ $expect_fail -eq "1" ]]; then
                test "$ret" -ne "0"
                ok $? "Expected fail on ust channel creation $channel_name in $sess_name"
        else
@@ -409,6 +409,16 @@ function enable_ust_lttng_channel()
        fi
 }
 
+function enable_ust_lttng_channel_ok ()
+{
+       enable_ust_lttng_channel 0 "$@"
+}
+
+function enable_ust_lttng_channel_fail ()
+{
+       enable_ust_lttng_channel 1 "$@"
+}
+
 function disable_ust_lttng_channel()
 {
        local sess_name=$1
This page took 0.023655 seconds and 4 git commands to generate.