diff mbox series

[lttng-tools,1/2] Fix: test: skiptest_getcpu_override on single thread system

Message ID 20190312183031.20265-1-jonathan.rajotte-julien@efficios.com
State Accepted, archived
Delegated to: Jérémie Galarneau
Headers show
Series [lttng-tools,1/2] Fix: test: skiptest_getcpu_override on single thread system | expand

Commit Message

Jonathan Rajotte March 12, 2019, 6:30 p.m. UTC
There is no value in performing this test on single thread system
since the only valid value for the cpu field is 0.

This test currently fails on single thread system (i.e yocto runquemu)
on the test_getcpu_override_fail test case.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 .../ust/getcpu-override/test_getcpu_override     | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

Comments

Jérémie Galarneau March 29, 2019, 6:33 p.m. UTC | #1
Both patches were merged in master, stable-2.11, stable-2.10, and
stable-2.9.

Thanks!
J?r?mie

On Tue, Mar 12, 2019 at 02:30:30PM -0400, Jonathan Rajotte wrote:
> There is no value in performing this test on single thread system
> since the only valid value for the cpu field is 0.
> 
> This test currently fails on single thread system (i.e yocto runquemu)
> on the test_getcpu_override_fail test case.
> 
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
> ---
>  .../ust/getcpu-override/test_getcpu_override     | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/regression/ust/getcpu-override/test_getcpu_override b/tests/regression/ust/getcpu-override/test_getcpu_override
> index 4ca385aeb..ee3e31953 100755
> --- a/tests/regression/ust/getcpu-override/test_getcpu_override
> +++ b/tests/regression/ust/getcpu-override/test_getcpu_override
> @@ -157,13 +157,19 @@ plan_tests $NUM_TESTS
>  
>  print_test_banner "$TEST_DESC"
>  
> -if [ -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then
> -	foundobj=1
> -else
> -	foundobj=0
> +if [ ! -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then
> +	skip 0 "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0
> +fi
> +
> +if [ "$num_cpus" -eq "1" ]; then
> +	# Skip the test since we cannot perform it as designed since N mod 1
> +	# is always equals to zero. There is no point testing this on a system
> +	# with a single thread. LTTng-UST limits the get_cpu function to return
> +	# value inside the [0, NUM_CPU - 1] range for a valid event (present in
> +	# trace).
> +	skip 0 "Test system only have a single thread. Skipping all tests." $NUM_TESTS && exit 0
>  fi
>  
> -skip $foundobj "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0
>  
>  TESTS=(
>  	test_getcpu_override_fail
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/tests/regression/ust/getcpu-override/test_getcpu_override b/tests/regression/ust/getcpu-override/test_getcpu_override
index 4ca385aeb..ee3e31953 100755
--- a/tests/regression/ust/getcpu-override/test_getcpu_override
+++ b/tests/regression/ust/getcpu-override/test_getcpu_override
@@ -157,13 +157,19 @@  plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
-if [ -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then
-	foundobj=1
-else
-	foundobj=0
+if [ ! -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then
+	skip 0 "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0
+fi
+
+if [ "$num_cpus" -eq "1" ]; then
+	# Skip the test since we cannot perform it as designed since N mod 1
+	# is always equals to zero. There is no point testing this on a system
+	# with a single thread. LTTng-UST limits the get_cpu function to return
+	# value inside the [0, NUM_CPU - 1] range for a valid event (present in
+	# trace).
+	skip 0 "Test system only have a single thread. Skipping all tests." $NUM_TESTS && exit 0
 fi
 
-skip $foundobj "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0
 
 TESTS=(
 	test_getcpu_override_fail