summaryrefslogtreecommitdiff
path: root/test/name-test
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-02-19 16:39:38 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-01-06 15:34:46 +0000
commit2d950f6e9a412da70e9f8bc956980abc949a5fe8 (patch)
tree1b6aec10064ff46df625970623642f140008d5ba /test/name-test
parent1794c245e2869c5f7d35f38c38b42f17c157541f (diff)
Make sure tests run with a temporary XDG_RUNTIME_DIR
We don't want the regression tests' "session" getting mixed up in system-wide "sessions". This doesn't actually matter yet, but it is likely to matter in future. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61301 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> [merged with earlier line-wrapping of TESTS_ENVIRONMENT -smcv] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'test/name-test')
-rw-r--r--test/name-test/Makefile.am2
-rwxr-xr-xtest/name-test/run-test-systemserver.sh5
-rwxr-xr-xtest/name-test/run-test.sh5
3 files changed, 12 insertions, 0 deletions
diff --git a/test/name-test/Makefile.am b/test/name-test/Makefile.am
index da41e58b..8ed1e160 100644
--- a/test/name-test/Makefile.am
+++ b/test/name-test/Makefile.am
@@ -19,7 +19,9 @@ TESTS_ENVIRONMENT = \
PYTHON=@PYTHON@ \
DBUS_TEST_DATA=@abs_top_builddir@/test/data \
DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
+ XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR \
$(NULL)
+
TESTS=run-test.sh run-test-systemserver.sh
else
TESTS=
diff --git a/test/name-test/run-test-systemserver.sh b/test/name-test/run-test-systemserver.sh
index afd1f045..90c03723 100755
--- a/test/name-test/run-test-systemserver.sh
+++ b/test/name-test/run-test-systemserver.sh
@@ -30,6 +30,11 @@ if test -n "$DBUS_TEST_MONITOR"; then
dbus-monitor --session &
fi
+XDG_RUNTIME_DIR="$DBUS_TOP_BUILDDIR"/test/XDG_RUNTIME_DIR
+test -d "$XDG_RUNTIME_DIR" || mkdir "$XDG_RUNTIME_DIR"
+chmod 0700 "$XDG_RUNTIME_DIR"
+export XDG_RUNTIME_DIR
+
echo "running test-expected-echo-fail"
${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/tools/dbus-send --print-reply --dest=org.freedesktop.DBus.TestSuiteEchoService /org/freedesktop/TestSuite org.freedesktop.TestSuite.Echo string:hi >echo-error-output.tmp 2>&1
if ! grep -q 'DBus.Error' echo-error-output.tmp; then
diff --git a/test/name-test/run-test.sh b/test/name-test/run-test.sh
index cad5937e..84379c4a 100755
--- a/test/name-test/run-test.sh
+++ b/test/name-test/run-test.sh
@@ -30,6 +30,11 @@ if test -n "$DBUS_TEST_MONITOR"; then
dbus-monitor --session &
fi
+XDG_RUNTIME_DIR="$DBUS_TOP_BUILDDIR"/test/XDG_RUNTIME_DIR
+test -d "$XDG_RUNTIME_DIR" || mkdir "$XDG_RUNTIME_DIR"
+chmod 0700 "$XDG_RUNTIME_DIR"
+export XDG_RUNTIME_DIR
+
echo "running test-ids"
${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/name-test/test-ids || die "test-ids failed"