summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-05 13:05:21 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-05 13:05:21 +0100
commit42e12d342e9a71d90d7caa303d8d0fcc22452546 (patch)
tree82ebf723b56f244cc436c3e0a1d1abd2953e49d9
parent3b4a09c04ee859846521e12184e3a11ca737c82d (diff)
downloaddbus-42e12d342e9a71d90d7caa303d8d0fcc22452546.tar.gz
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 <ralf.habacker@freenet.de> (cherry picked from commit 9d80d46a794e0770494aa517d1b94e7e6ea9e21d)
-rw-r--r--test/name-test/.gitignore2
-rwxr-xr-xtools/run-with-tmp-session-bus.sh9
2 files changed, 7 insertions, 4 deletions
diff --git a/test/name-test/.gitignore b/test/name-test/.gitignore
index 09f7ad36..2bf313a5 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 c39999fb..3f5a8fa2 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