[packages/python-tdbus] Fix tests when running out of X11 session

jajcus jajcus at pld-linux.org
Fri Nov 10 09:34:50 CET 2017


commit f9a3da589d12a691e0c81826f93f3ef05bb0156e
Author: Jacek Konieczny <j.konieczny at eggsoft.pl>
Date:   Fri Nov 10 09:33:57 2017 +0100

    Fix tests when running out of X11 session
    
    Run local dbus-daemon instead of using user session.

 python-tdbus.spec | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/python-tdbus.spec b/python-tdbus.spec
index 7837c36..4077631 100644
--- a/python-tdbus.spec
+++ b/python-tdbus.spec
@@ -27,6 +27,9 @@ BuildRequires:	python3-devel
 BuildRequires:	python3-gevent
 BuildRequires:	python3-setuptools
 %endif
+%if %{with tests}
+BuildRequires:	/usr/bin/dbus-launch
+%endif
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -87,6 +90,14 @@ Dokumentacja API %{module}.
 %patch0 -p1
 
 %build
+unset DISPLAY
+unset DBUS_SESSION_BUS_ADDRESS
+unset XDG_RUNTIME_DIR
+
+%if %{with tests}
+eval $(dbus-launch --sh-syntax)
+%endif
+
 %if %{with python2}
 %py_build %{?with_tests:test}
 %endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-tdbus.git/commitdiff/f9a3da589d12a691e0c81826f93f3ef05bb0156e



More information about the pld-cvs-commit mailing list