#!/bin/bash NAME=$1 LANGUAGE=$2 VERSION=$3 VBoxHeadless -s $NAME & sleep 4 VBoxManage controlvm $NAME keyboardputscancode 50 D0 while true; do VBoxManage controlvm $NAME keyboardputscancode 50 D0 sleep 0.5 VBoxManage controlvm testeando screenshotpng test.png diff=$(compare -metric AE -fuzz 5% test.png /usr/share/ltp/rsrc/$VERSION/$LANGUAGE.png output 2>&1) if [ "$diff" = "0" ]; then break fi done rm test.png rm output VBoxManage controlvm $NAME keyboardputscancode 1C 9C VBoxManage controlvm testeando screenshotpng original.png while true; do VBoxManage controlvm $NAME keyboardputscancode 50 D0 sleep 0.5 VBoxManage controlvm testeando screenshotpng new_screenshot.png diff=$(compare -metric AE -fuzz 5% test.png original.png output 2>&1) if [ "$diff" = "0" ]; then break fi mv new_screenshot.png original.png done VBoxManage controlvm $NAME keyboardputscancode 1C 9C rm new_screenshot.png original.png output