Test: mi for clear command
[lttng-tools.git] / tests / utils / utils.sh
index f2393b9cf69ea1370b65b1815b74c805e3a099ee..5a929020ed6d23e90c4f0cea0f4b9d03e00b62fc 100644 (file)
@@ -646,9 +646,9 @@ function stop_lttng_consumerd_opt()
        if [ $withtap -eq "1" ]; then
                diag "Killing $CONSUMERD_BIN pids: $(echo $PID_CONSUMERD | tr '\n' ' ')"
        fi
+
        kill $kill_opt $PID_CONSUMERD 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
        retval=$?
-       set +x
 
        if [ $? -eq 1 ]; then
                if [ $withtap -eq "1" ]; then
@@ -703,7 +703,6 @@ function sigstop_lttng_consumerd_opt()
        fi
        kill $kill_opt $PID_CONSUMERD 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
        retval=$?
-       set +x
 
        if [ $? -eq 1 ]; then
                if [ $withtap -eq "1" ]; then
@@ -1286,7 +1285,6 @@ function lttng_snapshot_del_output_fail ()
 function lttng_snapshot_record ()
 {
        local sess_name=$1
-       local trace_path=$2
 
        $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot record -s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
        ok $? "Snapshot recorded"
@@ -1770,3 +1768,34 @@ function lttng_enable_rotation_size_fail ()
 {
        lttng_enable_rotation_size 1 $@
 }
+
+function lttng_clear_session ()
+{
+       local expected_to_fail=$1
+       local sess_name=$2
+
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN clear $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+       ret=$?
+       if [[ $expected_to_fail -eq "1" ]]; then
+               test "$ret" -ne "0"
+               ok $? "Expected fail on clear session $sess_name"
+       else
+               ok $ret "Clear session $sess_name"
+       fi
+}
+
+function lttng_clear_session_ok ()
+{
+       lttng_clear_session 0 $@
+}
+
+function lttng_clear_session_fail ()
+{
+       lttng_clear_session 1 $@
+}
+
+function lttng_clear_all ()
+{
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN clear --all 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+       ok $? "Clear all lttng sessions"
+}
This page took 0.02527 seconds and 5 git commands to generate.