diff options
author | Juro Bystricky <juro.bystricky@intel.com> | 2018-02-27 12:19:26 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-01 22:18:46 +0000 |
commit | 2d3e09949732ed48c8c9a328d9ab6ebbf6889b13 (patch) | |
tree | 50fd99658aa9d84b782c0c1796e34aba16c90f8f /meta/recipes-core/dbus | |
parent | bdb026db909050eedf4f039ee6ecaa45c1c7468a (diff) | |
download | poky-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>
Diffstat (limited to 'meta/recipes-core/dbus')
-rw-r--r-- | meta/recipes-core/dbus/dbus-test_1.12.2.bb | 32 | ||||
-rwxr-xr-x | meta/recipes-core/dbus/dbus/run-ptest | 20 |
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 | ||
44 | EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl" | ||
45 | |||
46 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)}" | ||
47 | PACKAGECONFIG_class-native = "" | ||
48 | PACKAGECONFIG_class-nativesdk = "" | ||
49 | |||
50 | PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd" | ||
51 | PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm" | ||
52 | PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session" | ||
53 | |||
45 | do_install() { | 54 | do_install() { |
46 | : | 55 | : |
47 | } | 56 | } |
48 | 57 | ||
49 | do_install_ptest() { | 58 | do_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 | |||
58 | RDEPENDS_${PN}-ptest += "bash" | 80 | RDEPENDS_${PN}-ptest += "bash" |
81 | |||
82 | PRIVATE_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 | ||
3 | output() { | 3 | output() { |
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 | ||
10 | for i in `ls test/test-*`; do ./$i ./test/data DBUS_TEST_HOMEDIR=./test >/dev/null; output; done | 13 | export DBUS_TEST_HOMEDIR=./test |
14 | export XDG_RUNTIME_DIR=./test | ||
15 | export LD_LIBRARY_PATH=/usr/lib/dbus-test/ptest/test/.libs | ||
16 | |||
17 | files=`ls test/test-*` | ||
18 | |||
19 | for i in $files | ||
20 | do | ||
21 | ./$i ./test/data >/dev/null | ||
22 | output | ||
23 | done | ||
24 | |||