7 if [ -z "${REF_IMAGE}" ]; then
8 echo "No reference image passed"
12 if [ ! -f "${REF_IMAGE}" ]; then
13 echo "Reference image is not found"
17 # Enable the test picture and disable cursor and any other application from being displayed
18 sed -i '/^\[core\]/a activate-by-default=false' /etc/xdg/weston/weston.ini
19 # setup homescreen env variable
20 sed -i '/^\[core\]/a hide-cursor=true' /etc/xdg/weston/weston.ini
21 # enable red/green/blue test screen
22 echo 'HOMESCREEN_DEMO_CI=1' > /etc/afm/unit.env.d/screenshot
24 systemctl daemon-reload
26 # restart weston@display
27 systemctl restart weston@display.service
28 # e.g. qemu-system-arm takes loooong
30 echo "Waiting for compositor to initialize (+60sec)."
32 if ! grep -q 'Usable area:' /run/platform/display/compositor.log ; then
33 # e.g. qemu-system-arm takes loooong
34 echo "Waiting for compositor to initialize (+60sec)."
37 if ! grep -q 'Usable area:' /run/platform/display/compositor.log ; then
38 # e.g. qemu-system-arm takes loooong
39 echo "Waiting for compositor to initialize (+120sec)."
43 # some take veeeeery long
44 if ! grep -q 'Usable area:' /run/platform/display/compositor.log ; then
45 # e.g. qemu-system-arm takes veeery loooong
46 echo "Waiting for compositor to initialize (+240sec)."
51 if ! grep -q 'Usable area:' /run/platform/display/compositor.log ; then
52 echo "Marker ('Usable area:') not found. Dumping log."
53 echo "##################################"
54 cat /run/platform/display/compositor.log
55 echo "##################################"
57 #echo "CONTINUING ANYWAY !"
60 AGL_SCREENSHOOTER=/usr/bin/agl-screenshooter
62 if [ -z "$AGL_SCREENSHOOTER" ]; then
63 echo "Failed to find agl-screenshooter. Compositor too old?"
67 #echo "Found agl-screenshoooter in $AGL_SCREENSHOOTER"
68 rm -rf agl-screenshot-*.png
70 if $AGL_SCREENSHOOTER; then
71 echo "Screenshot taken"
73 echo "##################################"
74 cat /run/platform/display/compositor.log
75 echo "##################################"
79 REF_IMAGE_SHA1SUM=`sha1sum ${REF_IMAGE} | awk -F ' ' '{print $1}'`
80 IMAGE_SHA1SUM=`sha1sum agl-screenshot-*.png | awk -F ' ' '{print $1}'`
82 if [ "${REF_IMAGE_SHA1SUM}" == "${IMAGE_SHA1SUM}" ]; then
83 echo "Screenshot matches the reference image"
86 echo "Screenshot does not match the reference image"
88 for i in agl-screenshot-*.png ; do
90 echo "################################################################"
91 ( curl --upload-file "$i" https://transfer.sh/$(basename "$i") && echo "" ) || true
92 echo "################################################################"
95 echo "#########################"
96 cat /run/platform/display/*.log
97 echo "#########################"
98 journalctl -b --no-pager -a
99 echo "#########################"
104 sed -i '/activate-by-default=false/d' /etc/xdg/weston/weston.ini
105 sed -i '/hide-cursor=true/d' /etc/xdg/weston/weston.ini
106 #rm -rf /etc/systemd/system/weston@.service.d
107 rm -rf /etc/afm/unit.env.d/screenshot
108 systemctl daemon-reload
111 systemctl restart weston@display.service