summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/lttng/lttng-tools/run-ptest
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-tools/run-ptest')
-rwxr-xr-xmeta/recipes-kernel/lttng/lttng-tools/run-ptest45
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.
4makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=$PWD top_builddir=$PWD" 4
5make -k -t all >/dev/null 2>&1 5#Detecting whether current system has lttng kernel modules
6exec make -k -s $makeargs check 2>/dev/null | sed -e 's#/tmp/tmp\...........#/tmp/tmp.XXXXXXXXXX#g' 6LTTNG_KMOD_PATH=/lib/modules/$(uname -r)/kernel/lttng-modules/lttng-tracer.ko
7function 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
23export LD_LIBRARY_PATH=FIXMEPTESTPATH/tests/utils/testapp/userspace-probe-elf-binary/.libs
24makeargs="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.
27validate_lttng_modules_present || {
28 makeargs="$makeargs LTTNG_TOOLS_DISABLE_KERNEL_TESTS=1"
29}
30
31make -k -t all >error.log 2>&1
32# Can specify a test e.g.:
33# -C tests/regression/ check TESTS='kernel/test_callstack'
34make -k -s $makeargs check 2>error.log | sed -e 's#/tmp/tmp\...........#/tmp/tmp.XXXXXXXXXX#g'
35exitcode=$?
36if [ -e error.log ]; then
37 cat error.log
38fi
39if [ -e tests/unit/test-suite.log ]; then
40 cat tests/unit/test-suite.log
41fi
42if [ -e tests/regression/test-suite.log ]; then
43 cat tests/regression/test-suite.log
44fi
45exit $exitcode