lightdm.scm 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. (define-module (tests services lightdm)
  19. #:use-module (guix diagnostics)
  20. #:use-module (gnu services lightdm)
  21. #:use-module (srfi srfi-64))
  22. ;;; Tests for the (gnu services lightdm) module.
  23. ;;; Access some internals for whitebox testing.
  24. (define validate-lightdm-configuration (@@ (gnu services lightdm)
  25. validate-lightdm-configuration))
  26. (test-begin "lightdm-service")
  27. (test-equal "error on missing greeter"
  28. 'ok
  29. (catch 'quit
  30. (lambda ()
  31. (validate-lightdm-configuration (lightdm-configuration (greeters '()))))
  32. (lambda _
  33. 'ok)))
  34. (test-equal "error when a greeter has multiple configurations"
  35. 'ok
  36. (catch 'quit
  37. (lambda ()
  38. (lightdm-configuration
  39. (greeters (list (lightdm-gtk-greeter-configuration
  40. (theme-name "boring"))
  41. (lightdm-gtk-greeter-configuration
  42. (theme-name "blue"))))))
  43. (lambda _
  44. 'ok)))
  45. (test-end "lightdm-service")