aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>2021-12-21 23:10:22 +0100
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2021-12-21 23:51:09 +0100
commite37a0075c86c57f7d6a06c8bb8c0edc8b83ee98c (patch)
tree057a09b896310fbe20215a03cfa13fb098fa41f5
parenta398365cd04fa9edc7fa10db43e51614ceca44f1 (diff)
Update the restart command and adapt to the user session. Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> Change-Id: I92ee001ded6d49e83078ce13e31e29cebe69d967
-rwxr-xr-xcommon/scripts/agl-screenshot-test.sh31
1 files changed, 24 insertions, 7 deletions
diff --git a/common/scripts/agl-screenshot-test.sh b/common/scripts/agl-screenshot-test.sh
index 099b69e..84e4d85 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"
@@ -31,7 +37,9 @@ sleep 2
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 weston.service
+systemctl restart agl-session@agl-driver.service
+
# e.g. qemu-system-arm takes loooong
sleep 10
echo "Waiting for compositor to initialize (+10sec)."
@@ -68,18 +76,26 @@ 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 60
+#sleep 60
-if $AGL_SCREENSHOOTER; then
+if do_screenshot ; then
echo "Screenshot taken"
else
echo "##################################"
@@ -89,7 +105,7 @@ else
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"
@@ -120,7 +136,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