Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] [PATCH lttng-tools] Test: mi: test for greater or equal to a minimum of events on ust listing.
@ 2015-06-10 15:27 Jonathan Rajotte
  2015-06-18 14:18 ` Mathieu Desnoyers
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Rajotte @ 2015-06-10 15:27 UTC (permalink / raw)


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 at efficios.com>
---
 tests/regression/tools/mi/test_mi | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tests/regression/tools/mi/test_mi b/tests/regression/tools/mi/test_mi
index ccf9236..c44b598 100755
--- a/tests/regression/tools/mi/test_mi
+++ b/tests/regression/tools/mi/test_mi
@@ -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
-- 
2.1.4




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [lttng-dev] [PATCH lttng-tools] Test: mi: test for greater or equal to a minimum of events on ust listing.
  2015-06-10 15:27 [lttng-dev] [PATCH lttng-tools] Test: mi: test for greater or equal to a minimum of events on ust listing Jonathan Rajotte
@ 2015-06-18 14:18 ` Mathieu Desnoyers
  2015-06-18 15:17   ` Jérémie Galarneau
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Desnoyers @ 2015-06-18 14:18 UTC (permalink / raw)


bump: J?r?mie, I know you are busy with Babeltrace, but can you quickly
look into merging this fix ? It would repair the CI.

Thanks,

Mathieu

----- On Jun 10, 2015, at 11:27 AM, Jonathan Rajotte jonathan.rajotte-julien at efficios.com wrote:

> 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 at efficios.com>
> ---
> tests/regression/tools/mi/test_mi | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/regression/tools/mi/test_mi
> b/tests/regression/tools/mi/test_mi
> index ccf9236..c44b598 100755
> --- a/tests/regression/tools/mi/test_mi
> +++ b/tests/regression/tools/mi/test_mi
> @@ -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
> --
> 2.1.4
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [lttng-dev] [PATCH lttng-tools] Test: mi: test for greater or equal to a minimum of events on ust listing.
  2015-06-18 14:18 ` Mathieu Desnoyers
@ 2015-06-18 15:17   ` Jérémie Galarneau
  0 siblings, 0 replies; 3+ messages in thread
From: Jérémie Galarneau @ 2015-06-18 15:17 UTC (permalink / raw)


Merged, thanks!

J?r?mie

On Thu, Jun 18, 2015 at 10:18 AM, Mathieu Desnoyers <
mathieu.desnoyers at efficios.com> wrote:

> bump: J?r?mie, I know you are busy with Babeltrace, but can you quickly
> look into merging this fix ? It would repair the CI.
>
> Thanks,
>
> Mathieu
>
> ----- On Jun 10, 2015, at 11:27 AM, Jonathan Rajotte
> jonathan.rajotte-julien at efficios.com wrote:
>
> > 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 at efficios.com>
> > ---
> > tests/regression/tools/mi/test_mi | 15 ++++++++++-----
> > 1 file changed, 10 insertions(+), 5 deletions(-)
> >
> > diff --git a/tests/regression/tools/mi/test_mi
> > b/tests/regression/tools/mi/test_mi
> > index ccf9236..c44b598 100755
> > --- a/tests/regression/tools/mi/test_mi
> > +++ b/tests/regression/tools/mi/test_mi
> > @@ -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
> > --
> > 2.1.4
> >
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev at lists.lttng.org
> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com
>



-- 
J?r?mie Galarneau
EfficiOS Inc.
http://www.efficios.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20150618/7c36f0ab/attachment-0001.html>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-18 15:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 15:27 [lttng-dev] [PATCH lttng-tools] Test: mi: test for greater or equal to a minimum of events on ust listing Jonathan Rajotte
2015-06-18 14:18 ` Mathieu Desnoyers
2015-06-18 15:17   ` Jérémie Galarneau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox