File: installed-tests

package info (click to toggle)
colord 1.4.8-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,336 kB
  • sloc: ansic: 48,896; xml: 24,173; python: 79; sh: 70; makefile: 48; cpp: 38
file content (37 lines) | stat: -rwxr-xr-x 1,568 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
set -eu

# Override polkit checks for colord daemon. Normally this would allow
# locally-logged-in users to do things, but our autopkgtest user isn't locally-logged-in.
cp debian/tests/overrides/99-allow-all-colord.rules /etc/polkit-1/rules.d/

mkdir -p /etc/systemd/system/colord.service.d/
cp debian/tests/overrides/colord.service /etc/systemd/system/colord.service.d/10-add-dummy-sensor.conf

systemctl daemon-reload
systemctl restart colord

# One of the colord tests requires a session component to watch $XDG_DATA_HOME and import the
# ICC files that get dumped there.

if [ -z "${AUTOPKGTEST_NORMAL_USER}" ]
then
    adduser --disabled-password --gecos "" test
    AUTOPKGTEST_NORMAL_USER=test
fi

# In GNOME the gsd-color component of gnome-settings-daemon is responsible for handling
# user ICC files.
NORMAL_USER_ID=$(id -u ${AUTOPKGTEST_NORMAL_USER})
USER_RUNTIME_DIR="/run/user/${NORMAL_USER_ID}"

systemctl start "user@${NORMAL_USER_ID}.service"
eval $(su -l -c "XDG_RUNTIME_DIR=\"${USER_RUNTIME_DIR}\" systemctl --user show-environment" $AUTOPKGTEST_NORMAL_USER | grep DBUS_SESSION_BUS_ADDRESS)

su -c "XDG_SESSION_TYPE=wayland XDG_RUNTIME_DIR=\"${USER_RUNTIME_DIR}\" DBUS_SESSION_BUS_ADDRESS=\"${DBUS_SESSION_BUS_ADDRESS}\" \
    xwfb-run -- sh -c \"gnome-session & sleep 20 ; gnome-desktop-testing-runner colord\"" \
    ${AUTOPKGTEST_NORMAL_USER}

# xiccd also serves as a colord session bridge; test that too. 
#sudo -u $AUTOPKGTEST_NORMAL_USER dbus-run-session -- xvfb-run -a sh -c "xiccd & sleep 10; gnome-desktop-testing-runner colord"