summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-01-22 15:57:46 +0100
committerThomas Haller <thaller@redhat.com>2016-01-22 16:54:32 +0100
commitf74a9000b1ebd2cc1bf373e10ad87039b9fd73f4 (patch)
treefb5705c8ff1a5bf27cebaecc07bd287b87b6d650
parentfb1da0eab211fc50eb9a39fa24c63f7fdd2d7fc4 (diff)
downloadNetworkManager-f74a9000b1ebd2cc1bf373e10ad87039b9fd73f4.tar.gz
tests: use dbus-run-session for tools/run-test-valgrind.sh
-rwxr-xr-xtools/run-test-valgrind.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/run-test-valgrind.sh b/tools/run-test-valgrind.sh
index 4dc092a093..f2eeefcd02 100755
--- a/tools/run-test-valgrind.sh
+++ b/tools/run-test-valgrind.sh
@@ -80,10 +80,14 @@ else
fi
fi
+NMTST_DBUS_RUN_SESSION=()
if [ "$NMTST_LAUNCH_DBUS" == "yes" ]; then
- # Spawn DBus
- eval `dbus-launch --sh-syntax`
- trap "kill $DBUS_SESSION_BUS_PID" EXIT
+ if ! which dbus-run-session &>/dev/null ; then
+ eval `dbus-launch --sh-syntax`
+ trap "kill $DBUS_SESSION_BUS_PID" EXIT
+ else
+ NMTST_DBUS_RUN_SESSION=(dbus-run-session --)
+ fi
fi
if [ "$NMTST_NO_VALGRIND" != "" ]; then
@@ -95,6 +99,7 @@ LOGFILE="${TEST}.valgrind-log"
export G_SLICE=always-malloc
export G_DEBUG=gc-friendly
+"${NMTST_DBUS_RUN_SESSION[@]}" \
"${NMTST_LIBTOOL[@]}" "$NMTST_VALGRIND" \
--quiet \
--error-exitcode=$VALGRIND_ERROR \