Refactor: test: wrapper for lttng_snapshot_add_output
[lttng-tools.git] / tests / utils / utils.sh
index 454627eaae3ad6115b598f3067d1f81410899631..90589271b5cd19ac977acc933245c55fd03e766b 100644 (file)
@@ -744,13 +744,13 @@ function destroy_lttng_sessions ()
 
 function lttng_snapshot_add_output ()
 {
-       local sess_name=$1
-       local trace_path=$2
-       local expected_to_fail=$3
+       local expected_to_fail=$1
+       local sess_name=$2
+       local trace_path=$3
 
        $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot add-output -s $sess_name file://$trace_path >$OUTPUT_DEST
        ret=$?
-       if [[ $expected_to_fail ]]; then
+       if [[ $expected_to_fail -eq 1 ]]; then
                test "$ret" -ne "0"
                ok $? "Failed to add a  snapshot output file://$trace_path as expected"
        else
@@ -758,6 +758,16 @@ function lttng_snapshot_add_output ()
        fi
 }
 
+function lttng_snapshot_add_output_ok ()
+{
+       lttng_snapshot_add_output 0 "$@"
+}
+
+function lttng_snapshot_add_output_fail ()
+{
+       lttng_snapshot_add_output 1 "$@"
+}
+
 function lttng_snapshot_del_output ()
 {
        local sess_name=$1
This page took 0.026191 seconds and 5 git commands to generate.