Test: mi: test for greater or equal to a minimum of events on ust listing.
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 10 Jun 2015 15:27:41 +0000 (11:27 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 18 Jun 2015 14:57:22 +0000 (16:57 +0200)
Since the number of events present in the tests apps in prone to change it
make more sense to look for a minimum of events. This is less rigourous
but more flexible to change.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tools/mi/test_mi

index ccf92363f12e4e776eead53cfc3c26705f243527..c44b598e5720983600d4aa98ad0dd0e5fbc34fff 100755 (executable)
@@ -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,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
This page took 0.028994 seconds and 5 git commands to generate.