diff options
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-tools/run-ptest')
-rwxr-xr-x | meta/recipes-kernel/lttng/lttng-tools/run-ptest | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/meta/recipes-kernel/lttng/lttng-tools/run-ptest index eaa2e7b29d..39d93e2bbf 100755 --- a/meta/recipes-kernel/lttng/lttng-tools/run-ptest +++ b/meta/recipes-kernel/lttng/lttng-tools/run-ptest | |||
@@ -1,6 +1,45 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # Without --ignore-exit, the tap harness causes any FAILs within a | 2 | # Without --ignore-exit, the tap harness causes any FAILs within a |
3 | # test plan to raise ERRORs; this is just noise. | 3 | # test plan to raise ERRORs; this is just noise. |
4 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=$PWD top_builddir=$PWD" | 4 | |
5 | make -k -t all >/dev/null 2>&1 | 5 | #Detecting whether current system has lttng kernel modules |
6 | exec make -k -s $makeargs check 2>/dev/null | sed -e 's#/tmp/tmp\...........#/tmp/tmp.XXXXXXXXXX#g' | 6 | LTTNG_KMOD_PATH=/lib/modules/$(uname -r)/kernel/lttng-modules/lttng-tracer.ko |
7 | function validate_lttng_modules_present() | ||
8 | { | ||
9 | # Check for loadable modules. | ||
10 | if [ -f "$LTTNG_KMOD_PATH" ]; then | ||
11 | return 0 | ||
12 | fi | ||
13 | |||
14 | # Check for builtin modules. | ||
15 | ls /proc/lttng > /dev/null 2>&1 | ||
16 | if [ $? -eq 0 ]; then | ||
17 | return 0 | ||
18 | fi | ||
19 | |||
20 | return 1 | ||
21 | } | ||
22 | |||
23 | export LD_LIBRARY_PATH=FIXMEPTESTPATH/tests/utils/testapp/userspace-probe-elf-binary/.libs | ||
24 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=FIXMEPTESTPATH top_builddir=FIXMEPTESTPATH" | ||
25 | |||
26 | #If current system doesn't have lttng kernel modules, disable lttng kernel related tests. | ||
27 | validate_lttng_modules_present || { | ||
28 | makeargs="$makeargs LTTNG_TOOLS_DISABLE_KERNEL_TESTS=1" | ||
29 | } | ||
30 | |||
31 | make -k -t all >error.log 2>&1 | ||
32 | # Can specify a test e.g.: | ||
33 | # -C tests/regression/ check TESTS='kernel/test_callstack' | ||
34 | make -k -s $makeargs check 2>error.log | sed -e 's#/tmp/tmp\...........#/tmp/tmp.XXXXXXXXXX#g' | ||
35 | exitcode=$? | ||
36 | if [ -e error.log ]; then | ||
37 | cat error.log | ||
38 | fi | ||
39 | if [ -e tests/unit/test-suite.log ]; then | ||
40 | cat tests/unit/test-suite.log | ||
41 | fi | ||
42 | if [ -e tests/regression/test-suite.log ]; then | ||
43 | cat tests/regression/test-suite.log | ||
44 | fi | ||
45 | exit $exitcode | ||