diff options
| author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-08-03 23:41:35 -0400 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-08-28 22:28:47 -0400 |
| commit | 0ea62e84a787fe94cfeadf67ef27ea995a382b84 (patch) | |
| tree | 26b17f29b5e0ed2f1a5d5335b6469d6c428c8dd0 /tests | |
| parent | 42fee6d0f176aea5d208e3e6d8b5270abcf4173c (diff) | |
services: Add lightdm-service-type.
* gnu/services/lightdm.scm: New service.
* tests/services/lightdm.scm: Test it.
* doc/guix.texi (X Window): Document it.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register it.
Co-authored-by: L p R n d n <guix@lprndn.info>
Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/services/lightdm.scm | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/services/lightdm.scm b/tests/services/lightdm.scm new file mode 100644 index 00000000000..283df2befc4 --- /dev/null +++ b/tests/services/lightdm.scm | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> | ||
| 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") | ||
