diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2014-10-20 18:24:26 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2014-10-24 19:16:33 +0200 |
commit | e9bfd0e29c164b79205c23617b199573b78abd5b (patch) | |
tree | dad98c5447d7a82aff9ff508a88a247c8d0b8001 | |
parent | 72cafb8ca35923d3c1f7289ed1386fbf6b23a7ff (diff) | |
download | NetworkManager-e9bfd0e29c164b79205c23617b199573b78abd5b.tar.gz |
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.
-rwxr-xr-x | libnm-glib/tests/libnm-glib-test-launch.sh | 8 | ||||
-rwxr-xr-x | libnm/tests/libnm-test-launch.sh | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/libnm-glib/tests/libnm-glib-test-launch.sh b/libnm-glib/tests/libnm-glib-test-launch.sh index 1db656ad06..42d9fbe26d 100755 --- a/libnm-glib/tests/libnm-glib-test-launch.sh +++ b/libnm-glib/tests/libnm-glib-test-launch.sh @@ -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 + +"$@" diff --git a/libnm/tests/libnm-test-launch.sh b/libnm/tests/libnm-test-launch.sh index 1db656ad06..42d9fbe26d 100755 --- a/libnm/tests/libnm-test-launch.sh +++ b/libnm/tests/libnm-test-launch.sh @@ -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 + +"$@" |