X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=tests%2Futils%2Futils.sh;h=afd8a74edc7ca322a0ec8906ca39a1179b6e9df3;hb=6f2597123e2ec03a3cfbf3c4e7e82b86b453d782;hp=1a8056d020b44240cdc7f9a79802090cabf897dd;hpb=31580dc77773c3319db9d28c22913c91b3325561;p=lttng-tools.git diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 1a8056d02..afd8a74ed 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -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