cachefilesd.scm 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
  3. ;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
  4. ;;; Copyright © 2023 Felix Lechner <felix.lechner@lease-up.com>
  5. ;;;
  6. ;;; This file is part of GNU Guix.
  7. ;;;
  8. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  9. ;;; under the terms of the GNU General Public License as published by
  10. ;;; the Free Software Foundation; either version 3 of the License, or (at
  11. ;;; your option) any later version.
  12. ;;;
  13. ;;; GNU Guix is distributed in the hope that it will be useful, but
  14. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;;; GNU General Public License for more details.
  17. ;;;
  18. ;;; You should have received a copy of the GNU General Public License
  19. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  20. (define-module (gnu tests cachefilesd)
  21. #:use-module (gnu tests)
  22. #:use-module (gnu system)
  23. #:use-module (gnu system vm)
  24. #:use-module (gnu services)
  25. #:use-module (gnu services linux)
  26. #:use-module (guix gexp)
  27. #:export (%test-cachefilesd))
  28. (define %cachefilesd-os
  29. (simple-operating-system
  30. (service cachefilesd-service-type
  31. (cachefilesd-configuration
  32. (cache-directory "/var/cache/fscache")))))
  33. (define (run-cachefilesd-test)
  34. "Run tests in %cachefilesd-os, which has cachefilesd running."
  35. (define os
  36. (marionette-operating-system
  37. %cachefilesd-os
  38. #:imported-modules '((gnu services herd))))
  39. (define vm
  40. (virtual-machine os))
  41. (define test
  42. (with-imported-modules '((gnu build marionette))
  43. #~(begin
  44. (use-modules (srfi srfi-64)
  45. (gnu build marionette))
  46. (define marionette
  47. (make-marionette (list #$vm)))
  48. (test-runner-current (system-test-runner #$output))
  49. (test-begin "cachefilesd")
  50. (test-assert "service is running"
  51. (marionette-eval
  52. '(begin
  53. (use-modules (gnu services herd))
  54. (start-service 'cachefilesd))
  55. marionette))
  56. (test-end))))
  57. (gexp->derivation "cachefilesd-test" test))
  58. (define %test-cachefilesd
  59. (system-test
  60. (name "cachefilesd")
  61. (description "Test that the cachefilesd runs when started.")
  62. (value (run-cachefilesd-test))))