Merge pull request #313298 from Moraxyc/fix-tigervnc-test

nixosTests.tigervnc: fix test
This commit is contained in:
Weijia Wang 2024-05-22 00:36:55 +02:00 committed by GitHub
commit 536826e05d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,16 +38,18 @@ makeTest {
server.succeed("Xvnc -geometry 720x576 :1 -PasswordFile vncpasswd >&2 &")
server.wait_until_succeeds("nc -z localhost 5901", timeout=10)
server.succeed("DISPLAY=:1 xwininfo -root | grep 720x576")
server.execute("DISPLAY=:1 display -size 360x200 -font sans -gravity south label:'HELLO VNC WORLD' >&2 &")
server.execute("DISPLAY=:1 display -size 360x200 -font sans -gravity south label:'HELLO VNC' >&2 &")
client.wait_for_x()
client.execute("vncviewer server:1 -PasswordFile vncpasswd >&2 &")
client.wait_for_window(r"VNC")
client.screenshot("screenshot")
text = client.get_screen_text()
# Displayed text
assert 'HELLO VNC WORLD' in text
assert 'HELLO VNC' in text
# Client window title
assert 'TigerVNC' in text
# get_screen_text can't get correct string from screenshot
# assert 'TigerVNC' in text
'';
}