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

Khem Raj <[email protected]>
Newsgroups org.openembedded.lists.openembedded-devel
Message-ID <[email protected]>
From: Khem Raj <[email protected]>

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 <[email protected]>
---
 .../xdg-dbus-proxy/xdg-dbus-proxy/run-ptest              | 9 +++++++++
 1 file changed, 9 insertions(+)

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.