summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Victal <mirai@makinata.eu>2023-06-30 14:58:13 +0100
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-07-19 10:38:15 -0400
commitab2abe16debaae362ea04f32d66332423d2dba1b (patch)
tree69b88ff6ad897d77baac185dbe5451bcb3889b28
parent6a86e2d13adf00688815566d176918e7d3d5216e (diff)
tests: gdm: Prefer OCR to delay.
* gnu/tests/gdm.scm (run-gdm-test): Use wait-for-screen-text instead of sleep. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
-rw-r--r--gnu/tests/gdm.scm20
1 files changed, 15 insertions, 5 deletions
diff --git a/gnu/tests/gdm.scm b/gnu/tests/gdm.scm
index ec1df4b797..6779337e09 100644
--- a/gnu/tests/gdm.scm
+++ b/gnu/tests/gdm.scm
@@ -19,6 +19,7 @@
(define-module (gnu tests gdm)
#:use-module (gnu tests)
#:use-module (gnu packages freedesktop)
+ #:use-module (gnu packages ocr)
#:use-module (gnu services)
#:use-module (gnu services desktop)
#:use-module (gnu services xorg)
@@ -57,6 +58,7 @@
#~(begin
(use-modules (gnu build marionette)
(ice-9 format)
+ (srfi srfi-26)
(srfi srfi-64))
(let ((marionette (make-marionette (list #$vm)))
@@ -73,11 +75,19 @@
(start-service 'xorg-server))
marionette))
- (test-assert "gdm ready"
- (wait-for-file "/var/run/gdm/gdm.pid" marionette))
-
- ;; waiting for gdm.pid is not enough, tests may still sporadically fail.
- (sleep 1)
+ (test-group "gdm ready"
+ (test-assert "PID file present"
+ (wait-for-file "/var/run/gdm/gdm.pid" marionette))
+
+ ;; Waiting for gdm.pid is not enough, tests may still sporadically
+ ;; fail; ensure that the login screen is up.
+ ;; XXX: GNU Ocrad works but with '--invert' only.
+ (test-assert "login screen up"
+ (wait-for-screen-text marionette
+ (cut string-contains <> "Guix")
+ #:ocr #$(file-append ocrad "/bin/ocrad")
+ #:ocr-arguments '("--invert")
+ #:timeout 120))) ;for slow systems
(test-equal (string-append "session-type is " expected-session-type)
expected-session-type