diff mbox series

[v3] dbus: Let the ptest package install alongside dbus-broker

Message ID 20261107051814.1554087-1-khem.raj@oss.qualcomm.com
State Under Review
Headers show
Series [v3] dbus: Let the ptest package install alongside dbus-broker | expand

Commit Message

Khem Raj Nov. 7, 2026, 5:18 a.m. UTC
dbus-ptest RDEPENDS on dbus, both explicitly and through ptest.bbclass,
and dbus-broker RCONFLICTS dbus. With VIRTUAL-RUNTIME_dbus = "dbus-broker"
(systemd pulls it in) core-image-ptest-dbus fails in do_rootfs:

  package dbus-broker-37-r0.6.cortexa57 conflicts with dbus provided by dbus-1-1.16.2-r0.45.cortexa57
  package dbus-ptest-1.16.2-r0.45.cortexa57 requires dbus, but none of the providers can be installed

The installed tests don't use the system bus. They start private buses
with dbus-daemon (DBUS_TEST_DAEMON) and use dbus-send, so depend on the
dbus-daemon and dbus-tools packages instead and drop the dbus dependency,
like avahi does.

Setting the ptest dependencies with a hard = so that ptest.bbclass
wouldn't add dbus. That also threw away gnome-desktop-testing
which ptest-gnome.bbclass adds the same way. run-ptest calls
gnome-desktop-testing-runner, so the test exited with status 127 before
running anything.

With this the images using dbus-broker as the system bus also pass all 60 dbus
ptests.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
v2: Do not use remove operation
v3: Add gnome-desktop-testing explicitly as well

 meta/recipes-core/dbus/dbus_1.16.2.bb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-core/dbus/dbus_1.16.2.bb b/meta/recipes-core/dbus/dbus_1.16.2.bb
index e602c67727..4fdff64a7d 100644
--- a/meta/recipes-core/dbus/dbus_1.16.2.bb
+++ b/meta/recipes-core/dbus/dbus_1.16.2.bb
@@ -108,7 +108,14 @@  RRECOMMENDS:${PN}-lib = "${PN}"
 RRECOMMENDS:${PN}-lib:class-target = "${VIRTUAL-RUNTIME_dbus}"
 FILES:${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-test-tool ${datadir}/xml/dbus-1"

-RDEPENDS:${PN}-ptest += "bash make dbus"
+# Not using += or append here is to avoid adding PN as dependency.
+# The tests start their own buses with dbus-daemon and talk to them with
+# dbus-send; they don't need the system bus (dbus), which would conflict with
+# other system bus implementations such as dbus-broker.
+# using hard = also threw away gnome-desktop-testing, which ptest-gnome.bbclass adds the same way
+# needs adding explicitly as well
+RDEPENDS:${PN}-ptest = "bash gnome-desktop-testing \
+                        make ${@bb.utils.contains('PACKAGECONFIG', 'message-bus', '${PN}-daemon', '', d)} ${PN}-tools"

 pkg_postinst:${PN}() {
 	if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then