summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2011-10-31 15:53:25 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2018-10-18 20:06:43 +0200
commit6d4639a3335ace14a699192acddf92a97acc8085 (patch)
tree3fc82b96f408cb0d2fc80c7fcac2614a5efef1e3 /tools
parent93b7bb392b6dab4e5ae7ce99cd8d99d1c9ff55d0 (diff)
downloaddbus-6d4639a3335ace14a699192acddf92a97acc8085.tar.gz
Use separate bus configuration files for executing test cases with a temporary session bus
Instead of the previous adaptation of the existing template for the session bus, a separate template is now used, which can be more easily adapted to the requirements of the test applications. Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/57
Diffstat (limited to 'tools')
-rwxr-xr-xtools/run-with-tmp-session-bus.sh23
1 files changed, 4 insertions, 19 deletions
diff --git a/tools/run-with-tmp-session-bus.sh b/tools/run-with-tmp-session-bus.sh
index 688f9e48..28379bfa 100755
--- a/tools/run-with-tmp-session-bus.sh
+++ b/tools/run-with-tmp-session-bus.sh
@@ -4,12 +4,13 @@ SCRIPTNAME="$0"
WRAPPED_SCRIPT="$1"
shift
-CONFIG_FILE=./tmp-session-bus.$$.conf
+if test -z "$DBUS_TEST_CONFIG_FILE"; then
+ DBUS_TEST_CONFIG_FILE="$DBUS_TOP_BUILDDIR/test/data/valid-config-files/tmp-session.conf"
+fi
die ()
{
echo "$SCRIPTNAME: $*" >&2
- rm -f "$CONFIG_FILE"
exit 1
}
@@ -17,21 +18,6 @@ if test -z "$DBUS_TOP_BUILDDIR" ; then
die "Must set DBUS_TOP_BUILDDIR"
fi
-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
-
-if test -z "$SOURCE_CONFIG_FILE"; then
- SOURCE_CONFIG_FILE="$DBUS_TOP_BUILDDIR/bus/session.conf";
-fi
-## create a configuration file based on the standard session.conf
-cat $SOURCE_CONFIG_FILE | \
- sed -e 's/<standard_session_servicedirs.*$/<servicedir>'$ESCAPED_SERVICE_DIR'<\/servicedir>/g' | \
- sed -e 's/<include.*$//g' \
- > $CONFIG_FILE
-
-echo "Created configuration file $CONFIG_FILE" >&2
-
if ! test -e "$DBUS_TOP_BUILDDIR"/bus/dbus-daemon ; then
die "$DBUS_TOP_BUILDDIR/bus/dbus-daemon does not exist"
fi
@@ -46,12 +32,11 @@ unset DBUS_SESSION_BUS_ADDRESS
unset DBUS_SESSION_BUS_PID
$DBUS_TOP_BUILDDIR/tools/dbus-run-session \
- --config-file="$CONFIG_FILE" \
+ --config-file="$DBUS_TEST_CONFIG_FILE" \
--dbus-daemon="$DBUS_TOP_BUILDDIR/bus/dbus-daemon" \
-- \
"$WRAPPED_SCRIPT" "$@"
error=$?
# clean up
-rm -f "$CONFIG_FILE"
exit $error