X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Futils%2Futils.sh;h=afd8a74edc7ca322a0ec8906ca39a1179b6e9df3;hp=4282fbb6983dfc6a42b412d8a636d9c6861a6204;hb=e83a8bdbfb6a9542f40d62ead334f249baf05255;hpb=71f82f2bac178c2adb30f58577a8c4609895180a diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 4282fbb69..afd8a74ed 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -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