summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
authorNathan Lynch <nathan_lynch@mentor.com>2016-09-27 14:04:46 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-28 10:16:04 +0100
commit206ad10eaa360b54ea277360f82f3337673cb39b (patch)
treeae17a35f8705cee216d5b9966c16911dd0bc59b6 /meta/recipes-kernel
parentd31bd8637946ec2a47fb71d37cecd206ef3b4074 (diff)
downloadpoky-206ad10eaa360b54ea277360f82f3337673cb39b.tar.gz
lttng-tools: fix ptest
Since the upgrade to 2.8, lttng-tools' test harness silently succeeds but doesn't actually run the tests. This is because upstream made some changes in their test harness: https://github.com/lttng/lttng-tools/commit/83666813cad3142ceccb929ca9b44d0e9cf53bc8 Updates to address this include: - drop now-irrelevant patch - change the ptest-run make target - remove indiscriminate search/replace commands from do_install_ptest - copy entire build directory into PTEST_PATH and then remove unneeded files - use lttng binaries installed on the system for the tests - add lttng-tools-ptest runtime dependencies - lttng-tools itself - babeltrace, used by the test harness to process traces - perl modules required by babelstats.pl test script - procps (for pgrep, pidof) - gawk - remove unnecessary chmod and munging of utils.sh script library - remove checkpatch from ptest installation tree - avoid path-munging of libtool artifacts altogether - use more efficient find+sed patterns to munge Makefiles - reduce test harness output to conform to ptest rules On qemux86-64 and qemuarm I get relatively stable results, with PASS/FAIL varying by +-1 on successive runs. TOTAL: 2345 PASS: 1735 SKIP: 311 XFAIL: 0 FAIL: 292 XPASS: 0 ERROR: 7 There are some ERRORs worth looking into further but this should be a useful basis for future work. (From OE-Core rev: 9e9875fc19df6b924aa7f9d06e7b4e07222d0799) Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rwxr-xr-xmeta/recipes-kernel/lttng/lttng-tools/run-ptest7
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch27
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools_git.bb76
3 files changed, 59 insertions, 51 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/meta/recipes-kernel/lttng/lttng-tools/run-ptest
index e758815c77..6230063442 100755
--- a/meta/recipes-kernel/lttng/lttng-tools/run-ptest
+++ b/meta/recipes-kernel/lttng/lttng-tools/run-ptest
@@ -1,4 +1,5 @@
1#!/bin/sh 1#!/bin/sh
2 2# Without --ignore-exit, the tap harness causes any FAILs within a
3make -C tests installcheck 3# test plan to raise ERRORs; this is just noise.
4 4makeargs="LOG_DRIVER_FLAGS=--ignore-exit"
5make -t all >/dev/null 2>&1 && exec make -s $makeargs check 2>/dev/null
diff --git a/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch b/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch
deleted file mode 100644
index 958bce48e0..0000000000
--- a/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1diff --git a/Makefile.am b/Makefile.am
2index 584f59b..c2bcabd 100644
3--- a/Makefile.am
4+++ b/Makefile.am
5@@ -12,3 +12,9 @@ dist_doc_DATA = LICENSE \
6 dist_noinst_DATA = CodingStyle
7
8 EXTRA_DIST = extras/lttng-bash_completion gpl-2.0.txt lgpl-2.1.txt
9+
10+install-ptest:
11+ cp -r $(srcdir)/tests $(DESTDIR)
12+ for m in $$(find $(DESTDIR)/tests -name Makefile); do \
13+ sed -i -e 's|^Makefile:|_Makefile:|' $$m; \
14+ done
15diff --git a/tests/run.sh b/tests/run.sh
16index c6c50fd..6455359 100755
17--- a/tests/run.sh
18+++ b/tests/run.sh
19@@ -19,4 +19,7 @@
20
21 [ -z "$1" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1
22
23-prove --merge --exec '' - < $1
24+prove --merge -v --exec '' - < $1 | sed \
25+ -e 's|^ok \(.*\)|PASS: \1|' \
26+ -e 's|^not ok \(.*\)|FAIL: \1|' \
27+ | egrep -h 'PASS|FAIL'
diff --git a/meta/recipes-kernel/lttng/lttng-tools_git.bb b/meta/recipes-kernel/lttng/lttng-tools_git.bb
index ab75a3743b..bfc657b3ac 100644
--- a/meta/recipes-kernel/lttng/lttng-tools_git.bb
+++ b/meta/recipes-kernel/lttng/lttng-tools_git.bb
@@ -11,7 +11,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \
11 11
12DEPENDS = "liburcu popt libxml2 util-linux" 12DEPENDS = "liburcu popt libxml2 util-linux"
13RDEPENDS_${PN} = "libgcc" 13RDEPENDS_${PN} = "libgcc"
14RDEPENDS_${PN}-ptest += "make perl bash" 14RDEPENDS_${PN}-ptest += "make perl bash gawk ${PN} babeltrace procps"
15# babelstats.pl wants getopt-long
16RDEPENDS_${PN}-ptest += "perl-module-getopt-long"
15 17
16SRCREV = "d11e0dba0df9024b8613c51e167a379b91e8b20b" 18SRCREV = "d11e0dba0df9024b8613c51e167a379b91e8b20b"
17PV = "2.8.1+git${SRCPV}" 19PV = "2.8.1+git${SRCPV}"
@@ -29,7 +31,6 @@ PACKAGECONFIG_remove_libc-musl = "lttng-ust"
29 31
30SRC_URI = "git://git.lttng.org/lttng-tools.git;branch=stable-2.8 \ 32SRC_URI = "git://git.lttng.org/lttng-tools.git;branch=stable-2.8 \
31 file://0001-Fix-error.h-common-error.h.patch \ 33 file://0001-Fix-error.h-common-error.h.patch \
32 file://runtest-2.4.0.patch \
33 file://run-ptest" 34 file://run-ptest"
34 35
35S = "${WORKDIR}/git" 36S = "${WORKDIR}/git"
@@ -56,27 +57,60 @@ do_configure_prepend () {
56} 57}
57 58
58do_install_ptest () { 59do_install_ptest () {
59 chmod +x ${D}${PTEST_PATH}/tests/utils/utils.sh 60 mkdir -p ${D}${PTEST_PATH}
60 for i in `find ${D}${PTEST_PATH} -perm /u+x -type f`; do 61
61 sed -e "s:\$TESTDIR.*/src/bin/lttng/\$LTTNG_BIN:\$LTTNG_BIN:g" \ 62 cp -a -T ${B} ${D}${PTEST_PATH}
62 -e "s:\$TESTDIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \ 63
63 -e "s:\$DIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \ 64 # Prevent attempts to update Makefiles during test runs, and
64 -e "s:\$TESTDIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \ 65 # silence "Making check in $SUBDIR" messages.
65 -e "s:\$DIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \ 66 find ${D}${PTEST_PATH} -name Makefile -type f -exec \
66 -e "s:\$TESTDIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \ 67 sed -i -e 's!^Makefile:!_Makefile:!' \
67 -e "s:\$DIR/../src/bin/lttng-sessiond/lttng-sessiond:\$SESSIOND_BIN:g" \ 68 -e '/echo "Making $$target in $$subdir"; \\/d' {} +
68 -e "s:\$DIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \ 69
69 -e "s:\$DIR/../bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \ 70 # Prevent attempts to update version.h during test runs.
70 -i $i 71 sed -i -e '/^\.PHONY: version\.h$/d' ${D}${PTEST_PATH}/include/Makefile
72
73 # Silence "Making check in $SUBDIR" messages.
74 find ${D}${PTEST_PATH} -name Makefile -type f -exec \
75 sed -i -e '/echo "Making $$target in $$subdir"; \\/d' {} +
76
77 # Substitute links to installed binaries.
78 for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd ; do
79 orig="${D}${PTEST_PATH}/src/bin/${prog}/${prog}"
80 rm "$orig"
81 case "$prog" in
82 lttng-consumerd)
83 ln -s "${libdir}/lttng/libexec/$prog" "$orig"
84 ;;
85 *)
86 ln -s "${bindir}/$prog" "$orig"
87 ;;
88 esac
71 done 89 done
72 90
73 # Update libdir references in copied .la files 91 # Remove libtool artifacts.
74 for i in `find ${D}${PTEST_PATH} -type f -name *.la`; do 92 find ${D}${PTEST_PATH} \( -name '*.l[ao]' -o -name '*.lai' \) -delete
75 sed -i -e 's#${S}/tests/#${STAGING_DIR}${PTEST_PATH}#g' $i 93
94 # Remove object files and archives.
95 find ${D}${PTEST_PATH} -name '*.[oa]' -type f -delete
96
97 # Remove Makefile.am and Makefile.in.
98 find ${D}${PTEST_PATH} -name 'Makefile.*' -type f -delete
99
100 # Remove autom4te.cache.
101 rm -rf ${D}${PTEST_PATH}/autom4te.cache
102
103 # Replace libtool wrapper scripts (which won't work on the
104 # target) with their corresponding binaries.
105 for prog in unit/ini_config/ini_config \
106 regression/tools/live/live_test \
107 regression/tools/health/health_check ; do
108 basename=${prog##*/}
109 ldir=${D}${PTEST_PATH}/tests/${prog%/*}
110 mv -f ${ldir}/.libs/${basename} ${ldir}
76 done 111 done
77 112
78 sed -e "s:src/bin:bin:g" -e "s:lt-::g" \ 113 # checkpatch.pl is unneeded on target and causes file-rdeps QA
79 -i ${D}${PTEST_PATH}/tests/utils/utils.sh 114 # warnings.
80 sed -e "s:ini_config:\.libs\/ini_config:" \ 115 rm -f ${D}${PTEST_PATH}/extras/checkpatch.pl
81 -i ${D}${PTEST_PATH}/tests/unit/ini_config/test_ini_config
82} 116}