8 XDG_RUNTIME_DIR=/run/user/1001
16 if [ -z "${REF_IMAGE}" ]; then
17 echo "No reference image passed"
21 if [ ! -f "${REF_IMAGE}" ]; then
22 echo "Reference image is not found"
26 # Enable the test picture and disable cursor and any other application from being displayed
27 sed -i '/^\[core\]/a activate-by-default=false' /etc/xdg/weston/weston.ini
28 # setup homescreen env variable
29 sed -i '/^\[core\]/a hide-cursor=true' /etc/xdg/weston/weston.ini
30 # enable red/green/blue test screen
31 echo 'HOMESCREEN_DEMO_CI=1' > /etc/default/homescreen
33 systemctl daemon-reload || true
34 su - agl-driver -c 'export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1001/bus" ; systemctl --user daemon-reload' || true
37 # create initial journal cursor file
38 journalctl /usr/bin/agl-compositor --cursor-file=/tmp/agl-screenshot-cursor > /tmp/first-log 2>&1
40 # stop homescreen (shell) and launcher
41 su $AGLDRIVER -c 'XDG_RUNTIME_DIR=/run/user/1001/ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus systemctl --user stop homescreen'
42 su $AGLDRIVER -c 'XDG_RUNTIME_DIR=/run/user/1001/ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus systemctl --user stop launcher'
43 # restart agl-compositor
44 su $AGLDRIVER -c 'XDG_RUNTIME_DIR=/run/user/1001/ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus systemctl --user restart agl-compositor'
45 su $AGLDRIVER -c 'XDG_RUNTIME_DIR=/run/user/1001/ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus systemctl --user start homescreen'
47 # e.g. qemu-system-arm takes loooong
49 echo "Waiting for compositor to initialize (+10sec)."
52 while test $LOOP -ge 1 ; do
54 ( mv /tmp/next-log /tmp/prev-log > /dev/null 2>&1 ) || true
55 journalctl /usr/bin/agl-compositor --cursor-file=/tmp/agl-screenshot-cursor > /tmp/next-log 2>&1
56 if ! grep -q 'Usable area:' /tmp/next-log ; then
57 # e.g. qemu-system-arm takes loooong
58 echo "Waiting for compositor to initialize (+60sec). Loop: $LOOP"
70 if ! grep -q 'Usable area:' /tmp/next-log ; then
71 echo "Marker ('Usable area:') not found. Dumping log."
72 echo "##################################"
76 echo "##################################"
78 #echo "CONTINUING ANYWAY !"
81 AGL_SCREENSHOOTER=/usr/bin/agl-screenshooter
84 #su - $AGLDRIVER -c "..."
87 su - $AGLDRIVER -c "XDG_RUNTIME_DIR=/run/user/1001 $AGL_SCREENSHOOTER -a"
92 if [ -z "$AGL_SCREENSHOOTER" ]; then
93 echo "Failed to find agl-screenshooter. Compositor too old?"
97 #echo "Found agl-screenshoooter in $AGL_SCREENSHOOTER"
98 rm -rf /home/agl-driver/agl-screenshot-*.png
100 # give it a bit more time to display
103 su - $AGLDRIVER -c "XDG_RUNTIME_DIR=/run/user/1001 $AGL_SCREENSHOOTER -l"
105 if do_screenshot ; then
106 echo "Screenshot taken"
108 echo "##################################"
109 journalctl --no-pager -a -b /usr/bin/agl-compositor
110 echo "##################################"
114 ls /home/agl-driver/agl-screenshot*
116 REF_IMAGE_SHA1SUM=`sha1sum ${REF_IMAGE} | awk -F ' ' '{print $1}'`
117 IMAGE_SHA1SUM=`sha1sum /home/agl-driver/agl-screenshot-*.png | awk -F ' ' '{print $1}'`
119 if [ "${REF_IMAGE_SHA1SUM}" == "${IMAGE_SHA1SUM}" ]; then
120 echo "Screenshot matches the reference image"
124 echo "Screenshot does not match the reference image"
126 for i in /home/agl-driver/agl-screenshot-*.png ; do
127 if [ -x ./artiproxy-upload.sh ];then
128 ./artiproxy-upload.sh $i $(basename $i)
132 echo "#########################"
133 journalctl -t agl-compositor
134 echo "#########################"
135 journalctl -b --no-pager -a
136 echo "#########################"
142 sed -i '/activate-by-default=false/d' /etc/xdg/weston/weston.ini
143 sed -i '/hide-cursor=true/d' /etc/xdg/weston/weston.ini
144 #rm -rf /etc/systemd/system/weston@.service.d
145 rm -rf /etc/default/homescreen
146 systemctl daemon-reload
149 systemctl restart agl-session@agl-driver.service