tests: xvnc: Group up GDM test and use GNU Ocrad instead of Tesseract.
* gnu/tests/vnc.scm (run-xvnc-test): Group up GDM test. Use GNU Ocrad. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
parent
ab2abe16de
commit
9542429299
@ -1,5 +1,6 @@
|
|||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>.
|
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>.
|
||||||
|
;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
@ -104,6 +105,8 @@
|
|||||||
(operating-system os)
|
(operating-system os)
|
||||||
(memory-size 1024)))
|
(memory-size 1024)))
|
||||||
|
|
||||||
|
(define ocr (file-append ocrad "/bin/ocrad"))
|
||||||
|
|
||||||
(define test
|
(define test
|
||||||
(with-imported-modules (source-module-closure
|
(with-imported-modules (source-module-closure
|
||||||
'((gnu build marionette)
|
'((gnu build marionette)
|
||||||
@ -152,10 +155,9 @@ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type \
|
|||||||
| grep -Fq nothing"))
|
| grep -Fq nothing"))
|
||||||
marionette))
|
marionette))
|
||||||
|
|
||||||
(test-assert "vnc lands on the gdm login screen"
|
(test-group "vnc lands on the gdm login screen"
|
||||||
;; This test runs vncviewer on the local VM and verifies that it
|
;; This test runs vncviewer on the local VM and verifies that it
|
||||||
;; manages to access the GDM login screen (via XDMCP).
|
;; manages to access the GDM login screen (via XDMCP).
|
||||||
(begin
|
|
||||||
(define (ratpoison-abort)
|
(define (ratpoison-abort)
|
||||||
(marionette-control "sendkey ctrl-g" marionette))
|
(marionette-control "sendkey ctrl-g" marionette))
|
||||||
|
|
||||||
@ -171,24 +173,30 @@ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type \
|
|||||||
|
|
||||||
;; Wait until the ratpoison help screen can be displayed; this
|
;; Wait until the ratpoison help screen can be displayed; this
|
||||||
;; means the window manager is ready.
|
;; means the window manager is ready.
|
||||||
|
;; XXX: The letters are half of the height preferred by
|
||||||
|
;; GNU Ocrad, scale it by 2.
|
||||||
|
(test-assert "window manager is ready"
|
||||||
(wait-for-screen-text marionette
|
(wait-for-screen-text marionette
|
||||||
(cut string-contains <> "key bindings")
|
(cut string-contains <> "key bindings")
|
||||||
#:ocr #$(file-append tesseract-ocr
|
#:ocr #$ocr
|
||||||
"/bin/tesseract")
|
#:ocr-arguments '("--scale=2")
|
||||||
#:pre-action ratpoison-help
|
#:pre-action ratpoison-help
|
||||||
#:post-action ratpoison-abort)
|
#:post-action ratpoison-abort))
|
||||||
|
|
||||||
;; Run vncviewer and expect the GDM login screen (accessed via
|
;; Run vncviewer and expect the GDM login screen (accessed via
|
||||||
;; XDMCP). This can take a while to appear on slower machines.
|
;; XDMCP). This can take a while to appear on slower machines.
|
||||||
(ratpoison-exec "vncviewer localhost:5905")
|
(ratpoison-exec "vncviewer localhost:5905")
|
||||||
;; XXX: tesseract narrowly recognizes "Guix" as "uix" from the
|
|
||||||
;; background image; ocrad fares worst. Sadly, 'Username' is
|
(test-assert "GDM login screen ready"
|
||||||
;; not recognized at all.
|
;; XXX: The '--invert' argument as the sole option to GNU
|
||||||
|
;; Ocrad is required for it to recognize "Guix" from the
|
||||||
|
;; background image. 'Username' from the UI would be a better
|
||||||
|
;; choice but is not recognized at all.
|
||||||
(wait-for-screen-text marionette
|
(wait-for-screen-text marionette
|
||||||
(cut string-contains <> "uix")
|
(cut string-contains <> "Guix")
|
||||||
#:ocr #$(file-append tesseract-ocr
|
#:ocr #$ocr
|
||||||
"/bin/tesseract")
|
#:ocr-arguments '("--invert")
|
||||||
#:timeout 120)))
|
#:timeout 120))) ;for slow systems
|
||||||
|
|
||||||
(test-end)))))
|
(test-end)))))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user