CURDIR=$(dirname $0)/
TESTDIR=$CURDIR/../../../
-XSD_PATH=$TESTDIR/../src/common/mi-lttng-4.0.xsd
#Test app for ust event
TESTAPP_PATH="$TESTDIR/utils/testapp"
SESSIOND_LOAD_DIR=$(mktemp --tmpdir -d tmp.test_mi_sessiond_load_dir.XXXXXX)
OUTPUT_FILE="default.xml"
-#Path to custom xml utilities
-XML_UTILS_PATH="$TESTDIR/utils/xml-utils"
-XML_VALIDATE="$XML_UTILS_PATH/validate_xml $XSD_PATH"
-XML_EXTRACT="$XML_UTILS_PATH/extract_xml"
-XML_NODE_CHECK="$XML_UTILS_PATH/extract_xml -e"
-
XPATH_CMD_OUTPUT="//lttng:command/lttng:output"
XPATH_COMMAND_SUCCESS="/lttng:command/lttng:success/text()"
XPATH_SESSION="$XPATH_CMD_OUTPUT/lttng:sessions/lttng:session"
OUTPUT_FILE="version.xml"
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
mi_print_version $OUTPUT_DEST
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "MI test: Version xsd validation"
}
OUTPUT_FILE="create_session.xml"
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
create_lttng_session_ok $session_name $OUTPUT_DIR
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "MI test: create session xsd validation"
#try to recreate a session. Expecting it to fail
create_lttng_session_fail $session_name $OUTPUT_DIR
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "MI test: expecting fail create session xsd validation"
is_command_success $OUTPUT_DEST true
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
destroy_lttng_session_ok ${session_name[0]}
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "MI test: destroy session ${session_name[0]} xsd validation"
#Verify that we destroyed the good session
#Destroy all and count:should be 2
destroy_lttng_sessions
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "MI test: destroy all session xsd validation"
#Verify that we destroyed 2 sessions
#Verify that if no session is present command fail and mi report it.
destroy_lttng_session_fail ${session_name[0]}
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "MI test: failing destroy session ${session_name[0]} xsd validation"
extract_xml $OUTPUT_DEST $XPATH_COMMAND_SUCCESS result
test "$result" = "false"
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
list_lttng_with_opts
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: list sessions xsd validation"
#We should have 3 session
OUTPUT_DEST=${output_basedir}/$OUTPUT_FILE
list_lttng_with_opts
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: list session with long path xsd validation"
#Teardown
#Test the enable_channel command
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
enable_ust_lttng_channel_ok $session_name ${channel_name[0]}
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_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_fail $session_name ${channel_name[0]}
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: fail enable ust channel xsd validation"
is_command_success $OUTPUT_DEST true
#Test the disable_channel command
disable_ust_lttng_channel $session_name ${channel_name[0]}
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: disable ust channel xsd validation"
is_command_success $OUTPUT_DEST false
#Check that we delete the good channel
#Test multiple disable_channel;
disable_ust_lttng_channel $session_name ${channel_name[1]},${channel_name[2]}
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: multiple disable ust channel xsd validation"
is_command_success $OUTPUT_DEST false
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
#Test the enable event for ust domain
enable_ust_lttng_event_ok $session_name ${event[0]} $channel_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: Enable_event for ust domain xsd validation"
is_command_success $OUTPUT_DEST false
#Try to reenable an enabled event. Should fail
enable_ust_lttng_event_fail $session_name ${event[0]} $channel_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: Fail enable_event for ust domain xsd validation"
is_command_success $OUTPUT_DEST true
concat_event=$( IFS=$','; echo "${event[*]}" )
enable_ust_lttng_event_fail $session_name $concat_event $channel_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: Multiple enable ust event with inside fail xsd validation"
#Check for 2 success = true and 1 success = false
#Disable the event
disable_ust_lttng_event $session_name ${event[0]} $channel_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: Disable ust event xsd validation"
is_command_success $OUTPUT_DEST false
#Disable the 3 event combined. Should pass
disable_ust_lttng_event $session_name $concat_event $channel_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: Disable multiple ust event xsd validation"
is_command_success $OUTPUT_DEST false
#Begin testing
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
list_lttng_with_opts "$session_name -c $channel_name"
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: list channel xsd validation"
#Expect 1 domain: UST
#Begin testing
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
list_lttng_with_opts "$session_name -d"
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: list domain xsd validation"
#Expect 2 domain: Jul and UST
#Begin testing
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
list_lttng_with_opts $session_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: list session xsd validation"
#Expect 2 domain: Jul and UST
touch ${file_sync_before_last}
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: list ust event xsd validation"
#Extract events
#No channel enable start command should return element success false
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
start_lttng_tracing_fail $session_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: failed start xsd validation"
#Expect a false element
#Start tracing
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
start_lttng_tracing_ok $session_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: start xsd validation"
#Expect a true element
#Test metadata regenerate command
regenerate_metadata_ok $session_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: regenerate metadata"
#Test stop command
stop_lttng_tracing_ok $session_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: stop xsd validation"
#Extract session name from xml
#Test failing stop command
stop_lttng_tracing_fail $session_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: failed stop xsd validation"
#Expect a false element
#No channel enable start command should return element success false
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
lttng_snapshot_add_output_ok $session_name file://$snapshot_path
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: snapshot xsd validation"
#Expect a true element
#Test list output
lttng_snapshot_list $session_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: snapshot list xsd validation"
#Expect a true element
#Test del output
lttng_snapshot_del_output_ok $session_name $snapshot_id
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: snapshot delete xsd validation"
#Success ?
#Test fail on delete command
lttng_snapshot_del_output_fail $session_name $snapshot_id
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: snapshot delete xsd validation"
#Success ?
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
lttng_track_ok "-p $pid -u"
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: track pid xsd validation"
#Expect a true element
#Test the pid_tracker listing
list_lttng_with_opts $session_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: session list with pid_tracker validate"
#Check the good count
#Untrack pid 2,3
lttng_untrack_ok "-p 2,3 -u"
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: untrack pid xsd validation"
#Expect a true element
#Check pid_tracker listing
list_lttng_with_opts $session_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: session list with pid_tracker validate"
#Check the good count
#Untrack all
lttng_untrack_ok "-p -u -a"
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: untrack pid xsd validation"
#Expect a true element
#behavior. If all pid are untrack than the pid_tracker is still
#enabled (pid_tracker node is present).
list_lttng_with_opts $session_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: session list with pid_tracker validate"
#Check the good count
#Test track all
lttng_track_ok "-p -u -a"
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: track pid xsd validation"
#Expect a true element
#behavior. If all pid are untrack thant the pid_tracker is
#disabled (node pid_tracker do not exist)
list_lttng_with_opts $session_name
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: session list with pid_tracker validate"
node_check_xml $OUTPUT_DEST $XPATH_VPID_TRACKER result
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
lttng_add_context_list
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "Mi test: context listing validation"
}
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
lttng_clear_session_ok ${session_name[0]}
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "MI test: clear session ${session_name[0]} xsd validation"
#Verify that we cleared the good session
#Destroy all and count:should be 3
lttng_clear_all
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "MI test: clear all session xsd validation"
#Verify that we cleared 3 sessions
#Verify that if no session is present command fail and mi report it.
lttng_clear_session_fail ${session_name[0]}
- $XML_VALIDATE $OUTPUT_DEST
+ $MI_VALIDATE $OUTPUT_DEST
ok $? "MI test: failing clear session ${session_name[0]} xsd validation"
extract_xml $OUTPUT_DEST $XPATH_COMMAND_SUCCESS result
test "$result" = "false"