aboutsummaryrefslogtreecommitdiff
path: root/gnu/tests/desktop.scm
blob: 57069c0edee54277c3f542a836f07f92b3f7bd2b (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017, 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; 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 desktop)
  #:use-module (gnu tests)
  #:use-module (gnu services)
  #:use-module (gnu services dbus)
  #:use-module (gnu services desktop)
  #:use-module (gnu system vm)
  #:use-module (guix gexp)
  #:use-module (srfi srfi-1)
  #:export (%test-elogind))


;;;
;;; Elogind.
;;;

(define (run-elogind-test vm)
  (define test
    (with-imported-modules '((gnu build marionette)
                             (guix build syscalls))
      #~(begin
          (use-modules (gnu build marionette)
                       (guix build syscalls)
                       (srfi srfi-64))

          (define marionette
            (make-marionette '(#$vm)))

          (test-runner-current (system-test-runner #$output))
          (test-begin "elogind")

          ;; Log in as root on tty1, and check what 'loginctl' returns.
          (test-equal "login on tty1"
            '(("c1" "0" "root" "seat0" "tty1")      ;session
              ("seat0")                             ;seat
              ("0" "root"))                         ;user

            (begin
              ;; Wait for tty1.
              (marionette-eval
               '(begin
                  (use-modules (gnu services herd))
                  (start-service 'term-tty1))
               marionette)
              (marionette-control "sendkey ctrl-alt-f1" marionette)

              ;; Now we can type.
              (marionette-type "root\n" marionette)
              (marionette-type "loginctl list-users --no-legend > users\n"
                               marionette)
              (marionette-type "loginctl list-seats --no-legend > seats\n"
                               marionette)
              (marionette-type "loginctl list-sessions --no-legend > sessions\n"
                               marionette)


              ;; Read the three files.
              (marionette-eval '(use-modules (rnrs io ports)) marionette)
              (let ((guest-file (lambda (file)
                                  (string-tokenize
                                   (wait-for-file file marionette
                                                  #:read 'get-string-all)))))
                (list (guest-file "/root/sessions")
                      (guest-file "/root/seats")
                      (guest-file "/root/users")))))

          (test-end))))

  (gexp->derivation "elogind" test))

(define %test-elogind
  (system-test
   (name "elogind")
   (description
    "Test whether we can log in when elogind is enabled, and whether
'loginctl' reports accurate user, session, and seat information.")
   (value
    (let ((os (marionette-operating-system
               (simple-operating-system
                (service elogind-service-type)
                (service polkit-service-type)
                (service dbus-root-service-type))
               #:imported-modules '((gnu services herd)
                                    (guix combinators)))))
      (run-elogind-test (virtual-machine os))))))
.scm: Consolidate copyright lines with the same email address. * gnu/packages/code.scm: Likewise. * gnu/packages/cpp.scm: Likewise. * gnu/packages/databases.scm: Likewise. * gnu/packages/emacs-xyz.scm: Likewise. * gnu/packages/file.scm: Likewise. * gnu/packages/freedesktop.scm: Likewise. * gnu/packages/gl.scm: Likewise. * gnu/packages/gps.scm: Likewise. * gnu/packages/linux.scm: Likewise. * gnu/packages/networking.scm: Likewise. * gnu/packages/python-xyz.scm: Likewise. * gnu/packages/python.scm: Likewise. * gnu/packages/video.scm: Likewise. * gnu/packages/xdisorg.scm: Likewise. * gnu/services/web.scm: Likewise. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Greg Hogan 2021-09-07Merge branch 'master' into core-updates-frozenLudovic Courtès 2021-09-04gnu: libglvnd: Update to 1.3.4....* gnu/packages/gl.scm (libglvnd): Update to 1.3.4. [arguments]: Don't return #t from phases. Tobias Geerinckx-Rice 2021-08-09gnu: mesa: Build with swrast vulkan drivers for powerpc....* gnu/packages/gl.scm (mesa)[arguments]: Adjust configure-flags to add swrast vulkan drivers for powerpc- and powerpc64le-linux. Efraim Flashner 2021-08-09gnu: mesa: Skip additional test on powerpc-linux....* gnu/packages/gl.scm (mesa)[arguments]: Add another substitution for powerpc-linux to custom 'disable-failing-test phase. Efraim Flashner 2021-08-09gnu: mesa: Fix architecture matching when disabling tests....* gnu/packages/gl.scm (mesa)[arguments]: Adjust architecture names in custom 'disable-failing-test phase. Efraim Flashner 2021-08-05gnu: mesa: Build more vulkan drivers on aarch64-linux....* gnu/packages/gl.scm (mesa)[arguments]: Adjust the configure-flags to also build vulkan drivers on aarch64-linux for broadcom and swrast. Efraim Flashner 2021-08-05gnu: mesa: Fix building on aarch64-linux....* gnu/packages/gl.scm (mesa)[arguments]: Adjust custom 'disable-failing-test phase to skip test failing on aarch64-linux. Efraim Flashner 2021-08-03gnu: mesa-opencl, mesa-opencl-icd: Build all the LLVM targets again....Reported by John Kehayias <john.kehayias@protonmail.com> in <https://issues.guix.gnu.org/49794>. * gnu/packages/patches/mesa-opencl-all-targets.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/gl.scm (mesa-opencl)[source]: Use it. Ludovic Courtès 2021-07-31gnu: mesa: Update to 21.1.6....* gnu/packages/gl.scm (mesa): Update to 21.1.6. * gnu/packages/patches/mesa-skip-tests.patch: Remove cache_test.c as it is no longer needed (test passes). Signed-off-by: Ludovic Courtès <ludo@gnu.org> John Kehayias 2021-07-29Merge branch 'master' into core-updates-frozen... Conflicts: gnu/packages/bioinformatics.scm gnu/packages/cmake.scm gnu/packages/curl.scm gnu/packages/emacs-xyz.scm gnu/packages/gpodder.scm gnu/packages/music.scm gnu/packages/patches/glibc-bootstrap-system.patch gnu/packages/python-xyz.scm gnu/packages/shells.scm gnu/packages/statistics.scm Marius Bakke 2021-07-27gnu: mesa-opencl-icd: Use absolute path for the library....* gnu/packages/gl.scm (mesa-opencl-icd): Use absolute path for OpenCL platform library in "mesa.icd" file. With this patch setting LD_LIBRARY_PATH=$LIBRARY_PATH is no longer needed to run OpenCL applications. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Ivan Gankevich 2021-05-24gnu: mesa: Unify custom phases....* gnu/packages/gl.scm (mesa)[arguments]: Rewrite custom 'disable-failing-test phases to be one joint phase. Adjust 'split-outputs phase to simplify. Efraim Flashner 2021-05-23gnu: mesa: Add support for powerpc-linux....* gnu/packages/gl.scm (mesa)[inputs]: Add llvm, glslang for powerpc. [arguments]: Customize the configure flags for powerpc. Add powerpc specific phase to skip failing tests. Efraim Flashner 2021-05-13gnu: freeglut: Fix build with GCC 10....* gnu/packages/patches/freeglut-gcc-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/gl.scm (freeglut)[source](patches): New field. Marius Bakke 2021-05-09Merge branch 'master' into core-updates... Conflicts: gnu/local.mk gnu/packages/bioinformatics.scm gnu/packages/django.scm gnu/packages/gtk.scm gnu/packages/llvm.scm gnu/packages/python-web.scm gnu/packages/python.scm gnu/packages/tex.scm guix/build-system/asdf.scm guix/build/emacs-build-system.scm guix/profiles.scm Marius Bakke 2021-05-01gnu: libglvnd: Update to 1.3.3....* gnu/packages/gl.scm (libglvnd): Update to 1.3.3. Tobias Geerinckx-Rice 2021-04-18gnu: mesa: Build with llvm support....* gnu/packages/gl.scm (mesa)[inputs]: Build with llvm on aarch64-linux. [native-inputs]: Build with glslang on aarch64-linux. [arguments]: In configure-flags specify the vulkan-drivers for aarch64, enable the vulkan-overlay-layer and explicitly build with llvm. In the 'split-outputs phase also move the vulkan-specific binaries to the 'bin output on aarch64-linux. Efraim Flashner 2021-04-16Merge remote-tracking branch 'origin/master' into core-updates... Conflicts: gnu/local.mk gnu/packages/boost.scm gnu/packages/chez.scm gnu/packages/compression.scm gnu/packages/crates-io.scm gnu/packages/docbook.scm gnu/packages/engineering.scm gnu/packages/gcc.scm gnu/packages/gl.scm gnu/packages/gtk.scm gnu/packages/nettle.scm gnu/packages/python-check.scm gnu/packages/python-xyz.scm gnu/packages/radio.scm gnu/packages/rust.scm gnu/packages/sqlite.scm guix/build-system/node.scm Efraim Flashner 2021-04-15gnu: mesa: Add powerpc64le-linux support....* gnu/packages/gl.scm (mesa)[inputs]: Add llvm on powerpc64le. [native-inputs]: Add glslang on powerpc64le. [arguments]: Adjust configure-flags for powerpc64le to fix building on powerpc64le and enable features. Add powerpc64le specific phase to skip known failing test. Efraim Flashner