From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GA6bOZeqiGPuawAAbAwnHQ (envelope-from ) for ; Thu, 01 Dec 2022 14:22:32 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uIDPOJeqiGPyfQEAG6o9tA (envelope-from ) for ; Thu, 01 Dec 2022 14:22:31 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2667BBAB8 for ; Thu, 1 Dec 2022 14:22:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0jVu-0001I8-VA; Thu, 01 Dec 2022 08:22:07 -0500 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 1p0jVs-0001Hf-2R for guix-patches@gnu.org; Thu, 01 Dec 2022 08:22:05 -0500 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 1p0jVr-0003FP-R4 for guix-patches@gnu.org; Thu, 01 Dec 2022 08:22:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p0jVq-0002xU-HN for guix-patches@gnu.org; Thu, 01 Dec 2022 08:22:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59739] [PATCH] tests: Add gdm test. Resent-From: mirai@makinata.eu Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 01 Dec 2022 13:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59739 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59739@debbugs.gnu.org Cc: Bruno Victal X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166990089511362 (code B ref -1); Thu, 01 Dec 2022 13:22:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Dec 2022 13:21:35 +0000 Received: from localhost ([127.0.0.1]:39653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0jVP-0002xC-6H for submit@debbugs.gnu.org; Thu, 01 Dec 2022 08:21:35 -0500 Received: from lists.gnu.org ([209.51.188.17]:40386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0jVM-0002x5-IU for submit@debbugs.gnu.org; Thu, 01 Dec 2022 08:21:33 -0500 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 1p0jVM-00013e-DU for guix-patches@gnu.org; Thu, 01 Dec 2022 08:21:32 -0500 Received: from smtpm1.myservices.hosting ([185.26.105.232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p0jVK-00036r-CP for guix-patches@gnu.org; Thu, 01 Dec 2022 08:21:32 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpm1.myservices.hosting (Postfix) with ESMTP id C5E1A2098C for ; Thu, 1 Dec 2022 14:21:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 7DEE280099; Thu, 1 Dec 2022 14:21:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id OXuNKBbfhcef; Thu, 1 Dec 2022 14:21:11 +0100 (CET) Received: from guix-nuc.home.arpa (bl12-93-156.dsl.telepac.pt [85.245.93.156]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id CE8FD80098; Thu, 1 Dec 2022 14:21:10 +0100 (CET) From: mirai@makinata.eu Date: Thu, 1 Dec 2022 13:20:51 +0000 Message-Id: <3d4b9857d25b823a7fe2cc0d3fc635b3e8ae88ba.1669900368.git.mirai@makinata.eu> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.26.105.232; envelope-from=mirai@makinata.eu; helo=smtpm1.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 autolearn=ham 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669900951; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=QXRwcfa6Z80aBt8muM3wYH4d0+j5vd18YWjfzMIDk6Q=; b=NXxJCqQbtW/4fncNM0ZVTdvu6CuJYKrmbKcT4INb3wWB43heBxZKfV5/Ke/cI2B2HI4XoE nQHTYcGuO7tHfmBe2OtfOJzNAGohUvDsoQw4vJGx5gp68mmk1TaUKd2LTgjXruwaEnNpNe sAuEocDRril3cO6VQpofsHZUgXYTLQKiJU0/88kVKS+Lu+XrM/WTeBvpPRaZ3yQVhCSj/8 YNDdhzk3bkzZLNaLHWLdWQneb2xWPa+/4OuwPzo5B81Lr4hkNjCaA13woGPNq8H2q3YLAu D6uEk49MT/Id50en2aCl0PZGjdJtfQr9RNWnWbeyfwcELMM/62Adiv7mQGTYlw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669900951; a=rsa-sha256; cv=none; b=oS2hbaE66O+ue5VaLHtNN8ZcruHlkc73LTD+0a4OY0EtkmITL3KagQMVMTfUsj6a5sWLyG WWafHNJ+Bf7FUPCf1i6ean0mwE7wgHGjqydKxA518yqkDhXoukJJJKkhvf1ndYMEJY7Js0 dM9gjvzlH5pchf4pHA5IfQesbBw3xFl70J5a6LYDO/29kCrl98HTSqj0hE7TMkBvBFlqGH mD+f5k4fSrCiM+mZKq0sNWdxHlMZoRuhi8shadd6EyvFJPrUeGkXyxLHTmsBXd8PGmcNXJ bZVTCf2BzaBxPo5Smy1kTe4+sUG5R0MhdTECfq2dNarR3V/pCdOZ+oTZWx6F0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.96 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 2667BBAB8 X-Spam-Score: -2.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: /mxjeQzevbxi From: Bruno Victal * gnu/tests/gdm.scm: New file. * gnu/local.mk: Register it. --- Small test suite for investigating the issue 57589 (https://issues.guix.gnu.org/57589) basing on the hint at reply #6. gnu/local.mk | 1 + gnu/tests/gdm.scm | 126 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 gnu/tests/gdm.scm diff --git a/gnu/local.mk b/gnu/local.mk index 379e600b06..be6870b469 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -759,6 +759,7 @@ GNU_SYSTEM_MODULES = \ %D%/tests/docker.scm \ %D%/tests/file-sharing.scm \ %D%/tests/ganeti.scm \ + %D%/tests/gdm.scm \ %D%/tests/guix.scm \ %D%/tests/monitoring.scm \ %D%/tests/nfs.scm \ diff --git a/gnu/tests/gdm.scm b/gnu/tests/gdm.scm new file mode 100644 index 0000000000..137e70544e --- /dev/null +++ b/gnu/tests/gdm.scm @@ -0,0 +1,126 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Bruno Victal . +;;; +;;; 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 gdm) + #:use-module (gnu tests) + #:use-module (gnu packages freedesktop) + #:use-module (gnu services) + #:use-module (gnu services desktop) + #:use-module (gnu services xorg) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system vm) + #:use-module (guix gexp) + #:use-module (ice-9 format) + #:export (%test-gdm-x11 + %test-gdm-wayland + %test-gdm-wayland-tmpfs)) + +(define* (make-os #:key wayland? tmp-tmpfs?) + (operating-system + (inherit %simple-os) + (services + (modify-services %desktop-services + (gdm-service-type config => (gdm-configuration + (inherit config) + (wayland? wayland?))))) + (file-systems (if tmp-tmpfs? (cons (file-system + (mount-point "/tmp") + (device "none") + (type "tmpfs") + (flags '(no-dev no-suid)) + (check? #f)) + %base-file-systems) + %base-file-systems)))) + +(define* (run-gdm-test #:key wayland? tmp-tmpfs?) + "Run tests in a vm which has gdm running." + (define os + (marionette-operating-system + (make-os #:wayland? wayland? #:tmp-tmpfs? tmp-tmpfs?) + #:imported-modules '((gnu services herd)))) + + (define vm + (virtual-machine + (operating-system os) + (memory-size 1024))) + + (define name (format #f "gdm-~:[x11~;wayland~]~:[~;-tmpfs~]" wayland? tmp-tmpfs?)) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (gnu build marionette) + (ice-9 format) + (srfi srfi-64)) + + (let* ((marionette (make-marionette (list #$vm))) + (expected-session-type #$(if wayland? "wayland" "x11"))) + + (test-runner-current (system-test-runner #$output)) + (test-begin #$name) + + ;; service for gdm is called xorg-server + (test-assert "service is running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'xorg-server)) + marionette)) + + (test-assert "gdm ready" + (wait-for-file "/var/run/gdm/gdm.pid" marionette)) + + (test-equal (string-append "session-type is " expected-session-type) + expected-session-type + (marionette-eval + '(begin + (use-modules (ice-9 popen) + (ice-9 rdelim)) + + (let* ((loginctl #$(file-append elogind "/bin/loginctl")) + (get-session-cmd (string-join `(,loginctl "show-user" "gdm" + "--property Display" "--value"))) + (session (call-with-port (open-input-pipe get-session-cmd) read-line)) + (get-type-cmd (string-join `(,loginctl "show-session" ,session + "--property Type" "--value"))) + (type (call-with-port (open-input-pipe get-type-cmd) read-line))) + type)) + marionette)) + + (test-end))))) + + (gexp->derivation (string-append name "-test") test)) + +(define %test-gdm-x11 + (system-test + (name "gdm") + (description "Basic tests for the GDM service. (X11)") + (value (run-gdm-test)))) + +(define %test-gdm-wayland + (system-test + (name "gdm") + (description "Basic tests for the GDM service. (Wayland)") + (value (run-gdm-test #:wayland? #t)))) + +(define %test-gdm-wayland-tmpfs + (system-test + (name "gdm") + (description "Basic tests for the GDM service. (Wayland, /tmp as tmpfs)") + (value (run-gdm-test #:wayland? #t #:tmp-tmpfs? #t)))) base-commit: a712c07d6ada1160855c583556e854ccb48c47e1 -- 2.38.1