Debian Codegraph @

debian/tests/installed-tests

raw
1 #!/bin/sh
2 set -eu
3
4 # Override polkit checks for colord daemon. Normally this would allow
5 # locally-logged-in users to do things, but our autopkgtest user isn't locally-logged-in.
6 cp debian/tests/overrides/99-allow-all-colord.rules /etc/polkit-1/rules.d/
7
8 mkdir -p /etc/systemd/system/colord.service.d/
9 cp debian/tests/overrides/colord.service /etc/systemd/system/colord.service.d/10-add-dummy-sensor.conf
10
11 systemctl daemon-reload
12 systemctl restart colord
13
14 # One of the colord tests requires a session component to watch $XDG_DATA_HOME and import the
15 # ICC files that get dumped there.
16
17 if [ -z "${AUTOPKGTEST_NORMAL_USER}" ]
18 then
19 adduser --disabled-password --gecos "" test
20 AUTOPKGTEST_NORMAL_USER=test
21 fi
22
23 # In GNOME the gsd-color component of gnome-settings-daemon is responsible for handling
24 # user ICC files.
25 NORMAL_USER_ID=$(id -u ${AUTOPKGTEST_NORMAL_USER})
26 USER_RUNTIME_DIR="/run/user/${NORMAL_USER_ID}"
27
28 systemctl start "user@${NORMAL_USER_ID}.service"
29 eval $(su -l -c "XDG_RUNTIME_DIR=\"${USER_RUNTIME_DIR}\" systemctl --user show-environment" $AUTOPKGTEST_NORMAL_USER | grep DBUS_SESSION_BUS_ADDRESS)
30
31 su -c "XDG_SESSION_TYPE=wayland XDG_RUNTIME_DIR=\"${USER_RUNTIME_DIR}\" DBUS_SESSION_BUS_ADDRESS=\"${DBUS_SESSION_BUS_ADDRESS}\" \
32 xwfb-run -- sh -c \"gnome-session & sleep 20 ; gnome-desktop-testing-runner colord\"" \
33 ${AUTOPKGTEST_NORMAL_USER}
34
35 # xiccd also serves as a colord session bridge; test that too.
36 #sudo -u $AUTOPKGTEST_NORMAL_USER dbus-run-session -- xvfb-run -a sh -c "xiccd & sleep 10; gnome-desktop-testing-runner colord"
37