mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-06 13:58:01 +02:00
tests: Ensure session bus has started before integration test
The session dbus-daemon won't necessarily be run immediately on login if we are using systemd socket activation for it, and the transient services directory $XDG_RUNTIME_DIR/dbus-1/services isn't created until it's actually run. Ping the dbus-daemon to make sure it's available. Signed-off-by: Simon McVittie <smcv@debian.org> Bug-Debian: https://bugs.debian.org/1005889
This commit is contained in:
parent
d1ad22c93d
commit
47a4bdfaf8
1 changed files with 13 additions and 2 deletions
|
|
@ -74,8 +74,19 @@ trap cleanup EXIT
|
|||
|
||||
echo "1..2"
|
||||
|
||||
# This is an integration test, so we expect the dbus-daemon to already be
|
||||
# running
|
||||
# If the dbus-daemon is launched on-demand by a systemd socket unit, it
|
||||
# might not be there yet, even if the socket is
|
||||
(
|
||||
dbus-send --session --dest="org.freedesktop.DBus" \
|
||||
--type=method_call --print-reply /org/freedesktop/DBus \
|
||||
org.freedesktop.DBus.Peer.Ping || touch "$workdir/failed" \
|
||||
) 2>&1 | sed -e 's/^/# /'
|
||||
|
||||
if [ -e "$workdir/failed" ]; then
|
||||
echo "Bail out! Unable to ensure dbus-daemon has started"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! test -d "$XDG_RUNTIME_DIR/dbus-1/services"; then
|
||||
echo "Bail out! $XDG_RUNTIME_DIR/dbus-1/services is not a directory"
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue