X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Futils%2Futils.sh;h=e2cd7f881630b3013cb7e40e3990f1f18f64ee24;hp=2647769f27106087ecf4f72e0c92d7590b652fa5;hb=d96f6315f068984c2edda2ac612bacbdb2c7b0d2;hpb=8cfcd41c7fac2e14d8f8527238d928bd4ec732fb diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 2647769f2..e2cd7f881 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -181,6 +181,58 @@ function lttng_disable_kernel_syscall_fail() lttng_disable_kernel_syscall 1 ${*} } +function lttng_enable_kernel_channel() +{ + local expected_to_fail=$1 + local sess_name=$2 + local channel_name=$3 + + $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -k $channel_name -s $sess_name >$OUTPUT_DEST + ret=$? + if [[ $expected_to_fail -eq "1" ]]; then + test "$ret" -ne "0" + ok $? "Expected failure on kernel channel creation $channel_name in $sess_name" + else + ok $ret "Enable channel $channel_name for session $sess_name" + fi +} + +function lttng_enable_kernel_channel_ok() +{ + lttng_enable_kernel_channel 0 ${*} +} + +function lttng_enable_kernel_channel_fail() +{ + lttng_enable_kernel_channel 1 ${*} +} + +function lttng_disable_kernel_channel() +{ + local expected_to_fail=$1 + local sess_name=$2 + local channel_name=$3 + + $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-channel -k $channel_name -s $sess_name >$OUTPUT_DEST + ret=$? + if [[ $expected_to_fail -eq "1" ]]; then + test "$ret" -ne "0" + ok $? "Expected failure on kernel channel creation $channel_name in $sess_name" + else + ok $ret "disable channel $channel_name for session $sess_name" + fi +} + +function lttng_disable_kernel_channel_ok() +{ + lttng_disable_kernel_channel 0 ${*} +} + +function lttng_disable_kernel_channel_fail() +{ + lttng_disable_kernel_channel 1 ${*} +} + function start_lttng_relayd { local opt=$1