Add image upload to qa-testdefinition.
[src/qa-testdefinitions.git] / common / scripts / agl-screenshot-test.sh
index 84e4d85..7cbc23c 100755 (executable)
@@ -30,15 +30,19 @@ sed -i '/^\[core\]/a hide-cursor=true' /etc/xdg/weston/weston.ini
 # enable red/green/blue test screen
 echo 'HOMESCREEN_DEMO_CI=1' > /etc/default/homescreen
 sync
-systemctl daemon-reload
+systemctl daemon-reload || true
+su - agl-driver -c 'export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1001/bus" ; systemctl --user daemon-reload' || true
 sleep 2
 
 # create initial journal cursor file
 journalctl /usr/bin/agl-compositor --cursor-file=/tmp/agl-screenshot-cursor > /tmp/first-log 2>&1
 
-# restart weston@display
-#systemctl restart weston.service
-systemctl restart agl-session@agl-driver.service
+# stop homescreen (shell) and launcher
+su $AGLDRIVER -c 'XDG_RUNTIME_DIR=/run/user/1001/ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus systemctl --user stop homescreen'
+su $AGLDRIVER -c 'XDG_RUNTIME_DIR=/run/user/1001/ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus systemctl --user stop launcher'
+# restart agl-compositor
+su $AGLDRIVER -c 'XDG_RUNTIME_DIR=/run/user/1001/ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus systemctl --user restart agl-compositor'
+su $AGLDRIVER -c 'XDG_RUNTIME_DIR=/run/user/1001/ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus systemctl --user start homescreen'
 
 # e.g. qemu-system-arm takes loooong
 sleep 10
@@ -113,15 +117,13 @@ if [ "${REF_IMAGE_SHA1SUM}" == "${IMAGE_SHA1SUM}" ]; then
 else
        echo "Screenshot does not match the reference image"
        FINALRET=127
-       for i in agl-screenshot-*.png ; do
-               #set +x
-               echo "################################################################"
-               ( curl --upload-file "$i" https://transfer.sh/$(basename "$i") && echo "" ) || true
-               echo "################################################################"
-               #set -x
+       for i in /home/agl-driver/agl-screenshot-*.png ; do
+               if [ -x ./artiproxy-upload.sh ];then
+                       ./artiproxy-upload.sh $i $(basename $i)
+               fi
        done
        echo "#########################"
-       cat /run/platform/display/*.log
+       journalctl -t agl-compositor
        echo "#########################"
        journalctl -b --no-pager -a
        echo "#########################"