You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 lines
2.0 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2020 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 linux)
  19. #:use-module (ice-9 match)
  20. #:use-module (gnu packages linux)
  21. #:use-module (gnu services linux)
  22. #:use-module (guix gexp)
  23. #:use-module (srfi srfi-64))
  24. ;;; Tests for the (gnu services linux) module.
  25. (test-begin "linux-services")
  26. ;;;
  27. ;;; Early OOM daemon.
  28. ;;;
  29. (define earlyoom-configuration->command-line-args
  30. (@@ (gnu services linux) earlyoom-configuration->command-line-args))
  31. (define %earlyoom-configuration-sample
  32. (earlyoom-configuration
  33. (minimum-available-memory 10)
  34. (minimum-free-swap 20)
  35. (prefer-regexp "icecat")
  36. (avoid-regexp "guix-daemon")
  37. (memory-report-interval 60)
  38. (ignore-positive-oom-score-adj? #f)
  39. (run-with-higher-priority? #t)
  40. (show-debug-messages? #f)
  41. (send-notification-command "python \"/some/path/notify-all-users.py\"")))
  42. (test-equal "earlyoom-configuration->command-line-args"
  43. (list (file-append earlyoom "/bin/earlyoom")
  44. "-m" "10" "-s" "20" "--prefer" "icecat"
  45. "--avoid" "guix-daemon" "-r" "60" "-p"
  46. "-N" "python \"/some/path/notify-all-users.py\"")
  47. (earlyoom-configuration->command-line-args %earlyoom-configuration-sample))
  48. (test-end "linux-services")