Test: mi: test for greater or equal to a minimum of events on ust listing.
[lttng-tools.git] / tests / regression / tools / mi / test_mi
index fa46b514ef90d98dfee68b220be3d9afd81eb4c1..c44b598e5720983600d4aa98ad0dd0e5fbc34fff 100755 (executable)
@@ -63,7 +63,7 @@ source $TESTDIR/utils/utils.sh
 #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
@@ -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"
@@ -511,21 +511,25 @@ function test_list_ust_event ()
        $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 last forked process
-       wait $!
-
+       #Wait for all background processes
+       wait
 }
 
 function test_start_stop () {
@@ -603,7 +607,6 @@ function test_start_stop () {
        #Teardown
        OUTPUT_DEST=$DEVNULL
        destroy_lttng_sessions
-
 }
 
 function test_snapshot () {
This page took 0.023637 seconds and 4 git commands to generate.