summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2014-04-24 18:27:40 +0200
committerHolger Levsen <holger@layer-acht.org>2014-04-24 18:27:40 +0200
commit9160fba574bfad087620b65fd533d4ced47ce62f (patch)
tree39fafa83afa4b45bd60b61a66eb05686ccc956ad /bin
parentd14763e375b9f165c18e1f441644ae26ae2f192c (diff)
downloadjenkins.debian.net-9160fba574bfad087620b65fd533d4ced47ce62f.tar.xz
g-i: retry if screenshot cannot be taken
Diffstat (limited to 'bin')
-rwxr-xr-xbin/g-i-installation.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh
index 779dc964..32a552cd 100755
--- a/bin/g-i-installation.sh
+++ b/bin/g-i-installation.sh
@@ -782,7 +782,7 @@ monitor_system() {
TIMEOUT=$3
fi
cd $RESULTS
- sleep 4
+ sleep 4 # chosen by fair dice roll
hourlimit=16 # hours
echo "Taking screenshots every 2 seconds now, until qemu ends for whatever reasons or $hourlimit hours have passed or if the test seems to hang."
echo
@@ -802,19 +802,21 @@ monitor_system() {
convert $CONVERTOPTS snapshot_${PRINTF_NR}.jpg snapshot_${PRINTF_NR}.ppm
rm snapshot_${PRINTF_NR}.jpg
else
- echo "could not take vncsnapshot from $DISPLAY"
+ echo "could not take vncsnapshot from $DISPLAY, lets try again..."
+ let NR=NR-1
+ PRINTF_NR=$(printf "%06d" $NR)
fi
# give signal we are still running
if [ $(($NR % 14)) -eq 0 ] ; then
echo "$PRINTF_NR: $(date)"
fi
if [ $(($NR % 100)) -eq 0 ] ; then
- # press ctrl-key to avoid screensaver kicking in
+ # press ctrl-key regularily to avoid screensaver kicking in
vncdo -s $DISPLAY key ctrl || true
- # take a screenshot for later publishing
+ # preserve a screenshot for later publishing
backup_screenshot
#
- # search for known text ocr of screenshot and break out of this loop if certain content is found
+ # search for known text using ocr of screenshot and break out of this loop if certain content is found
#
GOCR=$(mktemp)
gocr snapshot_${PRINTF_NR}.ppm > $GOCR
@@ -902,7 +904,7 @@ monitor_system() {
let NR=NR-1
PRINTF_NR=$(printf "%06d" $NR)
fi
- cp snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_NR}.ppm.bak
+ backup_screenshot
}
save_logs() {