From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 16:40:02 2023 Received: (at submit) by debbugs.gnu.org; 29 Jun 2023 20:40:02 +0000 Received: from localhost ([127.0.0.1]:54122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEyQs-00067i-7g for submit@debbugs.gnu.org; Thu, 29 Jun 2023 16:40:02 -0400 Received: from lists.gnu.org ([209.51.188.17]:56264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEyQq-00067D-5F for submit@debbugs.gnu.org; Thu, 29 Jun 2023 16:40:00 -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 1qEyQo-00056f-A9 for guix-patches@gnu.org; Thu, 29 Jun 2023 16:39:58 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEyQm-0004LI-L3 for guix-patches@gnu.org; Thu, 29 Jun 2023 16:39:58 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id 282632054E for ; Thu, 29 Jun 2023 22:39:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 7373480097; Thu, 29 Jun 2023 22:39:53 +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 Ag4Nz5xkfqGf; Thu, 29 Jun 2023 22:39:53 +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 E980A80060; Thu, 29 Jun 2023 22:39:52 +0200 (CEST) From: Bruno Victal To: guix-patches@gnu.org Subject: [PATCH 0/4] Fix GDM and VNC tests Date: Thu, 29 Jun 2023 21:39:08 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Debbugs-CC: maxim.cournoyer@gmail.com Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.26.107.239; envelope-from=mirai@makinata.eu; helo=smtpmciv3.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) It turns out that the issue with the xvnc test was due to using invoke instead of system*. Along the way, the GDM test was refactored to replace the ugly sleep delay with a more adequate awaiting method. Bruno Victal (4): tests: xvnc: Fix test. marionette: Allow passing custom OCR arguments. tests: gdm: Prefer OCR to delay. tests: xvnc: Group up GDM test. gnu/build/marionette.scm | 34 +++++++++++++++++------- gnu/tests/gdm.scm | 19 ++++++++++---- gnu/tests/vnc.scm | 56 ++++++++++++++++++++-------------------- 3 files changed, 67 insertions(+), 42 deletions(-) base-commit: 94ac93042f09b4ba68b7b64ed1feeebd3dab1ea4 -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 16:44:33 2023 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 To: 64356@debbugs.gnu.org Subject: [PATCH 2/4] marionette: Allow passing custom OCR arguments. 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 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * 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 -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 16:44:37 2023 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 To: 64356@debbugs.gnu.org Subject: [PATCH 1/4] tests: xvnc: Fix test. 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 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/tests/vnc.scm (run-xvnc-test): Use system* instead of invoke. --- gnu/tests/vnc.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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")) base-commit: 94ac93042f09b4ba68b7b64ed1feeebd3dab1ea4 -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 16:44:40 2023 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 To: 64356@debbugs.gnu.org Subject: [PATCH 3/4] tests: gdm: Prefer OCR to delay. 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 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * 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 -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 16:44:48 2023 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 To: 64356@debbugs.gnu.org Subject: [PATCH 4/4] tests: xvnc: Group up GDM test. 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 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * 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))))) -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 17:44:41 2023 Received: (at 64356) by debbugs.gnu.org; 29 Jun 2023 21:44:41 +0000 Received: from localhost ([127.0.0.1]:54181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEzRQ-0007lZ-VA for submit@debbugs.gnu.org; Thu, 29 Jun 2023 17:44:41 -0400 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:57536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEzRK-0007l9-8V for 64356@debbugs.gnu.org; Thu, 29 Jun 2023 17:44:39 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id 08AC7207A7 for <64356@debbugs.gnu.org>; Thu, 29 Jun 2023 23:44:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 52A1B80098; Thu, 29 Jun 2023 23:44:32 +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 hoHeadQyon2f; Thu, 29 Jun 2023 23:44:32 +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 DC13D80097; Thu, 29 Jun 2023 23:44:31 +0200 (CEST) From: Bruno Victal To: 64356@debbugs.gnu.org Subject: [PATCH v2 1/4] tests: xvnc: Fix test. Date: Thu, 29 Jun 2023 22:44:26 +0100 Message-Id: <638f28ec7b3014c37f45aec82c406247309f5c2b.1688075033.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/tests/vnc.scm (run-xvnc-test): Use system* instead of invoke. --- gnu/tests/vnc.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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")) base-commit: 94ac93042f09b4ba68b7b64ed1feeebd3dab1ea4 -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 17:44:44 2023 Received: (at 64356) by debbugs.gnu.org; 29 Jun 2023 21:44:44 +0000 Received: from localhost ([127.0.0.1]:54184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEzRU-0007lm-ES for submit@debbugs.gnu.org; Thu, 29 Jun 2023 17:44:44 -0400 Received: from smtpm5.myservices.hosting ([185.26.105.236]:39690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEzRM-0007lD-5Q for 64356@debbugs.gnu.org; Thu, 29 Jun 2023 17:44:40 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm5.myservices.hosting (Postfix) with ESMTP id 683A920CF2 for <64356@debbugs.gnu.org>; Thu, 29 Jun 2023 23:44:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id BA7CF80099; Thu, 29 Jun 2023 23:44:34 +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 l_CklRwryrwW; Thu, 29 Jun 2023 23:44:34 +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 422FA80097; Thu, 29 Jun 2023 23:44:34 +0200 (CEST) From: Bruno Victal To: 64356@debbugs.gnu.org Subject: [PATCH v2 4/4] tests: xvnc: Group up GDM test. Date: Thu, 29 Jun 2023 22:44:29 +0100 Message-Id: <4786f0627d28b029a365ef9e3fad103e55d9f934.1688075033.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/tests/vnc.scm (run-xvnc-test): Group up GDM test. Use GNU Ocrad. --- gnu/tests/vnc.scm | 58 ++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/gnu/tests/vnc.scm b/gnu/tests/vnc.scm index e59972eee4..a2c3e3480e 100644 --- a/gnu/tests/vnc.scm +++ b/gnu/tests/vnc.scm @@ -104,6 +104,8 @@ (define (run-xvnc-test) (operating-system os) (memory-size 1024))) + (define ocr (file-append ocrad "/bin/ocrad")) + (define test (with-imported-modules (source-module-closure '((gnu build marionette) @@ -152,43 +154,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: 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 (cut string-contains <> "key bindings") - #:ocr #$(file-append tesseract-ocr - "/bin/tesseract") + #:ocr #$ocr + #:ocr-arguments "--scale=2" #: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 #$ocr + #:ocr-arguments "--invert"))) (test-end))))) -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 17:44:45 2023 Received: (at 64356) by debbugs.gnu.org; 29 Jun 2023 21:44:45 +0000 Received: from localhost ([127.0.0.1]:54186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEzRU-0007lo-Qc for submit@debbugs.gnu.org; Thu, 29 Jun 2023 17:44:45 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:33988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEzRL-0007lB-Bm for 64356@debbugs.gnu.org; Thu, 29 Jun 2023 17:44:40 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id 9AC762054E for <64356@debbugs.gnu.org>; Thu, 29 Jun 2023 23:44:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 02E1280099; Thu, 29 Jun 2023 23:44:34 +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 6rDMFXwZOk0P; Thu, 29 Jun 2023 23:44:33 +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 908E780097; Thu, 29 Jun 2023 23:44:33 +0200 (CEST) From: Bruno Victal To: 64356@debbugs.gnu.org Subject: [PATCH v2 3/4] tests: gdm: Prefer OCR to delay. Date: Thu, 29 Jun 2023 22:44:28 +0100 Message-Id: <88cc086aa67238867e93886ca16c86ca3a262f52.1688075033.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * 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 -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 17:44:52 2023 Received: (at 64356) by debbugs.gnu.org; 29 Jun 2023 21:44:52 +0000 Received: from localhost ([127.0.0.1]:54188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEzRc-0007mF-5j for submit@debbugs.gnu.org; Thu, 29 Jun 2023 17:44:52 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:34018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEzRU-0007lk-9u for 64356@debbugs.gnu.org; Thu, 29 Jun 2023 17:44:45 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id EF5C220559 for <64356@debbugs.gnu.org>; Thu, 29 Jun 2023 23:44:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 426BA80098; Thu, 29 Jun 2023 23:44:33 +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 aWOTvnUlYW94; Thu, 29 Jun 2023 23:44:32 +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 ADB8D80097; Thu, 29 Jun 2023 23:44:32 +0200 (CEST) From: Bruno Victal To: 64356@debbugs.gnu.org Subject: [PATCH v2 2/4] marionette: Allow passing custom OCR arguments. Date: Thu, 29 Jun 2023 22:44:27 +0100 Message-Id: <60f2dc235aed7d2cd359a565e66b9ddf6f2371db.1688075033.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * 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 -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 30 09:58:20 2023 Received: (at 64356) by debbugs.gnu.org; 30 Jun 2023 13:58:20 +0000 Received: from localhost ([127.0.0.1]:55420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEdf-0006Yu-Rs for submit@debbugs.gnu.org; Fri, 30 Jun 2023 09:58:20 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]:36734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEde-0006Yk-0i for 64356@debbugs.gnu.org; Fri, 30 Jun 2023 09:58:18 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id EA40720495 for <64356@debbugs.gnu.org>; Fri, 30 Jun 2023 15:58:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 4DF7A8009E; Fri, 30 Jun 2023 15:58:16 +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 PXeZMtuYHVOh; Fri, 30 Jun 2023 15:58:16 +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 D09C6800A0; Fri, 30 Jun 2023 15:58:15 +0200 (CEST) From: Bruno Victal To: 64356@debbugs.gnu.org Subject: [PATCH v3 1/4] tests: xvnc: Fix test. Date: Fri, 30 Jun 2023 14:58:11 +0100 Message-Id: <83fb001a7c94895302c0e78d834ec238c29f005a.1688133473.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/tests/vnc.scm (run-xvnc-test): Use system* instead of invoke. --- gnu/tests/vnc.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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")) base-commit: 8af22b493199a17f46351c2f3d9f6ee759e48564 -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 30 09:58:27 2023 Received: (at 64356) by debbugs.gnu.org; 30 Jun 2023 13:58:27 +0000 Received: from localhost ([127.0.0.1]:55424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEdn-0006ZE-4O for submit@debbugs.gnu.org; Fri, 30 Jun 2023 09:58:27 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:45772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEdl-0006Z5-2P for 64356@debbugs.gnu.org; Fri, 30 Jun 2023 09:58:25 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id 656B42026C for <64356@debbugs.gnu.org>; Fri, 30 Jun 2023 15:58:24 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id A95DD800A3; Fri, 30 Jun 2023 15:58:20 +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 m7hAwCw4SwYK; Fri, 30 Jun 2023 15:58:20 +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 2BC00800A0; Fri, 30 Jun 2023 15:58:20 +0200 (CEST) From: Bruno Victal To: 64356@debbugs.gnu.org Subject: [PATCH v3 3/4] tests: gdm: Prefer OCR to delay. Date: Fri, 30 Jun 2023 14:58:13 +0100 Message-Id: <7085d63fde78e3d15b28fba3c710b6a71a185c2f.1688133473.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * 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..06177d4080 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 -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 30 09:58:31 2023 Received: (at 64356) by debbugs.gnu.org; 30 Jun 2023 13:58:31 +0000 Received: from localhost ([127.0.0.1]:55426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEdq-0006ZT-LL for submit@debbugs.gnu.org; Fri, 30 Jun 2023 09:58:30 -0400 Received: from smtpm1.myservices.hosting ([185.26.105.232]:56998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEdm-0006ZC-Er for 64356@debbugs.gnu.org; Fri, 30 Jun 2023 09:58:27 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm1.myservices.hosting (Postfix) with ESMTP id C235120251 for <64356@debbugs.gnu.org>; Fri, 30 Jun 2023 15:58:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 29695800A4; Fri, 30 Jun 2023 15:58:22 +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 Z--bIOKy8MLc; Fri, 30 Jun 2023 15:58:21 +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 7CEA9800A0; Fri, 30 Jun 2023 15:58:21 +0200 (CEST) From: Bruno Victal To: 64356@debbugs.gnu.org Subject: [PATCH v3 4/4] tests: xvnc: Group up GDM test. Date: Fri, 30 Jun 2023 14:58:14 +0100 Message-Id: <27c51859d81c8f2e55d41efd6b02e151d7531854.1688133473.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/tests/vnc.scm (run-xvnc-test): Group up GDM test. Use GNU Ocrad. --- gnu/tests/vnc.scm | 59 +++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/gnu/tests/vnc.scm b/gnu/tests/vnc.scm index e59972eee4..40f8348db9 100644 --- a/gnu/tests/vnc.scm +++ b/gnu/tests/vnc.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2022 Maxim Cournoyer . +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -104,6 +105,8 @@ (define (run-xvnc-test) (operating-system os) (memory-size 1024))) + (define ocr (file-append ocrad "/bin/ocrad")) + (define test (with-imported-modules (source-module-closure '((gnu build marionette) @@ -152,43 +155,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: 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 (cut string-contains <> "key bindings") - #:ocr #$(file-append tesseract-ocr - "/bin/tesseract") + #:ocr #$ocr + #:ocr-arguments '("--scale=2") #: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 #$ocr + #:ocr-arguments '("--invert")))) (test-end))))) -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 30 10:07:02 2023 Received: (at 64356) by debbugs.gnu.org; 30 Jun 2023 14:07:02 +0000 Received: from localhost ([127.0.0.1]:55454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEm6-0006ox-65 for submit@debbugs.gnu.org; Fri, 30 Jun 2023 10:07:02 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]:38340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEm4-0006oY-Q3 for 64356@debbugs.gnu.org; Fri, 30 Jun 2023 10:07:01 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id ED48220515 for <64356@debbugs.gnu.org>; Fri, 30 Jun 2023 16:06:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 82AC78009C; Fri, 30 Jun 2023 15:57:16 +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 et4nt1SbXwYG; Fri, 30 Jun 2023 15:57:16 +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 030C38009B; Fri, 30 Jun 2023 15:57:15 +0200 (CEST) From: Bruno Victal To: 64356@debbugs.gnu.org Subject: [PATCH v3 0/4] Fix GDM + VNC tests Date: Fri, 30 Jun 2023 14:57:04 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Notable changes since v2: * The ocr-arguments are passed as a list of strings. Bruno Victal (4): tests: xvnc: Fix test. marionette: Allow passing custom OCR arguments. tests: gdm: Prefer OCR to delay. tests: xvnc: Group up GDM test. gnu/build/marionette.scm | 32 ++++++++++++++------ gnu/tests/gdm.scm | 19 ++++++++---- gnu/tests/vnc.scm | 63 +++++++++++++++++++++------------------- 3 files changed, 70 insertions(+), 44 deletions(-) base-commit: 8af22b493199a17f46351c2f3d9f6ee759e48564 -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 30 10:07:08 2023 Received: (at 64356) by debbugs.gnu.org; 30 Jun 2023 14:07:09 +0000 Received: from localhost ([127.0.0.1]:55457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEmC-0006pF-EK for submit@debbugs.gnu.org; Fri, 30 Jun 2023 10:07:08 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]:38360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFEmA-0006p7-B2 for 64356@debbugs.gnu.org; Fri, 30 Jun 2023 10:07:06 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id E290720515 for <64356@debbugs.gnu.org>; Fri, 30 Jun 2023 16:07:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 7A60A800A1; Fri, 30 Jun 2023 15:58:19 +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 qR-gWcte3QPE; Fri, 30 Jun 2023 15:58:18 +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 B30578009E; Fri, 30 Jun 2023 15:58:18 +0200 (CEST) From: Bruno Victal To: 64356@debbugs.gnu.org Subject: [PATCH v3 2/4] marionette: Allow passing custom OCR arguments. Date: Fri, 30 Jun 2023 14:58:12 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: Bruno Victal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/build/marionette.scm (invoke-ocrad-ocr, invoke-tesseract-ocr) (marionette-screen-text): New 'ocr-arguments' argument. --- gnu/build/marionette.scm | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index b8fba61d06..df69d6d17e 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016-2022 Ludovic Courtès ;;; Copyright © 2018 Chris Marusich ;;; Copyright © 2022 Maxim Cournoyer +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -287,23 +288,27 @@ (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 '("--invert" "--scale=10"))) "Invoke the OCRAD command on image, and return the recognized text." - (let* ((pipe (open-pipe* OPEN_READ ocrad "-i" "-s" "10" image)) + (let* ((command (string-join `(,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 ocr-arguments))) (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 +316,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 +330,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 +370,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 -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 30 23:23:25 2023 Received: (at 64356) by debbugs.gnu.org; 1 Jul 2023 03:23:25 +0000 Received: from localhost ([127.0.0.1]:56078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFRCm-00035T-Np for submit@debbugs.gnu.org; Fri, 30 Jun 2023 23:23:24 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:53505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFRCk-00035D-Mp for 64356@debbugs.gnu.org; Fri, 30 Jun 2023 23:23:23 -0400 Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-3ff24a193dbso20114331cf.3 for <64356@debbugs.gnu.org>; Fri, 30 Jun 2023 20:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688181797; x=1690773797; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=CsQwOyTC8lnRzu6Phy0iYc6mwuW2Pd6ZkzmXt/cnTR4=; b=jvy0GeNo+XolnfPZT97Ub8aT1TxqujTfRKFQgV+YNqkhu9aGHdTHNeQMG4LWx7vf3d G4TGFzOnvZ7g36cx+nHgiKk9gmeA6ppSTCq8kg1yidz4EPDaaxyGx8P/omG3rCw4HlkH HtOgP/Xx/meLZkcKQFNxZF5mpeSRVuF2OvHr3RCXn13A/Cgqx0GmWuCJU6z4t+eo4HS2 T/BKuSu8NMXIyKIUPz+D3Lc81qG3b6fBFyZPHZfKwUCL7G/QueTn5QKfVJ+wB/e1TPo/ 5qBJv6/DPRCQXzwcCcsClKfKaYJa9si34SxsbVsHT+puWzyTJU+Juth8JD3gbRLrG9s+ Igvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688181797; x=1690773797; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CsQwOyTC8lnRzu6Phy0iYc6mwuW2Pd6ZkzmXt/cnTR4=; b=bnPjUy3sZnVpDF/7njanWUCxcm1vP9GkPZTjp2/9uX3wICgAHnI/W5o40HH/gvMhXZ MUtw55acRc9fhgktIlGhobxuFkBJvgSQk2yHQgJpzFTGEG63GGNeul4jx4v8sIkbLbRo e1Haq5Z+mBbn8NtH0U6j7cxHsIbpNKzDpzdFwWvxqqrZyc/mnyYUJZYbolNxosJ9sGbY ZZgkalZtE+titfghhL9MfvpcYl/CYedEoAfVOFYhiPheSHXUVsrcQhBw7DDC/OUqHGev vidqx5MeFr6WPB3pj7LIOHNc2ieb5Srihtw7wWTMJuUnELeSrXmRgYdTRpjQqBg+SzvQ FJRw== X-Gm-Message-State: ABy/qLZCOZhKQ/rnV3wo4cTfbD2tFUnxpkl/QlB53gf/8+UciM0HjoFw bUt6WozXqcqeMUW+j5fBKXAXyhLGEiU= X-Google-Smtp-Source: ACHHUZ56Xgi0bHHPEV+2EXxq3RA4EI0Tb9uvPtOMc8nPT06gvrkIheJEPrZZs65jXzOLgUgZtyxm5w== X-Received: by 2002:a05:622a:1394:b0:400:9b81:8efc with SMTP id o20-20020a05622a139400b004009b818efcmr6064247qtk.15.1688181796760; Fri, 30 Jun 2023 20:23:16 -0700 (PDT) Received: from hurd (dsl-10-133-148.b2b2c.ca. [72.10.133.148]) by smtp.gmail.com with ESMTPSA id t2-20020ac865c2000000b003f6b58b986fsm8911252qto.41.2023.06.30.20.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 20:23:16 -0700 (PDT) From: Maxim Cournoyer To: Bruno Victal Subject: Re: [bug#64356] [PATCH 0/4] Fix GDM and VNC tests References: Date: Fri, 30 Jun 2023 23:23:15 -0400 In-Reply-To: (Bruno Victal's message of "Thu, 29 Jun 2023 21:39:08 +0100") Message-ID: <875y741fj0.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: 64356@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Bruno! Bruno Victal writes: > It turns out that the issue with the xvnc test was due to using invoke > instead of system*. > Along the way, the GDM test was refactored to replace the ugly sleep > delay with a more adequate awaiting method. > > Bruno Victal (4): > tests: xvnc: Fix test. > marionette: Allow passing custom OCR arguments. > tests: gdm: Prefer OCR to delay. > tests: xvnc: Group up GDM test. > > gnu/build/marionette.scm | 34 +++++++++++++++++------- > gnu/tests/gdm.scm | 19 ++++++++++---- > gnu/tests/vnc.scm | 56 ++++++++++++++++++++-------------------- > 3 files changed, 67 insertions(+), 42 deletions(-) So the xvnc service is not broken per se? I thought I had a black screen on GDM, when using the (xdmcp? #t) to login via the GDM screen. Maybe just a fluke in the midst of upgrades? I'll double check, and if there's indeed no issue, look deeper into this promising series! -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 19 10:44:14 2023 Received: (at 64356) by debbugs.gnu.org; 19 Jul 2023 14:44:14 +0000 Received: from localhost ([127.0.0.1]:56906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8PV-000552-Pn for submit@debbugs.gnu.org; Wed, 19 Jul 2023 10:44:14 -0400 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:57829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8PU-00054j-8L for 64356@debbugs.gnu.org; Wed, 19 Jul 2023 10:44:13 -0400 Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-76731802203so636447285a.3 for <64356@debbugs.gnu.org>; Wed, 19 Jul 2023 07:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689777846; x=1690382646; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=w0MDu8NJhBjrpiBYX0y8vyLi2v+rnLG8HAUiR+sj71Q=; b=N84BwOdBgINEooBh+sh8M0PHVNMI/+PpP8h+4B1hjUYffeKSWM6rIKPNSY9sCqxSvB AoTyc2lmsRUFXgch2p8bhMyInXYM3RV8yMaHaJ/9HZoERYcUnZfLPaoBnNkQ/YKF9f/g 0jws/WcMr1z7cCSeaS61rkYQ0xhD0YtbQ4Y85apzfQ9GijH5UW4kVFsVoj/VsahrqTUG 6e6D1xdhDOMZfWLe0fjzuCi1CO969qBJiRDuVCclt9774P077+CLh9YN/4/6UhsM0zSy 8ZRApU/3OA2rBqUs2CZJPG9Q2m6NyPhVFoLCwmf8IR5wSMR54W7hKVvHHJitYvT3N8+U tIyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689777846; x=1690382646; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=w0MDu8NJhBjrpiBYX0y8vyLi2v+rnLG8HAUiR+sj71Q=; b=jTrNADpP9vIq+r9jgw27V88An5x2lwuczH0PVR2B39OkJ7ej9weTS8dzKSVMk0iGzT 3yKNRtQQUyHllDWTyIB5mS6UDU3cu6X028BzrBo5GRWjqlPIS0iyJExHvgw744TGhUi3 PK8xND7uqZ916GqqYyd7/gcIH/Iy5nPkEgwuW1iawEmEg/ktVgnn7Ui4SZxbHQ2fNSZD AqvFP5gtGQ4YQZ9QaZJEaEuPuzwfC6Te/kr7FZ02z0nmpUZV0yiAZ06BYBzIqURlVvq6 2qAATXnu1sJjzQG1H7Kyv23USV2VGZHiklitxxAoDOmc3t9OaAiPQxcqRYtxdcAaz2wV rXVQ== X-Gm-Message-State: ABy/qLZSClRXyohz1MSGTE1iIrMmMQzaB6D9LPBCjQ5Dfyip7ZwjEaJB XrLO1TcsvV8KrOV39gH/7FKIXMc4iWw= X-Google-Smtp-Source: APBJJlHBIg3jQVXNjcczzPykm7bEOpvq7dlkpR2IwYSWvuQJNvXDWur6PejnywFlwxaUYS9fARngXw== X-Received: by 2002:a05:620a:4141:b0:767:dd55:29b1 with SMTP id k1-20020a05620a414100b00767dd5529b1mr22968882qko.64.1689777846123; Wed, 19 Jul 2023 07:44:06 -0700 (PDT) Received: from hurd (dsl-159-145.b2b2c.ca. [66.158.159.145]) by smtp.gmail.com with ESMTPSA id i5-20020a05620a074500b00767e62bcf0csm478479qki.65.2023.07.19.07.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 07:44:05 -0700 (PDT) From: Maxim Cournoyer To: Bruno Victal Subject: Re: bug#64356: [PATCH 0/4] Fix GDM and VNC tests References: <83fb001a7c94895302c0e78d834ec238c29f005a.1688133473.git.mirai@makinata.eu> Date: Wed, 19 Jul 2023 10:44:04 -0400 In-Reply-To: <83fb001a7c94895302c0e78d834ec238c29f005a.1688133473.git.mirai@makinata.eu> (Bruno Victal's message of "Fri, 30 Jun 2023 14:58:11 +0100") Message-ID: <87lefckll7.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: 64356@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Bruno Victal writes: > * gnu/tests/vnc.scm (run-xvnc-test): Use system* instead of invoke. > --- > gnu/tests/vnc.scm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > 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")) Using system* instead of invoke would silence the errors as it doesn't raise on errors. The real cause of the problem was a09c7da ("tests: Fork and exec a new Guile for the marionette REPL."), which I've fixed in 1edbadc6 ("tests: xvnc: Fix 'gdm auto-suspend is disabled' test."). Thanks for the report! -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 19 10:45:52 2023 Received: (at 64356) by debbugs.gnu.org; 19 Jul 2023 14:45:52 +0000 Received: from localhost ([127.0.0.1]:56910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8R6-00057m-81 for submit@debbugs.gnu.org; Wed, 19 Jul 2023 10:45:52 -0400 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:54672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8Qy-00057S-Qq for 64356@debbugs.gnu.org; Wed, 19 Jul 2023 10:45:51 -0400 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-765942d497fso626215885a.1 for <64356@debbugs.gnu.org>; Wed, 19 Jul 2023 07:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689777939; x=1690382739; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=qzJBzuAS67kC5D9LJ+XSKv76w6EoOb9NZXMvTNphKKs=; b=m2H2cQlxO9rSuIKJ4TqTd2sCFMGExq15m/6zJNWmfTpOjpS3WSLv6Byxpc+Dum9AMJ pLx6k0n/Hyyy8HQkEii57W7X8dQ0SrrCw/fs7SxhDTgUIyw9wDrFYDtNkG3PwOp83v2D f0E5oCZETyZhXo8Huo0XzM8LSb77poorsXo2sf+Qh8dvciHB6cmuHLl/i2gecaDn92bC JLlTtfwY06gy/5rjSpElIp1A+qfB2vZH3F04zUquqAP/6iN9AADrlJ50FrhBB4Wffn49 2qTd8KdtXkTRiXVtMumgU3hFajZTJFk/5UNokJoLVxKjiQqpn/h+xcaV1rNyhT2A5HA/ sjxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689777939; x=1690382739; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qzJBzuAS67kC5D9LJ+XSKv76w6EoOb9NZXMvTNphKKs=; b=Y09c3yp0XSAN4LwRNVTy+KAMzS3CFfGXi3nLUZVWeAH3FNYdNIPeAlI7AHSnxnU4lx 0wCGIuBtz8z26mU6pu9qS6MEAKBHqQxNhPbSs3DMPgHSlEWOnZuV9hCAXVAWqFCsNkIC DxSTuL993IeG8TSgFZgP1XH5203WgGKPRYHhqWNZSGlxGhY3wG4Q27fQNZZTYRK1q2/2 o04AevzCxTo5sQ6sG3fZl7+H0u6rDz4HPvMbeOlCyV+eBOnN2rIPzyu4PH037a69OOZK lgc4HhqbPssZxDUXS22PaGgeJQW2I3OrlEELwnPfGARwLaTRxse2tX5ldpCknXAVx0D7 lO/Q== X-Gm-Message-State: ABy/qLYtWrVjTab7A6bDcB6AZY0IuoOi6lpmEXybFlkZYKoDvZSUbaRK hirTWCfRZ8uy7BeorFj5PmcC5Nclirw= X-Google-Smtp-Source: APBJJlHujP53KoBHuF16BmRU+DbqKF8O4cz1641ZM3tUOSWTXU3Gqhu/YvzrIrhDr5hJdBMpyQJHEQ== X-Received: by 2002:a05:620a:29d3:b0:767:ba3e:b3c4 with SMTP id s19-20020a05620a29d300b00767ba3eb3c4mr26775595qkp.7.1689777938960; Wed, 19 Jul 2023 07:45:38 -0700 (PDT) Received: from hurd (dsl-159-145.b2b2c.ca. [66.158.159.145]) by smtp.gmail.com with ESMTPSA id g6-20020ae9e106000000b00767dc4c539bsm1310075qkm.44.2023.07.19.07.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 07:45:38 -0700 (PDT) From: Maxim Cournoyer To: Bruno Victal Subject: Re: bug#64356: [PATCH 0/4] Fix GDM and VNC tests References: <7085d63fde78e3d15b28fba3c710b6a71a185c2f.1688133473.git.mirai@makinata.eu> Date: Wed, 19 Jul 2023 10:45:37 -0400 In-Reply-To: <7085d63fde78e3d15b28fba3c710b6a71a185c2f.1688133473.git.mirai@makinata.eu> (Bruno Victal's message of "Fri, 30 Jun 2023 14:58:13 +0100") Message-ID: <87h6q0klim.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: 64356@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Bruno Victal writes: > * 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..06177d4080 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")))) I modified it to use #:timeout 120, to accommodate older, slow systems like mine. -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 19 10:47:50 2023 Received: (at 64356) by debbugs.gnu.org; 19 Jul 2023 14:47:50 +0000 Received: from localhost ([127.0.0.1]:56914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8Sz-0005C9-Ty for submit@debbugs.gnu.org; Wed, 19 Jul 2023 10:47:50 -0400 Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]:62876) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8Sx-0005BB-5d for 64356@debbugs.gnu.org; Wed, 19 Jul 2023 10:47:48 -0400 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-767ca28fb32so39654685a.1 for <64356@debbugs.gnu.org>; Wed, 19 Jul 2023 07:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689778061; x=1690382861; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=0v2nAyDJCx8c/oN7jY+qZVrOFwBUK9+x6Aq/9It+6UQ=; b=XkFJkypm2XFzUAr0qYyG5EUsbq8gdPsozaiFT/66v/5CpR4I/rJUrBEkKaZfvtEPlZ 9kG95ALLCZiT9ZMhXovUwALPplHhsaix/KDDZnoQJxjckmpMlaondwuPEc9JC7wtf/Ja Qot3BC8goUkiEAjyGe8p3vgkSVIIktc1GUXFtZjJyZe7BX9d9gbbyNqlcRKa48r4s5LA 69O2vrTKDMe0fh6FUrWuejAiYFnmEuCN/JW5n/qB7krNRSqCOT3+Gy4GypDlmuY5ffRK C2G83Lubxm1+cfprmovCPA6PJujEaFfl0524t1961DffuyE1uZFGlm6PvswkVSCEQ5+K MhdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689778061; x=1690382861; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0v2nAyDJCx8c/oN7jY+qZVrOFwBUK9+x6Aq/9It+6UQ=; b=Sub9PRj+nwg+cnUrh29S19UCcXvp2cUnHgZPOm3BmoA/8IWE+CPUL5k2Vkxgbg4MoN 0sW9OiiB0QRxkOarwkMzDdQH+KpSB53YMYad/jrMAZr58jY3fIuaBgu1uBl0zVCSZBGH 69fL5owE0zyzXtfHVINY0thuBoFsczeSBrufnhSHrMy/PPycL3tilSd/pTRjMkAWpobs 7t+at2DV3uzeEyiesSkzcyIKSTqAst9GZIGIEqQekkizuo0jtEQ1W3f8XqIN3czXcL3k MYb+fJAuNhW9mfSN5D+CKg9U5vWSwUkGC+FlSprI3ebvvntuLfg40OLkxHdTKYCGoavT 2JQQ== X-Gm-Message-State: ABy/qLYu4rFFT4eSMqJpQ9bY0cpi8HcTsSXLBh6j1UEJ1zadEOweBp/I kxJil4mbiFhMvrwdZKRrQhIQEMMdwRo= X-Google-Smtp-Source: APBJJlExAP0dSxf3NKxBRO9NXXV4GUpEMISs6rWrDO2ZnuWLOQX/BIsYHtGnNt1ueqIEgtcHTD21Zg== X-Received: by 2002:a05:620a:2a0b:b0:767:f116:1b92 with SMTP id o11-20020a05620a2a0b00b00767f1161b92mr2814409qkp.38.1689778061390; Wed, 19 Jul 2023 07:47:41 -0700 (PDT) Received: from hurd (dsl-159-145.b2b2c.ca. [66.158.159.145]) by smtp.gmail.com with ESMTPSA id ou30-20020a05620a621e00b0075941df3365sm1307532qkn.52.2023.07.19.07.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 07:47:41 -0700 (PDT) From: Maxim Cournoyer To: Bruno Victal Subject: Re: bug#64356: [PATCH 0/4] Fix GDM and VNC tests References: <27c51859d81c8f2e55d41efd6b02e151d7531854.1688133473.git.mirai@makinata.eu> Date: Wed, 19 Jul 2023 10:47:39 -0400 In-Reply-To: <27c51859d81c8f2e55d41efd6b02e151d7531854.1688133473.git.mirai@makinata.eu> (Bruno Victal's message of "Fri, 30 Jun 2023 14:58:14 +0100") Message-ID: <87cz0oklf8.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: 64356@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Bruno Victal writes: > * gnu/tests/vnc.scm (run-xvnc-test): Group up GDM test. Use GNU Ocrad. > --- > gnu/tests/vnc.scm | 59 +++++++++++++++++++++++++---------------------- > 1 file changed, 31 insertions(+), 28 deletions(-) > > diff --git a/gnu/tests/vnc.scm b/gnu/tests/vnc.scm > index e59972eee4..40f8348db9 100644 > --- a/gnu/tests/vnc.scm > +++ b/gnu/tests/vnc.scm > @@ -1,5 +1,6 @@ [...] > > ;; 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. I've kept most of the comment; otherwise it'd be hard to understand for a newcomer that Guix is matched from the background (e.g. when the background changes and breaks this assumption...). > + (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 #$ocr > + #:ocr-arguments '("--invert")))) I've preserved the timeout, which is important for slow systems (I added a comment). -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 19 10:50:27 2023 Received: (at 64356) by debbugs.gnu.org; 19 Jul 2023 14:50:27 +0000 Received: from localhost ([127.0.0.1]:56918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8VW-0005K3-Kf for submit@debbugs.gnu.org; Wed, 19 Jul 2023 10:50:26 -0400 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:59858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8VU-0005Jn-Rd for 64356@debbugs.gnu.org; Wed, 19 Jul 2023 10:50:25 -0400 Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-7683cdabd8fso49235085a.3 for <64356@debbugs.gnu.org>; Wed, 19 Jul 2023 07:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689778219; x=1690383019; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=eSAwPeKuYPtI/9Cg9UVyJ6rcbv7GeGc1Lud2gYxsPgU=; b=gVAzqkIuBF2tRds6R3wZbB8Ah3ffBglGxGzZoOO0rGBgIj1A1iF7XDDSf/iIFtHWjh oNb0FDyEw1bxhkihBGDRU4UkWc/HiuWccv4WaXJxXLhAMhaaLjYLWxP+/S6OyAQbhwe1 +NcNnIn1+85gSoAFMzCi1foSSLB8f4xzb++5/ivh474pr2Xdcdk+ydd6KrH/zdBRXY7/ NgCt9vzJwwMsdPLayKnX1Z9AsQdWypXxZTgnOuFil9ZZ38lkGd7sEOVCfkNiwpTRYUZI MbT1y4RguLTuEeryIlRieEFznSzJXkBh9NduAGhqFqqeP+vR+FPO3aUTHcGF2ZnD2CFl EmYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689778219; x=1690383019; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eSAwPeKuYPtI/9Cg9UVyJ6rcbv7GeGc1Lud2gYxsPgU=; b=aW9ELv0OoQwCmwZIn/dUiYRZmong/CfmDpxNWx8psK+/yJvhWRV/XTrTWnkFGLjspR PYfNAGPuxwckappqVt6vj2+j3oTJ8me3CGlXx/zltrBr4NJEqOTBj9MPdK2LhnfK6eWF gUt2e6OzLb8If+m4aobUZIws4K+BbC56mWuTbdmCA6FUqLuqdDumW01tAq9SvuV0CBlU s6S8XeGbaDWf9aN5FCiCjMiiqqhjZ81cHlM7iab5VFxkcZLeAS/LJjAlUaBasLaSRi6o LPhsl7FMQx1mUmMV6vjdBV8ZnsCFnzH/dDkNNC14Rum3mXugSVjrcY6iN/6WBKDTx9lS 8k8g== X-Gm-Message-State: ABy/qLZQv5MI/vRseflTBapLRwJ/DZEdKWczh/Bc+jkz9QBElQNzOV5J HwgdrulTdZnhKfvoX1Ehu7+BIl9pix4= X-Google-Smtp-Source: APBJJlF8KVNp8E/JzVONnqsRXj2i3hdDNblRC8ztiWW64avrnkn0m2vfABm2P+Jph7h6ZwX1JJn/Ug== X-Received: by 2002:a0c:b410:0:b0:636:955e:3dd7 with SMTP id u16-20020a0cb410000000b00636955e3dd7mr13027564qve.42.1689778218891; Wed, 19 Jul 2023 07:50:18 -0700 (PDT) Received: from hurd (dsl-159-145.b2b2c.ca. [66.158.159.145]) by smtp.gmail.com with ESMTPSA id u8-20020a0cb408000000b0061a68b5a8c4sm1512440qve.134.2023.07.19.07.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 07:50:18 -0700 (PDT) From: Maxim Cournoyer To: Bruno Victal Subject: Re: bug#64356: [PATCH 0/4] Fix GDM and VNC tests References: Date: Wed, 19 Jul 2023 10:50:17 -0400 In-Reply-To: (Bruno Victal's message of "Fri, 30 Jun 2023 14:58:12 +0100") Message-ID: <878rbcklau.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64356 Cc: 64356@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Bruno Victal writes: [...] > -(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 +330,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 Care must be taken here to avoid overwriting the default arguments of the 'invoke-ocrad-ocr' and 'invoke-tesseract-ocr' procedures. I've handled this by extracting a %default-ocrad-arguments and or'ing the argument here with it in this procedure, like: --8<---------------cut here---------------start------------->8--- @@ -324,14 +334,22 @@ (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 + (or ocr-arguments %default-ocrad-arguments)) + image)) ((string-contains ocr "tesseract") - (values (invoke-tesseract-ocr image #:tesseract ocr) image)) + (values (invoke-tesseract-ocr image + #:tesseract ocr + #:ocr-arguments (or ocr-arguments '())) + image)) (else (error "unsupported ocr command")))) (define* (wait-for-screen-text marionette predicate #:key (ocr "ocrad") --8<---------------cut here---------------end--------------->8--- Otherwise, LGTM. -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 19 10:51:01 2023 Received: (at 64356-done) by debbugs.gnu.org; 19 Jul 2023 14:51:01 +0000 Received: from localhost ([127.0.0.1]:56921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8W5-0005Ky-3O for submit@debbugs.gnu.org; Wed, 19 Jul 2023 10:51:01 -0400 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]:56342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qM8W2-0005Kj-Uh for 64356-done@debbugs.gnu.org; Wed, 19 Jul 2023 10:50:59 -0400 Received: by mail-qv1-xf2c.google.com with SMTP id 6a1803df08f44-635f1c7412cso43047456d6.0 for <64356-done@debbugs.gnu.org>; Wed, 19 Jul 2023 07:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689778253; x=1690383053; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=oqy2vI06eq7ga7k3uHUmgUf1R6U0Gr2hlGpHvXPv3c0=; b=DrF1RRfrE4+zU0E2wMCkRaOSbM9ST0TjEBrJH0zg4sbB743oFDoMQ8wouBHR1T4/jw hsXUY2Q/kJ4hTDfAP+MVCyUJSWpRqWTpVUpR7VIxHbc+4NPAeFHcCwG7qFI7W9vI0PO2 6V0TigkvBpWk0mc2OLHp4SOlIwwtxReHNYBZeBzmJj+rRmqwfIXtLsyU9oD96uMgIWir QNDm4pKDzvC7hagNNa0QiyWkpYk/T24IZpLATn3QgyYnbNG0ptwquwh5hzRFSrkpo4y2 eb/98Ri+CGJJ8pTn+Dx78Xumjf9mzCSBiMyoo60AYq+9xoD23ARXUJnERx+/mbPfM0yA 5s5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689778253; x=1690383053; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oqy2vI06eq7ga7k3uHUmgUf1R6U0Gr2hlGpHvXPv3c0=; b=YCR5yu/XHu3fVamZ1yF7XilcBfPxxNm8lXcOKFB29jv3eAvwXPWoTUqVXOSOZJXVvG KNGyNJjJdNOw+I7JFYImqpQYvdJkdzSUiWCc5oKaqkveY3IRommucVR4j21w+b1kZXMV Bc3rbe8Bm4lwTjePyIdIMfAQ75fpnJwnSV5/OcnF/S3ZC5uobnW8vPi44JHS6FlS+Gj6 zRbUlMytVm5kfeZhOHej36LWSQzXol/GxI/krrOoW3zAEFkgbw5aD4NsaN80Y8W6lSTN uXWTUBNfPigEC+jLG+JZoGqc/n9tLW/FBVdnxc3F+uJNU3t7PALD3yvWf3NsyDne36lU seNw== X-Gm-Message-State: ABy/qLYiUvVvhVsm+bJ+VYHQzt2h8D4lFhsvkUSxu9lpJfhexo/6W/N/ beKgbWzH4sWWWg7eHOC+Ry74lIBx3L0= X-Google-Smtp-Source: APBJJlGKbeD+6qL6YAK8Zd3vBvIJreynru5hdhJU0eJ1321zJkYjM0Uyi5gpdaa846WIzRRAh6/H1Q== X-Received: by 2002:a0c:f908:0:b0:635:dda5:bb8e with SMTP id v8-20020a0cf908000000b00635dda5bb8emr16910078qvn.22.1689778253136; Wed, 19 Jul 2023 07:50:53 -0700 (PDT) Received: from hurd (dsl-159-145.b2b2c.ca. [66.158.159.145]) by smtp.gmail.com with ESMTPSA id j27-20020a05620a001b00b00766fbeb3e7csm1289206qki.132.2023.07.19.07.50.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 07:50:52 -0700 (PDT) From: Maxim Cournoyer To: Bruno Victal Subject: Re: bug#64356: [PATCH 0/4] Fix GDM and VNC tests References: <875y741fj0.fsf@gmail.com> Date: Wed, 19 Jul 2023 10:50:51 -0400 In-Reply-To: <875y741fj0.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 30 Jun 2023 23:23:15 -0400") Message-ID: <874jm0kl9w.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64356-done Cc: 64356-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Maxim Cournoyer writes: > Hi Bruno! > > Bruno Victal writes: > >> It turns out that the issue with the xvnc test was due to using invoke >> instead of system*. >> Along the way, the GDM test was refactored to replace the ugly sleep >> delay with a more adequate awaiting method. >> >> Bruno Victal (4): >> tests: xvnc: Fix test. >> marionette: Allow passing custom OCR arguments. >> tests: gdm: Prefer OCR to delay. >> tests: xvnc: Group up GDM test. Applied, with some modifications mentioned in the thread. Thanks a lot! -- Maxim From unknown Tue Aug 12 08:32:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 17 Aug 2023 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator