Fix tests: skip test_getcpu_override on single core systems
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 12 Mar 2019 18:30:30 +0000 (14:30 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 28 Mar 2019 19:52:47 +0000 (15:52 -0400)
There is no value in performing this test on single-core system
since the only valid value for the cpu field is 0.

This test currently fails on single-core systems (i.e yocto runqemu)
on the test_getcpu_override_fail test case.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/ust/getcpu-override/test_getcpu_override

index 4ca385aeb0c5e19f58136af4c979498eb8a86963..72010581e83aa251451ba4ffeee8db32c11d97f9 100755 (executable)
@@ -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 configured core. 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
This page took 0.027441 seconds and 5 git commands to generate.