#Test the enable_channel command
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
- enable_ust_lttng_channel $session_name ${channel_name[0]}
+ enable_ust_lttng_channel_ok $session_name ${channel_name[0]}
$XML_VALIDATE $OUTPUT_DEST
ok $? "Mi test: enable ust channel xsd validation"
is_command_success $OUTPUT_DEST false
#Expect the command to fail
- enable_ust_lttng_channel $session_name ${channel_name[0]} true
+ enable_ust_lttng_channel_fail $session_name ${channel_name[0]}
$XML_VALIDATE $OUTPUT_DEST
ok $? "Mi test: fail enable ust channel xsd validation"
is_command_success $OUTPUT_DEST true
#Create two ust channel to test multiple disable
for (( i = 1; i < 3; i++ )); do
- enable_ust_lttng_channel $session_name ${channel_name[$i]}
+ enable_ust_lttng_channel_ok $session_name ${channel_name[$i]}
done
#Test the disable_channel command
#Test build up
OUTPUT_DEST=$DEVNULL
create_lttng_session_ok $session_name $OUTPUT_DIR
- enable_ust_lttng_channel $session_name $channel_name
+ enable_ust_lttng_channel_ok $session_name $channel_name
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
#Test the enable event for ust domain
#Test buid up
OUTPUT_DEST=$DEVNULL
create_lttng_session_ok $session_name $OUTPUT_DIR
- enable_ust_lttng_channel $session_name $channel_name
+ enable_ust_lttng_channel_ok $session_name $channel_name
#Enable ust and jul events
concat_event=$( IFS=$','; echo "${event[*]}" )
#Add a channel and make sure we have 2 channel now
OUTPUT_DEST=$DEVNULL
- enable_ust_lttng_channel $session_name $channel_name"a"
+ enable_ust_lttng_channel_ok $session_name $channel_name"a"
#Teardown
OUTPUT_DEST=$DEVNULL
#Test buid up
OUTPUT_DEST=$DEVNULL
create_lttng_session_ok $session_name $OUTPUT_DIR
- enable_ust_lttng_channel $session_name $channel_name
+ enable_ust_lttng_channel_ok $session_name $channel_name
#Enable ust and jul events
concat_event=$( IFS=$','; echo "${event[*]}" )
#Test buid up
OUTPUT_DEST=$DEVNULL
create_lttng_session_ok $session_name $OUTPUT_DIR
- enable_ust_lttng_channel $session_name $channel_name
+ enable_ust_lttng_channel_ok $session_name $channel_name
#Enable ust and jul events
concat_event=$( IFS=$','; echo "${event[*]}" )
#Enable a channel to test success
OUTPUT_DEST=$DEVNULL
- enable_ust_lttng_channel $session_name $channel_name
+ enable_ust_lttng_channel_ok $session_name $channel_name
#Start tracing
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
diag "Test basic save"
create_lttng_session_ok $SESSION_NAME $TRACE_PATH
- enable_ust_lttng_channel $SESSION_NAME $CHANNEL_NAME
+ enable_ust_lttng_channel_ok $SESSION_NAME $CHANNEL_NAME
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
lttng_save $SESSION_NAME "-o $TRACE_PATH"
create_lttng_session_ok $SESSION_NAME-2 $TRACE_PATH
create_lttng_session_ok $SESSION_NAME-3 $TRACE_PATH
- enable_ust_lttng_channel $SESSION_NAME-1 $CHANNEL_NAME
- enable_ust_lttng_channel $SESSION_NAME-2 $CHANNEL_NAME
- enable_ust_lttng_channel $SESSION_NAME-3 $CHANNEL_NAME
+ enable_ust_lttng_channel_ok $SESSION_NAME-1 $CHANNEL_NAME
+ enable_ust_lttng_channel_ok $SESSION_NAME-2 $CHANNEL_NAME
+ enable_ust_lttng_channel_ok $SESSION_NAME-3 $CHANNEL_NAME
enable_ust_lttng_event $SESSION_NAME-1 $EVENT_NAME $CHANNEL_NAME
enable_ust_lttng_event $SESSION_NAME-2 $EVENT_NAME $CHANNEL_NAME
diag "Test overwrite session file"
create_lttng_session_ok $SESSION_NAME $TRACE_PATH
- enable_ust_lttng_channel $SESSION_NAME $CHANNEL_NAME
+ enable_ust_lttng_channel_ok $SESSION_NAME $CHANNEL_NAME
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
lttng_save $SESSION_NAME "-o $TRACE_PATH"
# Create a new session with same name so we can force the overwrite
create_lttng_session_ok $SESSION_NAME $TRACE_PATH
- enable_ust_lttng_channel $SESSION_NAME $CHANNEL_NAME
+ enable_ust_lttng_channel_ok $SESSION_NAME $CHANNEL_NAME
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
# This one MUST fail
create_lttng_session_ok $SESSION_NAME $TRACE_PATH
create_lttng_session_ok $SESSION_NAME2 $TRACE_PATH
- enable_ust_lttng_channel $SESSION_NAME $CHAN_NAME
- enable_ust_lttng_channel $SESSION_NAME2 $CHAN_NAME2
+ enable_ust_lttng_channel_ok $SESSION_NAME $CHAN_NAME
+ enable_ust_lttng_channel_ok $SESSION_NAME2 $CHAN_NAME2
enable_ust_lttng_event_per_chan $SESSION_NAME $EVENT_NAME $CHAN_NAME
enable_ust_lttng_event_per_chan $SESSION_NAME $EVENT_NAME2 $CHAN_NAME
create_lttng_session_ok $SESSION_NAME $TRACE_PATH
- enable_ust_lttng_channel $SESSION_NAME $CHAN_NAME
+ enable_ust_lttng_channel_ok $SESSION_NAME $CHAN_NAME
enable_ust_lttng_event_per_chan $SESSION_NAME $EVENT_NAME $CHAN_NAME
}
-function enable_ust_lttng_channel()
+function enable_ust_lttng_channel ()
{
- local sess_name=$1
- local channel_name=$2
- local expect_fail=$3
+ local expect_fail=$1
+ local sess_name=$2
+ local channel_name=$3
$TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -u $channel_name -s $sess_name >$OUTPUT_DEST
ret=$?
- if [[ $expect_fail ]]; then
+ if [[ $expect_fail -eq "1" ]]; then
test "$ret" -ne "0"
ok $? "Expected fail on ust channel creation $channel_name in $sess_name"
else
fi
}
+function enable_ust_lttng_channel_ok ()
+{
+ enable_ust_lttng_channel 0 "$@"
+}
+
+function enable_ust_lttng_channel_fail ()
+{
+ enable_ust_lttng_channel 1 "$@"
+}
+
function disable_ust_lttng_channel()
{
local sess_name=$1