diff mbox series

[meta-oe,7/9] xdg-dbus-proxy: skip ptest when dbus-daemon is unavailable

Message ID 20260821180211.423633-7-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe,1/9] xdg-dbus-proxy: use VIRTUAL-RUNTIME_dbus for ptest RDEPENDS | expand

Commit Message

Khem Raj Aug. 21, 2026, 6:02 p.m. UTC
From: Khem Raj <raj.khem@gmail.com>

tests/test-proxy.c setup() spawns the reference bus implementation
directly:

  g_subprocess_launcher_spawn (launcher, &error, "dbus-daemon",
                               "--session", "--print-address=1",
                               "--nofork", NULL);

so the test aborts on distros that select a different
VIRTUAL-RUNTIME_dbus:

  ERROR:../tests/test-proxy.c:75:setup: assertion failed (error == NULL):
  Failed to execute child process "dbus-daemon" (No such file or directory)
  FAIL: xdg-dbus-proxy/test-proxy.test (Child process killed by signal 6)

dbus-daemon is packaged only in dbus, and dbus-broker carries
"RCONFLICTS:dbus-broker: dbus", so the two cannot be co-installed;
dbus-broker-launch is not CLI-compatible and cannot stand in. The
existing RDEPENDS on ${VIRTUAL-RUNTIME_dbus} already pulls in dbus (and
hence dbus-daemon) on distros that use it, so report the test as skipped
rather than failed when the daemon genuinely is not installable.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../xdg-dbus-proxy/xdg-dbus-proxy/run-ptest              | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/xdg-dbus-proxy/xdg-dbus-proxy/run-ptest b/meta-oe/recipes-support/xdg-dbus-proxy/xdg-dbus-proxy/run-ptest
index ff4b0b49ad..b6f3614a42 100755
--- a/meta-oe/recipes-support/xdg-dbus-proxy/xdg-dbus-proxy/run-ptest
+++ b/meta-oe/recipes-support/xdg-dbus-proxy/xdg-dbus-proxy/run-ptest
@@ -1,2 +1,11 @@ 
 #!/bin/sh
+# tests/test-proxy.c spawns the reference bus implementation directly as
+# "dbus-daemon --session --print-address=1 --nofork". Distros that select a
+# different VIRTUAL-RUNTIME_dbus (e.g. dbus-broker, which RCONFLICTS with dbus)
+# have no dbus-daemon and no CLI-compatible replacement, so the test cannot run.
+if ! command -v dbus-daemon >/dev/null 2>&1; then
+    echo "SKIP: xdg-dbus-proxy/test-proxy.test (no dbus-daemon; requires VIRTUAL-RUNTIME_dbus = dbus)"
+    exit 0
+fi
+
 gnome-desktop-testing-runner xdg-dbus-proxy