tests: Don't run session-long dbus daemons for tests

They require a tty or X11 displays, thus are not suitable for headless runs
(such as in mock). Furthermore, they die with the tty or X11 session, which
is somehow late -- a lot of them may accumulate. Let's kill them right away.
This commit is contained in:
Lubomir Rintel 2014-10-20 18:24:26 +02:00
parent 72cafb8ca3
commit e9bfd0e29c
2 changed files with 10 additions and 6 deletions

View file

@ -1,7 +1,9 @@
#!/bin/sh
# Spawn DBus if there's none
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
exec dbus-launch --exit-with-session "$@"
else
exec "$@"
eval `dbus-launch --sh-syntax`
trap "kill $DBUS_SESSION_BUS_PID" EXIT
fi
"$@"

View file

@ -1,7 +1,9 @@
#!/bin/sh
# Spawn DBus if there's none
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
exec dbus-launch --exit-with-session "$@"
else
exec "$@"
eval `dbus-launch --sh-syntax`
trap "kill $DBUS_SESSION_BUS_PID" EXIT
fi
"$@"