[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1079025: freerdp2: failing autopkgtests



On Mon, 19 Aug 2024 07:10:13 +0200 Sebastian Ramacher <sramacher@debian.org> wrote:
Source: freerdp2
Version: 2.11.7+dfsg1-2
Severity: serious
X-Debbugs-Cc: sramacher@debian.org

https://ci.debian.net/packages/f/freerdp2/testing/amd64/49289917/

 58s autopkgtest [21:09:03]: test compare: [-----------------------
 58s + screenshot=xrdp-screenshot.png
 58s + magickout=match-matrix
 58s + dirname /tmp/autopkgtest-lxc.n8yozz_a/downtmp/build.bj0/src/debian/tests/compare
 58s + testdir=/tmp/autopkgtest-lxc.n8yozz_a/downtmp/build.bj0/src/debian/tests
 58s + sudo systemctl start xrdp
 58s + xvfb-run -l /tmp/autopkgtest-lxc.n8yozz_a/downtmp/build.bj0/src/debian/tests/connect-and-capture xrdp-screenshot.png
 58s /usr/bin/xvfb-run: 184: /tmp/autopkgtest-lxc.n8yozz_a/downtmp/build.bj0/src/debian/tests/connect-and-capture: Permission denied
 58s + compare -metric RMSE -subimage-search xrdp-screenshot.png /usr/share/xrdp/xrdp_logo.bmp png:match-matrix
 58s compare-im6.q16: unable to open image `xrdp-screenshot.png': No such file or directory @ error/blob.c/OpenBlob/2967.
 58s + grep -qi #FFFFFF
 58s + convert match-matrix-1 -threshold 95% txt:
 58s convert-im6.q16: unable to open image `match-matrix-1': No such file or directory @ error/blob.c/OpenBlob/2967.
 58s convert-im6.q16: no decode delegate for this image format `' @ error/constitute.c/ReadImage/581.
 58s convert-im6.q16: no images defined `txt:' @ error/convert.c/ConvertImageCommand/3234.
 58s + printf %s\n Imagemagick did not find any occurence of the XRDP logo inside the screenshot of the remote desktop. This test therefore failed.
 58s + exit 2
 58s Imagemagick did not find any occurence of the XRDP
 58s logo inside the screenshot of the remote desktop.
 58s This test therefore failed.
 59s autopkgtest [21:09:04]: test compare: -----------------------]
 59s compare              FAIL non-zero exit status 2

The change in -2 not enough to fix the failure.

Cheers
--
Sebastian Ramacher




Dear Maintainer,
I tried to have a look and I think there are multiple issues here.

One is the connect-and-capture file is missing the execute bit,
therefore the error "Permission denied".

Second I received a interactive question "Do you trust the above certificate? (Y/T/N)".
This can be avoided by the "/cert-tofu" parameter.

Third the compare does not find the logo in the screenshot of the login screen.
I could convince imagemagick to find it by resizeing the search logo to 50%.

And the fourth issue is the size of the screenshot makes the search taking quite long.
To get the screenshot size down the screen size could be given to the
xvfb-run command (xvfb-run --server-args=-screen 0 640x480x24).
Or another imagemagick call can automatically remove the border (the "mogrify" call below).

With following modifications I think the autopkgtest should be able pass.

Kind regards,
Bernhard


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"


Reply to: