Refactor: test: wrapper for enable_ust_lttng_event
[lttng-tools.git] / tests / utils / utils.sh
index f44a7376f2a46ae0212a36c3f690447597db1808..a8e0e4a0721926a9b183487b634d4b6812dae1c0 100644 (file)
@@ -448,10 +448,10 @@ function enable_lttng_mmap_overwrite_ust_channel()
 
 function enable_ust_lttng_event ()
 {
-       local sess_name=$1
-       local event_name="$2"
-       local channel_name=$3
-       local expected_to_fail=$4
+       local expected_to_fail=$1
+       local sess_name=$2
+       local event_name="$3"
+       local channel_name=$4
 
        if [ -z $channel_name ]; then
                # default channel if none specified
@@ -462,7 +462,7 @@ function enable_ust_lttng_event ()
 
        $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -u >$OUTPUT_DEST
        ret=$?
-       if [[ $expected_to_fail ]]; then
+       if [[ $expected_to_fail -eq "1" ]]; then
                test $ret -ne "0"
                ok $? "Enable ust event $event_name for session $session_name on channel $channel_name failed as expected"
        else
@@ -470,6 +470,16 @@ function enable_ust_lttng_event ()
        fi
 }
 
+function enable_ust_lttng_event_ok ()
+{
+       enable_ust_lttng_event 0 "$@"
+}
+
+function enable_ust_lttng_event_fail ()
+{
+       enable_ust_lttng_event 1 "$@"
+}
+
 function enable_jul_lttng_event()
 {
        sess_name=$1
This page took 0.0233 seconds and 4 git commands to generate.