X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fmi%2Ftest_mi;h=620b53cf778cbcc96b6ff5e07e3910d14cb56080;hp=ccf92363f12e4e776eead53cfc3c26705f243527;hb=bf6ae429bc7bf2fefdce61e48806768dab7567d5;hpb=50a7461754605f14987d6bab5d83f63950beba4f diff --git a/tests/regression/tools/mi/test_mi b/tests/regression/tools/mi/test_mi index ccf92363f..620b53cf7 100755 --- a/tests/regression/tools/mi/test_mi +++ b/tests/regression/tools/mi/test_mi @@ -140,12 +140,12 @@ function test_create_session () 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 @@ -166,7 +166,7 @@ function test_destroy_session () #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 @@ -212,7 +212,7 @@ function test_list_sessions () #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 @@ -242,7 +242,7 @@ function test_ust_channel () #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 @@ -300,7 +300,7 @@ function test_ust_lttng_event () #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 @@ -328,7 +328,7 @@ function test_ust_lttng_event () $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" @@ -372,7 +372,7 @@ function test_list_channel () #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 @@ -419,7 +419,7 @@ function test_list_domain () #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 @@ -467,7 +467,7 @@ function test_list_session () #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 @@ -511,16 +511,21 @@ function test_list_ust_event () $XML_VALIDATE $OUTPUT_DEST ok $? "Mi test: list ust event xsd validation" - #Extract events 5 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 "5" + + #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 12 + #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 @@ -535,7 +540,7 @@ function test_start_stop () { #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