From patchwork Fri Jun 30 13:58:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 51458 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 99A3D27BBE2; Fri, 30 Jun 2023 14:59:28 +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 6B28727BBEB for ; Fri, 30 Jun 2023 14:59:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFEeR-0000SU-Gq; Fri, 30 Jun 2023 09:59:07 -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 1qFEeN-0000E0-Dq for guix-patches@gnu.org; Fri, 30 Jun 2023 09:59: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 1qFEeN-0003VL-2n for guix-patches@gnu.org; Fri, 30 Jun 2023 09:59:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qFEeM-0006aT-VR for guix-patches@gnu.org; Fri, 30 Jun 2023 09:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64356] [PATCH v3 4/4] tests: xvnc: Group up GDM test. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 30 Jun 2023 13:59: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.168813351125269 (code B ref 64356); Fri, 30 Jun 2023 13:59:02 +0000 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 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 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. --- 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)))))