From 42e12d342e9a71d90d7caa303d8d0fcc22452546 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 5 Sep 2013 13:05:21 +0100 Subject: [PATCH] run-with-tmp-session-bus.sh: create a unique temporary file per process This makes the regression tests OK to run in parallel. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852 Reviewed-by: Ralf Habacker (cherry picked from commit 9d80d46a794e0770494aa517d1b94e7e6ea9e21d) --- test/name-test/.gitignore | 2 +- tools/run-with-tmp-session-bus.sh | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/name-test/.gitignore b/test/name-test/.gitignore index 09f7ad3..2bf313a 100644 --- a/test/name-test/.gitignore +++ b/test/name-test/.gitignore @@ -3,7 +3,7 @@ Makefile Makefile.in echo-error-output.tmp -run-with-tmp-session-bus.conf +tmp-session-bus.*.conf test-ids test-names test-pending-call-dispatch diff --git a/tools/run-with-tmp-session-bus.sh b/tools/run-with-tmp-session-bus.sh index c39999f..3f5a8fa 100755 --- a/tools/run-with-tmp-session-bus.sh +++ b/tools/run-with-tmp-session-bus.sh @@ -4,13 +4,16 @@ SCRIPTNAME=$0 WRAPPED_SCRIPT=$1 shift -die() +CONFIG_FILE=./tmp-session-bus.$$.conf + +die () { if ! test -z "$DBUS_SESSION_BUS_PID" ; then echo "killing message bus "$DBUS_SESSION_BUS_PID >&2 kill -9 $DBUS_SESSION_BUS_PID fi - echo $SCRIPTNAME: $* >&2 + echo "$SCRIPTNAME: $*" >&2 + rm -f "$CONFIG_FILE" exit 1 } @@ -21,7 +24,6 @@ fi ## convenient to be able to ctrl+C without leaking the message bus process trap 'die "Received SIGINT"' INT -CONFIG_FILE=./run-with-tmp-session-bus.conf SERVICE_DIR="$DBUS_TOP_BUILDDIR/test/data/valid-service-files" ESCAPED_SERVICE_DIR=`echo $SERVICE_DIR | sed -e 's/\//\\\\\\//g'` echo "escaped service dir is: $ESCAPED_SERVICE_DIR" >&2 @@ -73,4 +75,5 @@ sleep 2 ## be sure it really died kill -9 $DBUS_SESSION_BUS_PID > /dev/null 2>&1 || true +rm -f "$CONFIG_FILE" exit 0 -- 2.7.4