From patchwork Thu Apr 4 21:21:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Sent X-Patchwork-Id: 62721 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 EE5FD27BBEA; Thu, 4 Apr 2024 22:29:20 +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.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1B45227BBE2 for ; Thu, 4 Apr 2024 22:29:17 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rsUdo-0007cO-VI; Thu, 04 Apr 2024 17:29: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 1rsUdn-0007cB-NO for guix-patches@gnu.org; Thu, 04 Apr 2024 17:28:59 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rsUdm-00050c-Uc for guix-patches@gnu.org; Thu, 04 Apr 2024 17:28:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rsUdr-0006Xk-V5 for guix-patches@gnu.org; Thu, 04 Apr 2024 17:29:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70203] [PATCH] gnu: tests: Add system tests for sddm Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 04 Apr 2024 21:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70203 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70203@debbugs.gnu.org Cc: Richard Sent X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171226609324780 (code B ref -1); Thu, 04 Apr 2024 21:29:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Apr 2024 21:28:13 +0000 Received: from localhost ([127.0.0.1]:34786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsUd3-0006Rb-BU for submit@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 ) id 1rsUcz-0006Qi-Sf for submit@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 ) id 1rsUcm-0007T2-MX for guix-patches@gnu.org; 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 ) id 1rsUck-0004tf-HX for guix-patches@gnu.org; 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 (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 Date: Thu, 4 Apr 2024 17:21:52 -0400 Message-ID: MIME-Version: 1.0 X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.187; envelope-from=richard@freakingpenguin.com; 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-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/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 base-commit: ade6845da6cec99f3bca46faac9b2bad6877817e 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 . +;;; +;;; 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 . + +(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))))