summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuro Bystricky <juro.bystricky@intel.com>2018-02-27 12:19:26 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-01 22:18:46 +0000
commit2d3e09949732ed48c8c9a328d9ab6ebbf6889b13 (patch)
tree50fd99658aa9d84b782c0c1796e34aba16c90f8f
parentbdb026db909050eedf4f039ee6ecaa45c1c7468a (diff)
downloadpoky-2d3e09949732ed48c8c9a328d9ab6ebbf6889b13.tar.gz
dbus-test_1.12.2: various fixes
The result of running dbus-test-ptest was a series of various segfaults, interpreted as FAILs. This was a direct consequence of the test suite loading the installed shared library libdbus-1.so, not the one built along the test suite. While we normally want to test against the installed libraries, we cannot do this in this case as the test suite expects a library that is configured/compiled differently from the installed one. We could configure the installed library identically as the test suite expects, (and there should be no issues), however this is not desirable for performance reasons. Hence we need to use the library built along with the test suite. Of course, running the test suite against its own library does not test the installed library, however they are both built from the same sources so that can give us some kind of indication. The following changes were made: 1. Configure the test library as close as possible to the installed one, with some additional configuration options that are needed for testing. (Use dbus_1.12.2.bb recipe as a template) 2. Include the shared libraries in the package, use LD_LIBRARY_PATH during testing to load them instead of the installed ones. 3. Add a few more tests. (There are still some additional tests built that are not used, but they would have to be special-cased). 4. When evaluating the test results, differentiate between "FAIL" and "SKIP" [YOCTO #10841] [YOCTO #12277] (From OE-Core rev: 5d148aa9c3c338fabab1e60e2ca64d09c9b8477f) (From OE-Core rev: 0828850fd09f738572ae8259384af07eeb81182b) Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/dbus/dbus-test_1.12.2.bb32
-rwxr-xr-xmeta/recipes-core/dbus/dbus/run-ptest20
2 files changed, 45 insertions, 7 deletions
diff --git a/meta/recipes-core/dbus/dbus-test_1.12.2.bb b/meta/recipes-core/dbus/dbus-test_1.12.2.bb
index c3891a3370..26556ed246 100644
--- a/meta/recipes-core/dbus/dbus-test_1.12.2.bb
+++ b/meta/recipes-core/dbus/dbus-test_1.12.2.bb
@@ -34,25 +34,49 @@ EXTRA_OECONF = "--enable-tests \
34 --enable-checks \ 34 --enable-checks \
35 --enable-asserts \ 35 --enable-asserts \
36 --enable-verbose-mode \ 36 --enable-verbose-mode \
37 --enable-largefile \
37 --disable-xml-docs \ 38 --disable-xml-docs \
38 --disable-doxygen-docs \ 39 --disable-doxygen-docs \
39 --disable-libaudit \ 40 --disable-libaudit \
40 --disable-systemd \
41 --without-systemdsystemunitdir \
42 --with-dbus-test-dir=${PTEST_PATH} \ 41 --with-dbus-test-dir=${PTEST_PATH} \
43 ${EXTRA_OECONF_X}" 42 ${EXTRA_OECONF_X}"
44 43
44EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
45
46PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)}"
47PACKAGECONFIG_class-native = ""
48PACKAGECONFIG_class-nativesdk = ""
49
50PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
51PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
52PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
53
45do_install() { 54do_install() {
46 : 55 :
47} 56}
48 57
49do_install_ptest() { 58do_install_ptest() {
50 install -d ${D}${PTEST_PATH}/test 59 install -d ${D}${PTEST_PATH}/test
51 l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay" 60 l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay \
61 variant uid-permissions syntax spawn sd-activation names monitor message fdpass "
52 for i in $l; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done 62 for i in $l; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
63
53 l="bus bus-system bus-launch-helper" 64 l="bus bus-system bus-launch-helper"
54 for i in $l; do install ${B}/bus/.libs/test-$i ${D}${PTEST_PATH}/test; done 65 for i in $l; do install ${B}/bus/.libs/test-$i ${D}${PTEST_PATH}/test; done
55 install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test 66
56 cp -r ${B}/test/data ${D}${PTEST_PATH}/test 67 cp -r ${B}/test/data ${D}${PTEST_PATH}/test
68 install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
69
70 install -d ${D}${PTEST_PATH}/test/.libs
71 cp -a ${B}/dbus/.libs/*.so* ${D}${PTEST_PATH}/test/.libs
72
73 # Remove build host references...
74 find "${D}${PTEST_PATH}/test/data" \( -name *.service -o -name *.conf \) -type f -exec \
75 sed -i \
76 -e 's:${B}:${PTEST_PATH}:g' \
77 {} +
57} 78}
79
58RDEPENDS_${PN}-ptest += "bash" 80RDEPENDS_${PN}-ptest += "bash"
81
82PRIVATE_LIBS_${PN}-ptest = "libdbus-1.so.3"
diff --git a/meta/recipes-core/dbus/dbus/run-ptest b/meta/recipes-core/dbus/dbus/run-ptest
index c72d083a91..8a8970ee20 100755
--- a/meta/recipes-core/dbus/dbus/run-ptest
+++ b/meta/recipes-core/dbus/dbus/run-ptest
@@ -1,10 +1,24 @@
1#!/bin/sh 1#!/bin/sh
2 2
3output() { 3output() {
4 if [ $? -eq 0 ] 4 retcode=$?
5 if [ $retcode -eq 0 ]
5 then echo "PASS: $i" 6 then echo "PASS: $i"
6 else echo "FAIL: $i" 7 elif [ $retcode -eq 77 ]
8 then echo "SKIP: $i"
9 else echo "FAIL: $i"
7 fi 10 fi
8} 11}
9 12
10for i in `ls test/test-*`; do ./$i ./test/data DBUS_TEST_HOMEDIR=./test >/dev/null; output; done 13export DBUS_TEST_HOMEDIR=./test
14export XDG_RUNTIME_DIR=./test
15export LD_LIBRARY_PATH=/usr/lib/dbus-test/ptest/test/.libs
16
17files=`ls test/test-*`
18
19for i in $files
20 do
21 ./$i ./test/data >/dev/null
22 output
23 done
24