GNU bug report logs - #70203
[PATCH] gnu: tests: Add system tests for sddm

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Richard Sent <richard@HIDDEN>; Keywords: patch; dated Thu, 4 Apr 2024 21:29:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Apr 2024 21:28:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 04 17:28:13 2024
Received: from localhost ([127.0.0.1]:34786 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rsUd3-0006Rb-BU
	for submit <at> debbugs.gnu.org; Thu, 04 Apr 2024 17:28:13 -0400
Received: from lists.gnu.org ([2001:470:142::17]:33102)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <richard@HIDDEN>) id 1rsUcz-0006Qi-Sf
 for submit <at> debbugs.gnu.org; Thu, 04 Apr 2024 17:28:11 -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 <richard@HIDDEN>)
 id 1rsUcm-0007T2-MX
 for guix-patches@HIDDEN; Thu, 04 Apr 2024 17:27:59 -0400
Received: from mail-108-mta187.mxroute.com ([136.175.108.187])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <richard@HIDDEN>)
 id 1rsUck-0004tf-HX
 for guix-patches@HIDDEN; Thu, 04 Apr 2024 17:27:56 -0400
Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com)
 (Authenticated sender: mN4UYu2MZsgR)
 by mail-108-mta187.mxroute.com (ZoneMTA) with ESMTPSA id
 18eab02cc5e0003bea.001 for <guix-patches@HIDDEN>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 04 Apr 2024 21:27:51 +0000
X-Zone-Loop: 05de369e2236a5b70c4be1a2e1f802889961a4e4911f
X-Originating-IP: [136.175.111.2]
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:Content-Type:
 MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=k2aZ1Lsan7M3U6L0Kky2HJCONz5BYwo1iOS8Hl7qLgw=; b=bDxHHSn/BYCTe94QkGPD5XCYcd
 05njouWnWlSBoX9pxawCPnq4W0Vrs/DZ2KZd70YjF3FvZh1vqtplb3FuLgzk5itJVPcoaXXCmVWS2
 aKUDcDUk9JSPZx6L4nIGDxvbP6cSQAcIIIM+Ik/RmMrqEx4yHoBGi9HI9/pF5eqwMnfj+/QWzw2B+
 mnd9a9S5iN4n0DM4h9FSfzN4ep2OxO81/nD4QBpSOFNoLUgLPKCMRRE8sTcHbObRXF1cbdy57Wzbt
 DuXNxjeGvjeJtW1u3kPAJjCZg95QsrHBBfVh/clTpzkqQuCzRqNHaJdEvzYNHjAcoJEu8mGnQkUE5
 szKj6Y8A==;
From: Richard Sent <richard@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: tests: Add system tests for sddm
Date: Thu,  4 Apr 2024 17:21:52 -0400
Message-ID: <a6c2826b7d27b9ad5634bb64d669d4f2796f50ff.1712265713.git.richard@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Authenticated-Id: richard@HIDDEN
Received-SPF: pass client-ip=136.175.108.187;
 envelope-from=richard@HIDDEN; helo=mail-108-mta187.mxroute.com
X-Spam_score_int: -16
X-Spam_score: -1.7
X-Spam_bar: -
X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1,
 DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
Cc: Richard Sent <richard@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

* gnu/tests/sddm.scm: Create a basic suite of tests to verify the display
manager starts.

Change-Id: Ia84926e9aab42c6781430c22aae0f892387d1a29
---
Hi Guix!

Given https://issues.guix.gnu.org/70194 I figured it was prudent to
create a test suite for SDDM similar to GDM and LightDM.

I verified this on c9cd16c630, since SDDM seems to be broken since at
least 188d18fc47 (probably earlier). I imagine this should go in after
70194 is closed. Or perhaps there's something horribly wrong with my
machine and this does work on master.

Either way, the more tests the merrier, right?

 gnu/tests/sddm.scm | 112 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 112 insertions(+)
 create mode 100644 gnu/tests/sddm.scm

diff --git a/gnu/tests/sddm.scm b/gnu/tests/sddm.scm
new file mode 100644
index 0000000000..87059112ee
--- /dev/null
+++ b/gnu/tests/sddm.scm
@@ -0,0 +1,112 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2024 Richard Sent <richard@HIDDEN>.
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu tests sddm)
+  #:use-module (gnu bootloader)
+  #:use-module (gnu bootloader grub)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages ocr)
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu services)
+  #:use-module (gnu services desktop)
+  #:use-module (gnu services sddm)
+  #:use-module (gnu services xorg)
+  #:use-module (gnu system)
+  #:use-module (gnu system vm)
+  #:use-module (gnu tests)
+  #:use-module (guix gexp)
+  #:use-module (guix modules)
+  #:use-module (srfi srfi-1)
+  #:export (%test-sddm))
+
+(define %sddm-os
+  (operating-system
+    (inherit %simple-os)
+    (services
+     (cons* (service sddm-service-type)
+            (modify-services %desktop-services
+              (delete gdm-service-type))))))
+
+(define (run-sddm-test)
+  "Run tests in %SDDM-OS."
+
+  (define os (marionette-operating-system
+              %sddm-os
+              #:imported-modules (source-module-closure
+                                  '((gnu services herd)))))
+
+  (define vm (virtual-machine
+              (operating-system os)
+              ;; Test may nondeterministically fail with default memory size.
+              (memory-size 1024)))
+
+  (define test
+    (with-imported-modules (source-module-closure
+                            '((gnu build marionette)))
+      #~(begin
+          (use-modules (gnu build marionette)
+                       (srfi srfi-26)
+                       (srfi srfi-64))
+
+          (let ((marionette (make-marionette (list #$vm))))
+
+            (test-runner-current (system-test-runner #$output))
+            (test-begin "sddm")
+
+            (test-assert "service is running"
+              (marionette-eval
+               '(begin
+                  (use-modules (gnu services herd))
+                  ;; sddm's shepherd service is called xorg-server
+                  (start-service 'xorg-server))
+               marionette))
+
+            (test-assert "service can be stopped"
+              (marionette-eval
+               '(begin
+                  (use-modules (gnu services herd))
+                  (stop-service 'xorg-server))
+               marionette))
+
+            (test-assert "service can be restarted"
+              (marionette-eval
+               '(begin
+                  (use-modules (gnu services herd))
+                  (restart-service 'xorg-server))
+               marionette))
+
+            (test-assert "login screen up"
+              ;; GNU Ocrad fails to recognize any text, so use Tesseract.
+              (wait-for-screen-text marionette
+                                    ;; Login button not recognized, use SDDM's
+                                    ;; welcome message.
+                                    (cut string-contains <> (string-append "Welcome to "
+                                                                           #$(operating-system-host-name %sddm-os)))
+                                    #:ocr #$(file-append tesseract-ocr
+                                                         "/bin/tesseract")
+                                    #:timeout 60))
+
+            (test-end)))))
+
+  (gexp->derivation "sddm-test" test))
+
+(define %test-sddm
+  (system-test
+   (name "sddm")
+   (description "Basic tests for the SDDM service.")
+   (value (run-sddm-test))))

base-commit: ade6845da6cec99f3bca46faac9b2bad6877817e
-- 
2.41.0





Acknowledgement sent to Richard Sent <richard@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#70203; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 4 Apr 2024 21:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.