Skip to content

Commit 8ab54c8

Browse files
authored
Merge pull request #38 from acaso/use_dbus-launch_instead_of_dbus-session
Refactor tests runner script to use dbus-launch instead of dbus-daemon
2 parents 41c397c + 9194f40 commit 8ab54c8

File tree

5 files changed

+6
-14
lines changed

5 files changed

+6
-14
lines changed

tests/py2.7-ubuntu-14.04.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ubuntu:14.04
22
RUN apt-get update
33

4-
RUN apt-get install -y dbus python-gi python-pip psmisc python-dev
4+
RUN apt-get install -y dbus python-gi python-pip psmisc python-dev dbus-x11
55
RUN python2 --version
66
RUN pip2 install greenlet
77

tests/py2.7-ubuntu-16.04.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ubuntu:16.04
22
RUN apt-get update
33

4-
RUN apt-get install -y dbus python-gi python-pip psmisc
4+
RUN apt-get install -y dbus python-gi python-pip psmisc dbus-x11
55
RUN python2 --version
66
RUN pip2 install greenlet
77

tests/py3.4-ubuntu-14.04.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ubuntu:14.04
22
RUN apt-get update
33

4-
RUN apt-get install -y dbus python3-gi python3-pip psmisc python3-dev
4+
RUN apt-get install -y dbus python3-gi python3-pip psmisc python3-dev dbus-x11
55
RUN python3 --version
66
RUN pip3 install greenlet
77

tests/py3.5-ubuntu-16.04.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ubuntu:16.04
22
RUN apt-get update
33

4-
RUN apt-get install -y dbus python3-gi python3-pip psmisc
4+
RUN apt-get install -y dbus python3-gi python3-pip psmisc dbus-x11
55
RUN python3 --version
66
RUN pip3 install greenlet
77

tests/run.sh

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
#!/bin/sh
22
set -e
33

4-
ADDRESS_FILE=$(mktemp /tmp/pydbustest.XXXXXXXXX)
5-
PID_FILE=$(mktemp /tmp/pydbustest.XXXXXXXXX)
4+
eval `dbus-launch --sh-syntax`
65

7-
dbus-daemon --session --print-address=0 --print-pid=1 --fork 0>"$ADDRESS_FILE" 1>"$PID_FILE"
8-
9-
export DBUS_SESSION_BUS_ADDRESS=$(cat "$ADDRESS_FILE")
10-
PID=$(cat "$PID_FILE")
11-
12-
trap 'kill -TERM $PID' EXIT
13-
14-
rm "$ADDRESS_FILE" "$PID_FILE"
6+
trap 'kill -TERM $DBUS_SESSION_BUS_PID' EXIT
157

168
PYTHON=${1:-python}
179

0 commit comments

Comments
 (0)