blob: 5bb88d21e510e883dae94dbe5cfc6d8e560c4c93 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From e7db27668a9d7fd279d45bc43f3a2d5847374e7b Mon Sep 17 00:00:00 2001
2From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
3Date: Tue, 12 Mar 2019 12:04:58 -0400
4Subject: [PATCH lttng-tools 1/2] Fix: test: skip test_getcpu_override on
5 single thread system
6
7There is no value in performing this test on single thread system
8since the only valid value for the cpu field is 0.
9
10This test currently fails on single thread system (i.e yocto runquemu)
11on the test_getcpu_override_fail test case.
12
13Upstream-Status: Accepted [f87d0ca370c17b597762f5ee218f0e821ed2452d]
14Backported to 2.11 and 2.10
15
16Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
17---
18 .../ust/getcpu-override/test_getcpu_override | 16 +++++++++++-----
19 1 file changed, 11 insertions(+), 5 deletions(-)
20
21diff --git a/tests/regression/ust/getcpu-override/test_getcpu_override b/tests/regression/ust/getcpu-override/test_getcpu_override
22index 4ca385aeb..ee3e31953 100755
23--- a/tests/regression/ust/getcpu-override/test_getcpu_override
24+++ b/tests/regression/ust/getcpu-override/test_getcpu_override
25@@ -157,13 +157,19 @@ plan_tests $NUM_TESTS
26
27 print_test_banner "$TEST_DESC"
28
29-if [ -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then
30- foundobj=1
31-else
32- foundobj=0
33+if [ ! -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then
34+ skip 0 "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0
35+fi
36+
37+if [ "$num_cpus" -eq "1" ]; then
38+ # Skip the test since we cannot perform it as designed since N mod 1
39+ # is always equals to zero. There is no point testing this on a system
40+ # with a single thread. LTTng-UST limits the get_cpu function to return
41+ # value inside the [0, NUM_CPU - 1] range for a valid event (present in
42+ # trace).
43+ skip 0 "Test system only have a single thread. Skipping all tests." $NUM_TESTS && exit 0
44 fi
45
46-skip $foundobj "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0
47
48 TESTS=(
49 test_getcpu_override_fail
50--
512.17.1
52