summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2013-01-04 13:42:30 +0100
committerHolger Levsen <holger@layer-acht.org>2013-01-04 13:42:30 +0100
commitae9175ae2df609391c7585f2a92f24b759185245 (patch)
tree8a2ff50e0cd35697416895b6a3f0791647a8c8bb /bin
parent4e46efc0f1716171141e1b17b75b656a63079a11 (diff)
downloadjenkins.debian.net-ae9175ae2df609391c7585f2a92f24b759185245.tar.xz
g-i: fix test for image matching
Diffstat (limited to 'bin')
-rwxr-xr-xbin/g-i-installation.sh35
1 files changed, 20 insertions, 15 deletions
diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh
index 2ba2095f..b9d8b6e3 100755
--- a/bin/g-i-installation.sh
+++ b/bin/g-i-installation.sh
@@ -525,22 +525,27 @@ monitor_system() {
PRINTF_OLD=$(printf "%06d" $OLD)
# test if this screenshot is basically the same as the one 400 screenshots ago
# 400 pixels difference between to images is tolerated, to ignore updating clocks
- PIXEL=$(compare -metric AE snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm /dev/null 2>&1 || echo 100000) # FIXME: this is a broken workaround
- echo "$PIXEL pixel difference between snapshot_${PRINTF_NR}.ppm and snapshot_${PRINTF_OLD}.ppm"
- if [ $PIXEL -lt 400 ] ; then
- # unless TRIGGER_MODE is empty, matching images means its over
- if [ ! -z "$TRIGGER_MODE" ] ; then
- echo "Warning: snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm match, ending installation."
- ls -la snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm
- figlet "Installation hangs."
- break
- else
- # this is only reached once in rescue mode
- # and the next matching screenshots will cause a failure...
- TRIGGER_MODE="already_matched"
- # really kick off trigger:
- let TRIGGER_NR=NR
+ PIXEL=$(compare -metric AE snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm /dev/null 2>&1 )
+ # usually this returns an integer, but not always....
+ if [[ "$PIXEL" =~ ^[0-9]+$ ]] ; then
+ echo "$PIXEL pixel difference between snapshot_${PRINTF_NR}.ppm and snapshot_${PRINTF_OLD}.ppm"
+ if [ $PIXEL -lt 400 ] ; then
+ # unless TRIGGER_MODE is empty, matching images means its over
+ if [ ! -z "$TRIGGER_MODE" ] ; then
+ echo "Warning: snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm match, ending installation."
+ ls -la snapshot_${PRINTF_NR}.ppm snapshot_${PRINTF_OLD}.ppm
+ figlet "Installation hangs."
+ break
+ else
+ # this is only reached once in rescue mode
+ # and the next matching screenshots will cause a failure...
+ TRIGGER_MODE="already_matched"
+ # really kick off trigger:
+ let TRIGGER_NR=NR
+ fi
fi
+ else
+ echo "snapshot_${PRINTF_NR}.ppm and snapshot_${PRINTF_OLD}.ppm have different sizes."
fi
fi
# if TRIGGER_MODE matches NR, we are triggered too