From patchwork Thu Jun 29 20:44:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 51439 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BBB3227BBEC; Thu, 29 Jun 2023 21:45:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8FD9827BBE2 for ; Thu, 29 Jun 2023 21:45:32 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEyVm-0006H5-Ry; Thu, 29 Jun 2023 16:45:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEyVi-0006Fx-Jg for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEyVi-0007VE-9t for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qEyVi-0006Ga-4P for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64356] [PATCH 1/4] tests: xvnc: Fix test. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 29 Jun 2023 20:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64356 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64356@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 64356-submit@debbugs.gnu.org id=B64356.168807147724001 (code B ref 64356); Thu, 29 Jun 2023 20:45:02 +0000 Received: (at 64356) by debbugs.gnu.org; 29 Jun 2023 20:44:37 +0000 Received: from localhost ([127.0.0.1]:54133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEyVJ-0006F3-Fi for submit@debbugs.gnu.org; Thu, 29 Jun 2023 16:44:37 -0400 Received: from smtpm1.myservices.hosting ([185.26.105.232]:33436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEyVC-0006Ea-77 for 64356@debbugs.gnu.org; Thu, 29 Jun 2023 16:44:32 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm1.myservices.hosting (Postfix) with ESMTP id 6C91E20903 for <64356@debbugs.gnu.org>; Thu, 29 Jun 2023 22:44:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 87EDD80099; Thu, 29 Jun 2023 22:44:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id BNVeyvJUnlxx; Thu, 29 Jun 2023 22:44:28 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 190EA80060; Thu, 29 Jun 2023 22:44:28 +0200 (CEST) From: Bruno Victal Date: Thu, 29 Jun 2023 21:44:19 +0100 Message-Id: <638f28ec7b3014c37f45aec82c406247309f5c2b.1688071435.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/tests/vnc.scm (run-xvnc-test): Use system* instead of invoke. --- gnu/tests/vnc.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: 94ac93042f09b4ba68b7b64ed1feeebd3dab1ea4 diff --git a/gnu/tests/vnc.scm b/gnu/tests/vnc.scm index 5c4bd43fa3..e59972eee4 100644 --- a/gnu/tests/vnc.scm +++ b/gnu/tests/vnc.scm @@ -142,11 +142,11 @@ (define (run-xvnc-test) (marionette-eval '(begin ;; Check that DCONF_PROFILE is set... - (invoke "/bin/sh" "-lc" "\ + (system* "/bin/sh" "-lc" "\ pgrep gdm | head -n1 | xargs -I{} grep -Fq DCONF_PROFILE /proc/{}/environ") ;; ... and that - (invoke "/bin/sh" "-lc" "\ + (system* "/bin/sh" "-lc" "\ sudo -E -u gdm env DCONF_PROFILE=/etc/dconf/profile/gdm dbus-run-session \ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type \ | grep -Fq nothing")) From patchwork Thu Jun 29 20:44:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 51437 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 68B6027BBE9; Thu, 29 Jun 2023 21:45:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A2ECF27BBE2 for ; Thu, 29 Jun 2023 21:45:13 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEyVl-0006GL-FY; Thu, 29 Jun 2023 16:45:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEyVi-0006Fm-1D for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEyVh-0007V5-OG for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qEyVh-0006GS-L7 for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64356] [PATCH 2/4] marionette: Allow passing custom OCR arguments. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 29 Jun 2023 20:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64356 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64356@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 64356-submit@debbugs.gnu.org id=B64356.168807147323990 (code B ref 64356); Thu, 29 Jun 2023 20:45:01 +0000 Received: (at 64356) by debbugs.gnu.org; 29 Jun 2023 20:44:33 +0000 Received: from localhost ([127.0.0.1]:54131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEyVF-0006Es-08 for submit@debbugs.gnu.org; Thu, 29 Jun 2023 16:44:33 -0400 Received: from smtpmciv5.myservices.hosting ([185.26.107.241]:58974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEyVC-0006Eb-DI for 64356@debbugs.gnu.org; Thu, 29 Jun 2023 16:44:31 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv5.myservices.hosting (Postfix) with ESMTP id 99E1120D81 for <64356@debbugs.gnu.org>; Thu, 29 Jun 2023 22:44:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id E433180060; Thu, 29 Jun 2023 22:44:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id t43YrL3atSSU; Thu, 29 Jun 2023 22:44:28 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 66A3980097; Thu, 29 Jun 2023 22:44:28 +0200 (CEST) From: Bruno Victal Date: Thu, 29 Jun 2023 21:44:20 +0100 Message-Id: <60f2dc235aed7d2cd359a565e66b9ddf6f2371db.1688071435.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/build/marionette.scm (invoke-ocrad-ocr, invoke-tesseract-ocr) (marionette-screen-text): New 'ocr-arguments' argument. --- gnu/build/marionette.scm | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index b8fba61d06..5621896198 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -287,23 +287,30 @@ (define (marionette-control command marionette) ;; The "quit" command terminates QEMU immediately, with no output. (unless (string=? command "quit") (wait-for-monitor-prompt monitor))))) -(define* (invoke-ocrad-ocr image #:key (ocrad "ocrad")) +(define* (invoke-ocrad-ocr image #:key (ocrad "ocrad") ocr-arguments) "Invoke the OCRAD command on image, and return the recognized text." - (let* ((pipe (open-pipe* OPEN_READ ocrad "-i" "-s" "10" image)) + (let* ((arguments (or ocr-arguments + "--invert --scale 10")) + (command (string-join (list ocrad ocr-arguments image))) + (pipe (open-input-pipe command)) (text (get-string-all pipe))) (unless (zero? (close-pipe pipe)) (error "'ocrad' failed" ocrad)) text)) -(define* (invoke-tesseract-ocr image #:key (tesseract "tesseract")) +(define* (invoke-tesseract-ocr image #:key (tesseract "tesseract") + ocr-arguments) "Invoke the TESSERACT command on IMAGE, and return the recognized text." (let* ((output-basename (tmpnam)) - (output-basename* (string-append output-basename ".txt"))) + (output-basename* (string-append output-basename ".txt")) + (arguments (cons* image output-basename + (or (and=> ocr-arguments list) + '())))) (dynamic-wind (const #t) (lambda () (let ((exit-val (status:exit-val - (system* tesseract image output-basename)))) + (apply system* tesseract arguments)))) (unless (zero? exit-val) (error "'tesseract' failed" tesseract)) (call-with-input-file output-basename* get-string-all))) @@ -311,7 +318,8 @@ (define* (invoke-tesseract-ocr image #:key (tesseract "tesseract")) (false-if-exception (delete-file output-basename)) (false-if-exception (delete-file output-basename*)))))) -(define* (marionette-screen-text marionette #:key (ocr "ocrad")) +(define* (marionette-screen-text marionette #:key (ocr "ocrad") + ocr-arguments) "Take a screenshot of MARIONETTE, perform optical character recognition (OCR), and return the text read from the screen as a string, along the screen dump image used. Do this by invoking OCR, which should be the file @@ -324,14 +332,19 @@ (define* (marionette-screen-text marionette #:key (ocr "ocrad")) ;; Process it via the OCR. (cond ((string-contains ocr "ocrad") - (values (invoke-ocrad-ocr image #:ocrad ocr) image)) + (values (invoke-ocrad-ocr image + #:ocrad ocr + #:ocr-arguments ocr-arguments) image)) ((string-contains ocr "tesseract") - (values (invoke-tesseract-ocr image #:tesseract ocr) image)) + (values (invoke-tesseract-ocr image + #:tesseract ocr + #:ocr-arguments ocr-arguments) image)) (else (error "unsupported ocr command")))) (define* (wait-for-screen-text marionette predicate #:key (ocr "ocrad") + ocr-arguments (timeout 30) pre-action post-action) @@ -359,7 +372,10 @@ (define* (wait-for-screen-text marionette predicate 'ocr-text: last-text 'screendump: screendump-backup)) (let* ((_ (and (procedure? pre-action) (pre-action))) - (text screendump (marionette-screen-text marionette #:ocr ocr)) + (text screendump + (marionette-screen-text marionette + #:ocr ocr + #:ocr-arguments ocr-arguments)) (_ (and (procedure? post-action) (post-action))) (result (predicate text))) (cond (result From patchwork Thu Jun 29 20:44:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 51440 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CBD9A27BBEA; Thu, 29 Jun 2023 21:45:34 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BB12227BBEA for ; Thu, 29 Jun 2023 21:45:32 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEyVn-0006HI-VQ; Thu, 29 Jun 2023 16:45:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEyVj-0006G4-39 for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEyVi-0007VQ-O8 for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qEyVi-0006Gh-KP for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64356] [PATCH 3/4] tests: gdm: Prefer OCR to delay. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 29 Jun 2023 20:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64356 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64356@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 64356-submit@debbugs.gnu.org id=B64356.168807148024018 (code B ref 64356); Thu, 29 Jun 2023 20:45:02 +0000 Received: (at 64356) by debbugs.gnu.org; 29 Jun 2023 20:44:40 +0000 Received: from localhost ([127.0.0.1]:54136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEyVL-0006FK-Pk for submit@debbugs.gnu.org; Thu, 29 Jun 2023 16:44:40 -0400 Received: from smtpm1.myservices.hosting ([185.26.105.232]:33468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEyVK-0006FA-DP for 64356@debbugs.gnu.org; Thu, 29 Jun 2023 16:44:38 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm1.myservices.hosting (Postfix) with ESMTP id F00BC201F1 for <64356@debbugs.gnu.org>; Thu, 29 Jun 2023 22:44:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 5D99380097; Thu, 29 Jun 2023 22:44:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id fdHQDeQKNcnW; Thu, 29 Jun 2023 22:44:37 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id DEAB080060; Thu, 29 Jun 2023 22:44:36 +0200 (CEST) From: Bruno Victal Date: Thu, 29 Jun 2023 21:44:21 +0100 Message-Id: <88cc086aa67238867e93886ca16c86ca3a262f52.1688071435.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/tests/gdm.scm (run-gdm-test): Use wait-for-screen-text instead of sleep. --- gnu/tests/gdm.scm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/gnu/tests/gdm.scm b/gnu/tests/gdm.scm index ec1df4b797..77163bc3e0 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 @@ (define* (run-gdm-test #:key wayland?) #~(begin (use-modules (gnu build marionette) (ice-9 format) + (srfi srfi-26) (srfi srfi-64)) (let ((marionette (make-marionette (list #$vm))) @@ -73,11 +75,18 @@ (define* (run-gdm-test #:key wayland?) (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"))) (test-equal (string-append "session-type is " expected-session-type) expected-session-type From patchwork Thu Jun 29 20:44:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 51438 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D37B227BBEA; Thu, 29 Jun 2023 21:45:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DD55A27BBE2 for ; Thu, 29 Jun 2023 21:45:23 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEyVp-0006Ho-BH; Thu, 29 Jun 2023 16:45:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEyVj-0006G5-EC for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEyVj-0007ZE-5L for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qEyVj-0006Gp-1J for guix-patches@gnu.org; Thu, 29 Jun 2023 16:45:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64356] [PATCH 4/4] tests: xvnc: Group up GDM test. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 29 Jun 2023 20:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64356 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64356@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 64356-submit@debbugs.gnu.org id=B64356.168807148824040 (code B ref 64356); Thu, 29 Jun 2023 20:45:02 +0000 Received: (at 64356) by debbugs.gnu.org; 29 Jun 2023 20:44:48 +0000 Received: from localhost ([127.0.0.1]:54139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEyVU-0006Ff-4T for submit@debbugs.gnu.org; Thu, 29 Jun 2023 16:44:48 -0400 Received: from smtpmciv5.myservices.hosting ([185.26.107.241]:59024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEyVT-0006FY-11 for 64356@debbugs.gnu.org; Thu, 29 Jun 2023 16:44:47 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv5.myservices.hosting (Postfix) with ESMTP id 923D120D6C for <64356@debbugs.gnu.org>; Thu, 29 Jun 2023 22:44:46 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 03C3A80097; Thu, 29 Jun 2023 22:44:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id g_7QZNZhQVLQ; Thu, 29 Jun 2023 22:44:45 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 7319280060; Thu, 29 Jun 2023 22:44:45 +0200 (CEST) From: Bruno Victal Date: Thu, 29 Jun 2023 21:44:22 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/tests/vnc.scm (run-xvnc-test): Group up GDM test. Use GNU Ocrad when possible. --- gnu/tests/vnc.scm | 52 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/gnu/tests/vnc.scm b/gnu/tests/vnc.scm index e59972eee4..504cb544b1 100644 --- a/gnu/tests/vnc.scm +++ b/gnu/tests/vnc.scm @@ -152,43 +152,43 @@ (define (run-xvnc-test) | grep -Fq nothing")) 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 ;; manages to access the GDM login screen (via XDMCP). - (begin - (define (ratpoison-abort) - (marionette-control "sendkey ctrl-g" marionette)) - - (define (ratpoison-help) - (marionette-control "sendkey ctrl-t" marionette) - (marionette-type "?" marionette) - (sleep 1)) ;wait for help screen to appear - - (define (ratpoison-exec command) - (marionette-control "sendkey ctrl-t" marionette) - (marionette-type "!" marionette) - (marionette-type (string-append command "\n") marionette)) - - ;; Wait until the ratpoison help screen can be displayed; this - ;; means the window manager is ready. + (define (ratpoison-abort) + (marionette-control "sendkey ctrl-g" marionette)) + + (define (ratpoison-help) + (marionette-control "sendkey ctrl-t" marionette) + (marionette-type "?" marionette) + (sleep 1)) ;wait for help screen to appear + + (define (ratpoison-exec command) + (marionette-control "sendkey ctrl-t" marionette) + (marionette-type "!" marionette) + (marionette-type (string-append command "\n") marionette)) + + ;; Wait until the ratpoison help screen can be displayed; this + ;; means the window manager is ready. + ;; XXX: GNU Ocrad 0.28 yields poor results here, use tesseract + ;; instead. + (test-assert "window manager is ready" (wait-for-screen-text marionette (cut string-contains <> "key bindings") #:ocr #$(file-append tesseract-ocr "/bin/tesseract") #:pre-action ratpoison-help - #:post-action ratpoison-abort) + #:post-action ratpoison-abort)) ;; Run vncviewer and expect the GDM login screen (accessed via ;; XDMCP). This can take a while to appear on slower machines. - (ratpoison-exec "vncviewer localhost:5905") - ;; XXX: tesseract narrowly recognizes "Guix" as "uix" from the - ;; background image; ocrad fares worst. Sadly, 'Username' is - ;; not recognized at all. + (ratpoison-exec "vncviewer localhost:5905") + + (test-assert "GDM login screen ready" (wait-for-screen-text marionette - (cut string-contains <> "uix") - #:ocr #$(file-append tesseract-ocr - "/bin/tesseract") - #:timeout 120))) + (cut string-contains <> "Guix") + #:ocr #$(file-append ocrad "/bin/ocrad") + #:ocr-arguments "--invert"))) (test-end)))))