Refactor: test: wrapper for stop_lttng_tracing
[lttng-tools.git] / tests / utils / utils.sh
index f9df77bb0ec69050a5608c447e19ef03b44b041f..067a4f53224b71a93c536331466564ce78950484 100644 (file)
@@ -686,12 +686,12 @@ function start_lttng_tracing_fail ()
 
 function stop_lttng_tracing ()
 {
-       local sess_name=$1
-       local expected_to_fail=$2
+       local expected_to_fail=$1
+       local sess_name=$2
 
        $TESTDIR/../src/bin/lttng/$LTTNG_BIN stop $sess_name >$OUTPUT_DEST
        ret=$?
-       if [[ $expected_to_fail ]]; then
+       if [[ $expected_to_fail -eq "1" ]]; then
                test "$ret" -ne "0"
                ok $? "Expected fail on stop tracing for session: $sess_name"
        else
@@ -699,6 +699,16 @@ function stop_lttng_tracing ()
        fi
 }
 
+function stop_lttng_tracing_ok ()
+{
+       stop_lttng_tracing 0 "$@"
+}
+
+function stop_lttng_tracing_fail ()
+{
+       stop_lttng_tracing 1 "$@"
+}
+
 function destroy_lttng_session ()
 {
        local sess_name=$1
@@ -706,7 +716,7 @@ function destroy_lttng_session ()
 
        $TESTDIR/../src/bin/lttng/$LTTNG_BIN destroy $sess_name >$OUTPUT_DEST
        ret=$?
-       if [[ $expected_to_fail ]]; then
+       if [[ $expected_to_fail -eq "1" ]]; then
                test "$ret" -ne "0"
                ok $? "Expected fail on session deletion $sess_name"
        else
This page took 0.024578 seconds and 5 git commands to generate.