X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=common%2Fscripts%2Fagl-screenshot-test.sh;h=01d8231db22bbc03dc85411de5a88ce68803f3ae;hb=2e5067e302bcfe08f970212f8d5c183561bf1f55;hp=70806aac23d49d7b2e32dfb3b1ba4e6f6ca053dd;hpb=3988bce81e25507409c8699f1033afc42f63b115;p=src%2Fqa-testdefinitions.git diff --git a/common/scripts/agl-screenshot-test.sh b/common/scripts/agl-screenshot-test.sh index 70806aa..01d8231 100755 --- a/common/scripts/agl-screenshot-test.sh +++ b/common/scripts/agl-screenshot-test.sh @@ -2,7 +2,13 @@ set -x -XDG_RUNTIME_DIR=/run/user/200 +export TERM=dumb +export COLUMNS=1000 + +XDG_RUNTIME_DIR=/run/user/1001 +AGLDRIVER=agl-driver + + REF_IMAGE="$1" @@ -24,14 +30,20 @@ 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 +# 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 echo "Waiting for compositor to initialize (+10sec)." @@ -68,28 +80,36 @@ fi AGL_SCREENSHOOTER=/usr/bin/agl-screenshooter +#su - $AGLDRIVER -c "..." +do_screenshot() +{ + su - $AGLDRIVER -c "XDG_RUNTIME_DIR=/run/user/1001 $AGL_SCREENSHOOTER" + return $? +} + + if [ -z "$AGL_SCREENSHOOTER" ]; then echo "Failed to find agl-screenshooter. Compositor too old?" exit 127 fi #echo "Found agl-screenshoooter in $AGL_SCREENSHOOTER" -rm -rf agl-screenshot-*.png +rm -rf /home/agl-driver/agl-screenshot-*.png # give it a bit more time to display -sleep 10 +#sleep 60 -if $AGL_SCREENSHOOTER; then +if do_screenshot ; then echo "Screenshot taken" else echo "##################################" - journalctl -b /usr/bin/agl-compositor + journalctl --no-pager -a -b /usr/bin/agl-compositor echo "##################################" exit 127 fi REF_IMAGE_SHA1SUM=`sha1sum ${REF_IMAGE} | awk -F ' ' '{print $1}'` -IMAGE_SHA1SUM=`sha1sum agl-screenshot-*.png | awk -F ' ' '{print $1}'` +IMAGE_SHA1SUM=`sha1sum /home/agl-driver/agl-screenshot-*.png | awk -F ' ' '{print $1}'` if [ "${REF_IMAGE_SHA1SUM}" == "${IMAGE_SHA1SUM}" ]; then echo "Screenshot matches the reference image" @@ -98,14 +118,12 @@ 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 + if [ -x ./artiproxy-upload.sh ];then + ./artiproxy-upload.sh $i dumpjournal + fi done echo "#########################" - cat /run/platform/display/*.log + journalctl -t agl-compositor echo "#########################" journalctl -b --no-pager -a echo "#########################" @@ -120,7 +138,8 @@ rm -rf /etc/default/homescreen systemctl daemon-reload sync sleep 2 -systemctl restart weston.service +systemctl restart agl-session@agl-driver.service + sleep 10 exit $FINALRET