diff --git a/debian/tests/compare b/debian/tests/compare index 9db5cd6..5dd3d31 100644 --- a/debian/tests/compare +++ b/debian/tests/compare @@ -12,6 +12,13 @@ sudo systemctl start xrdp # login screen. xvfb-run -l "$testdir/connect-and-capture" "$screenshot" +# Try to remove the background to leave just the login window in the image +cp -a "$screenshot" "${screenshot}.before.mogrify.png" +mogrify -fuzz 4% -define trim:percent-background=0% -trim +repage -format png "$screenshot" + +# Resize the search image to match nearly the really displayed size +convert -resize 50% /usr/share/xrdp/xrdp_logo.bmp xrdp_logo_50percent.png + # Confirm that the XRDP logo is in the log in screen (so as to confirm that the # login screen is really there). # https://stackoverflow.com/questions/31867093/how-to-search-an-image-for-subimages-using-linux-console @@ -21,7 +28,7 @@ xvfb-run -l "$testdir/connect-and-capture" "$screenshot" # will fail but we don't need to check that specifically, because so # will the if below. compare -metric RMSE -subimage-search \ - "$screenshot" /usr/share/xrdp/xrdp_logo.bmp png:"$magickout" + "$screenshot" xrdp_logo_50percent.png png:"$magickout" # In case of match, output will be like # "520,347: (255,255,255) #FFFFFF gray(255)" # in which the first field is the coordinates of the match. diff --git a/debian/tests/connect-and-capture b/debian/tests/connect-and-capture old mode 100644 new mode 100755 index 9700676..5b98fd7 --- a/debian/tests/connect-and-capture +++ b/debian/tests/connect-and-capture @@ -1,4 +1,4 @@ #!/bin/sh -xfreerdp /f /v:localhost:3389 /p: /u: /d: & +xfreerdp /f /v:localhost:3389 /p: /u: /d: /cert-tofu & sleep 12 import -window root "$1"