Fix: TimeoutExpired in Python tests not defined globally
[lttng-tools.git] / tests / utils / utils.sh
index 1a8056d020b44240cdc7f9a79802090cabf897dd..afd8a74edc7ca322a0ec8906ca39a1179b6e9df3 100644 (file)
@@ -138,12 +138,12 @@ function lttng_enable_kernel_syscall()
 
 function lttng_enable_kernel_syscall_ok()
 {
-       lttng_enable_kernel_syscall 0 ${*}
+       lttng_enable_kernel_syscall 0 "$@"
 }
 
 function lttng_enable_kernel_syscall_fail()
 {
-       lttng_enable_kernel_syscall 1 ${*}
+       lttng_enable_kernel_syscall 1 "$@"
 }
 
 function lttng_disable_kernel_syscall()
@@ -178,12 +178,12 @@ function lttng_disable_kernel_syscall()
 
 function lttng_disable_kernel_syscall_ok()
 {
-       lttng_disable_kernel_syscall 0 ${*}
+       lttng_disable_kernel_syscall 0 "$@"
 }
 
 function lttng_disable_kernel_syscall_fail()
 {
-       lttng_disable_kernel_syscall 1 ${*}
+       lttng_disable_kernel_syscall 1 "$@"
 }
 
 function lttng_enable_kernel_channel()
@@ -204,12 +204,12 @@ function lttng_enable_kernel_channel()
 
 function lttng_enable_kernel_channel_ok()
 {
-       lttng_enable_kernel_channel 0 ${*}
+       lttng_enable_kernel_channel 0 "$@"
 }
 
 function lttng_enable_kernel_channel_fail()
 {
-       lttng_enable_kernel_channel 1 ${*}
+       lttng_enable_kernel_channel 1 "$@"
 }
 
 function lttng_disable_kernel_channel()
@@ -230,12 +230,12 @@ function lttng_disable_kernel_channel()
 
 function lttng_disable_kernel_channel_ok()
 {
-       lttng_disable_kernel_channel 0 ${*}
+       lttng_disable_kernel_channel 0 "$@"
 }
 
 function lttng_disable_kernel_channel_fail()
 {
-       lttng_disable_kernel_channel 1 ${*}
+       lttng_disable_kernel_channel 1 "$@"
 }
 
 function start_lttng_relayd
@@ -827,6 +827,54 @@ function lttng_load()
        ok $? "Load command successful"
 }
 
+function lttng_track()
+{
+       local expected_to_fail=$1
+       local opts=$2
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN track $opts >$OUTPUT_DEST
+       ret=$?
+       if [[ $expected_to_fail -eq "1" ]]; then
+               test $ret -ne "0"
+               ok $? "Track command failed as expected with opts: $opts"
+       else
+               ok $ret "Track command success as expected with opts: $opts"
+       fi
+}
+
+function lttng_track_ok()
+{
+       lttng_track 0 "$@"
+}
+
+function lttng_track_fail()
+{
+       lttng_track 1 "$@"
+}
+
+function lttng_untrack()
+{
+       local expected_to_fail=$1
+       local opts=$2
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN untrack $opts >$OUTPUT_DEST
+       ret=$?
+       if [[ $expected_to_fail -eq "1" ]]; then
+               test $ret -ne "0"
+               ok $? "Untrack command failed as expected with opts: $opts"
+       else
+               ok $ret "Untrack command success as expected with opts: $opts"
+       fi
+}
+
+function lttng_untrack_ok()
+{
+       lttng_untrack 0 "$@"
+}
+
+function lttng_untrack_fail()
+{
+       lttng_untrack 1 "$@"
+}
+
 function trace_matches ()
 {
        local event_name=$1
This page took 0.025844 seconds and 5 git commands to generate.