]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
run-with-tmp-session-bus.sh: create a unique temporary file per process
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 3 Sep 2013 11:25:31 +0000 (12:25 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 5 Sep 2013 11:35:11 +0000 (12:35 +0100)
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>
test/name-test/.gitignore
tools/run-with-tmp-session-bus.sh

index 09f7ad36d4bb813e67e884e9bddd8a0580481261..2bf313a5fb11277100396d0016571a1d3574b72a 100644 (file)
@@ -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
index 3245652ea0ce3b1a95b66b9308faefac41b645c0..94ae8fc8fd8d8e3a2bcd10527bb284009238f8fb 100755 (executable)
@@ -4,9 +4,12 @@ SCRIPTNAME="$0"
 WRAPPED_SCRIPT="$1"
 shift
 
+CONFIG_FILE=./tmp-session-bus.$$.conf
+
 die ()
 {
     echo "$SCRIPTNAME: $*" >&2
+    rm -f "$CONFIG_FILE"
     exit 1
 }
 
@@ -14,7 +17,6 @@ if test -z "$DBUS_TOP_BUILDDIR" ; then
     die "Must set DBUS_TOP_BUILDDIR"
 fi
 
-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
@@ -48,8 +50,13 @@ unset DBUS_SESSION_BUS_PID
 DBUS_USE_TEST_BINARY=1
 export DBUS_USE_TEST_BINARY
 
-exec $DBUS_TOP_BUILDDIR/tools/dbus-run-session \
+$DBUS_TOP_BUILDDIR/tools/dbus-run-session \
     --config-file="$CONFIG_FILE" \
     --dbus-daemon="$DBUS_TOP_BUILDDIR/bus/dbus-daemon" \
     -- \
     "$WRAPPED_SCRIPT" "$@"
+error=$?
+
+# clean up
+rm -f "$CONFIG_FILE"
+exit $error