#Overwrite the lttng_bin to get mi output
LTTNG_BIN="lttng --mi xml"
-#Global devlaration for simplification
+#Global declaration for simplification
LTTNG=$TESTDIR/../src/bin/lttng/$LTTNG_BIN
#Overwrite the default output for utils.sh command
OUTPUT_FILE="create_session.xml"
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
- create_lttng_session $session_name $OUTPUT_DIR
+ create_lttng_session_ok $session_name $OUTPUT_DIR
$XML_VALIDATE $OUTPUT_DEST
ok $? "MI test: create session xsd validation"
#try to recreate a session. Expecting it to fail
- create_lttng_session $session_name $OUTPUT_DIR true
+ create_lttng_session_fail $session_name $OUTPUT_DIR
$XML_VALIDATE $OUTPUT_DEST
ok $? "MI test: expecting fail create session xsd validation"
is_command_success $OUTPUT_DEST true
#Test build up
OUTPUT_DEST=$DEVNULL
for (( i = 0; i < 3; i++ )); do
- create_lttng_session ${session_name[$i]} $OUTPUT_DIR
+ create_lttng_session_ok ${session_name[$i]} $OUTPUT_DIR
done
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
#Test buid up
OUTPUT_DEST=$DEVNULL
for (( i = 0; i < 3; i++ )); do
- create_lttng_session ${session_name[$i]} $OUTPUT_DIR
+ create_lttng_session_ok ${session_name[$i]} $OUTPUT_DIR
done
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
#Test buil up
OUTPUT_DEST=$DEVNULL
- create_lttng_session $session_name $OUTPUT_DIR
+ create_lttng_session_ok $session_name $OUTPUT_DIR
#Test the enable_channel command
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
#Test build up
OUTPUT_DEST=$DEVNULL
- create_lttng_session $session_name $OUTPUT_DIR
+ create_lttng_session_ok $session_name $OUTPUT_DIR
enable_ust_lttng_channel $session_name $channel_name
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
$XML_VALIDATE $OUTPUT_DEST
ok $? "Mi test: Multiple enable ust event with inside fail xsd validation"
- #Check for 2 success = true et 1 false
+ #Check for 2 success = true and 1 success = false
extract_xml $OUTPUT_DEST $XPATH_ENABLE_EVENT_SUCCESS result
num_ocur=$(grep -o "true" <<< "$result" | wc -l)
test "$num_ocur" -eq "2"
#Test buid up
OUTPUT_DEST=$DEVNULL
- create_lttng_session $session_name $OUTPUT_DIR
+ create_lttng_session_ok $session_name $OUTPUT_DIR
enable_ust_lttng_channel $session_name $channel_name
#Enable ust and jul events
#Test buid up
OUTPUT_DEST=$DEVNULL
- create_lttng_session $session_name $OUTPUT_DIR
+ create_lttng_session_ok $session_name $OUTPUT_DIR
enable_ust_lttng_channel $session_name $channel_name
#Enable ust and jul events
#Test buid up
OUTPUT_DEST=$DEVNULL
- create_lttng_session $session_name $OUTPUT_DIR
+ create_lttng_session_ok $session_name $OUTPUT_DIR
enable_ust_lttng_channel $session_name $channel_name
#Enable ust and jul events
$XML_VALIDATE $OUTPUT_DEST
ok $? "Mi test: list ust event xsd validation"
- #Extract events 3 events should be present
+ #Extract events
extract_xml $OUTPUT_DEST "$XPATH_LIST_UST_EVENT""/name/text()" result
num=$(echo "$result" | wc -l)
- test "$num" -eq "3"
- ok $? "Mi test: $num / 3 ust events discovered"
- #Extract field from tp:tptest event. Expect 12
+ #Since the number of events is prone to change we only look for >= from a
+ #base number. An alternative would be to look for each events but this
+ #is complicated for nothing.
+ test "$num" -ge "5"
+ ok $? "Mi test: $num / 5 ust events discovered"
+
+ #Extract field from tp:tptest event. Expect >= to 12 because number of
+ #field is prone to change.
extract_xml $OUTPUT_DEST "$XPATH_LIST_UST_EVENT""[./name = 'tp:tptest']/event_fields/event_field/name/text()" result
num=$(echo "$result" | wc -l)
- test "$num" -eq "12"
+ test "$num" -ge "12"
ok $? "Mi test: $num / 12 ust event fields discovered"
#Wait for all background processes
#Test buid up
OUTPUT_DEST=$DEVNULL
- create_lttng_session $session_name $OUTPUT_DIR
+ create_lttng_session_ok $session_name $OUTPUT_DIR
#Test fail command
#No channel enable start command should return element success false