5 XDG_RUNTIME_DIR=/run/user/200
10 if [ -z "${REF_IMAGE}" ]; then
11 echo "No reference image passed"
15 if [ ! -f "${REF_IMAGE}" ]; then
16 echo "Reference image is not found"
20 # Enable the test picture and disable cursor and any other application from being displayed
21 sed -i '/^\[core\]/a activate-by-default=false' /etc/xdg/weston/weston.ini
22 # setup homescreen env variable
23 sed -i '/^\[core\]/a hide-cursor=true' /etc/xdg/weston/weston.ini
24 # enable red/green/blue test screen
25 echo 'HOMESCREEN_DEMO_CI=1' > /etc/default/homescreen
27 systemctl daemon-reload
30 # create initial journal cursor file
31 journalctl /usr/bin/agl-compositor --cursor-file=/tmp/agl-screenshot-cursor > /tmp/first-log 2>&1
33 # restart weston@display
34 systemctl restart weston.service
35 # e.g. qemu-system-arm takes loooong
37 echo "Waiting for compositor to initialize (+10sec)."
40 while test $LOOP -ge 1 ; do
42 ( mv /tmp/next-log /tmp/prev-log > /dev/null 2>&1 ) || true
43 journalctl /usr/bin/agl-compositor --cursor-file=/tmp/agl-screenshot-cursor > /tmp/next-log 2>&1
44 if ! grep -q 'Usable area:' /tmp/next-log ; then
45 # e.g. qemu-system-arm takes loooong
46 echo "Waiting for compositor to initialize (+60sec). Loop: $LOOP"
58 if ! grep -q 'Usable area:' /tmp/next-log ; then
59 echo "Marker ('Usable area:') not found. Dumping log."
60 echo "##################################"
64 echo "##################################"
66 #echo "CONTINUING ANYWAY !"
69 AGL_SCREENSHOOTER=/usr/bin/agl-screenshooter
71 if [ -z "$AGL_SCREENSHOOTER" ]; then
72 echo "Failed to find agl-screenshooter. Compositor too old?"
76 #echo "Found agl-screenshoooter in $AGL_SCREENSHOOTER"
77 rm -rf agl-screenshot-*.png
79 # give it a bit more time to display
82 if $AGL_SCREENSHOOTER; then
83 echo "Screenshot taken"
85 echo "##################################"
86 journalctl -b /usr/bin/agl-compositor
87 echo "##################################"
91 REF_IMAGE_SHA1SUM=`sha1sum ${REF_IMAGE} | awk -F ' ' '{print $1}'`
92 IMAGE_SHA1SUM=`sha1sum agl-screenshot-*.png | awk -F ' ' '{print $1}'`
94 if [ "${REF_IMAGE_SHA1SUM}" == "${IMAGE_SHA1SUM}" ]; then
95 echo "Screenshot matches the reference image"
98 echo "Screenshot does not match the reference image"
100 for i in agl-screenshot-*.png ; do
102 echo "################################################################"
103 ( curl --upload-file "$i" https://transfer.sh/$(basename "$i") && echo "" ) || true
104 echo "################################################################"
107 echo "#########################"
108 cat /run/platform/display/*.log
109 echo "#########################"
110 journalctl -b --no-pager -a
111 echo "#########################"
116 sed -i '/activate-by-default=false/d' /etc/xdg/weston/weston.ini
117 sed -i '/hide-cursor=true/d' /etc/xdg/weston/weston.ini
118 #rm -rf /etc/systemd/system/weston@.service.d
119 rm -rf /etc/default/homescreen
120 systemctl daemon-reload
123 systemctl restart weston.service