projects/guix·blob master · refs

52 lines · 1.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2022 Maxim Cournoyer <[email protected]>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (tests services lightdm)
20 #:use-module (guix diagnostics)
21 #:use-module (gnu services lightdm)
22 #:use-module (srfi srfi-64))
23
24;;; Tests for the (gnu services lightdm) module.
25
26;;; Access some internals for whitebox testing.
27(define validate-lightdm-configuration (@@ (gnu services lightdm)
28 validate-lightdm-configuration))
29
30(test-begin "lightdm-service")
31
32(test-equal "error on missing greeter"
33 'ok
34 (catch 'quit
35 (lambda ()
36 (validate-lightdm-configuration (lightdm-configuration (greeters '()))))
37 (lambda _
38 'ok)))
39
40(test-equal "error when a greeter has multiple configurations"
41 'ok
42 (catch 'quit
43 (lambda ()
44 (lightdm-configuration
45 (greeters (list (lightdm-gtk-greeter-configuration
46 (theme-name "boring"))
47 (lightdm-gtk-greeter-configuration
48 (theme-name "blue"))))))
49 (lambda _
50 'ok)))
51
52(test-end "lightdm-service")