aboutsummaryrefslogtreecommitdiff
path: root/gnu/tests/cachefilesd.scm
blob: 7f5d513067156708b21c33e12bd6ae83de7170b4 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
;;; Copyright © 2023 Felix Lechner <felix.lechner@lease-up.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu tests cachefilesd)
  #:use-module (gnu tests)
  #:use-module (gnu system)
  #:use-module (gnu system vm)
  #:use-module (gnu services)
  #:use-module (gnu services linux)
  #:use-module (guix gexp)
  #:export (%test-cachefilesd))

(define %cachefilesd-os
  (simple-operating-system
   (service cachefilesd-service-type
            (cachefilesd-configuration
             (cache-directory "/var/cache/fscache")))))

(define (run-cachefilesd-test)
  "Run tests in %cachefilesd-os, which has cachefilesd running."
  (define os
    (marionette-operating-system
     %cachefilesd-os
     #:imported-modules '((gnu services herd))))

  (define vm
    (virtual-machine os))

  (define test
    (with-imported-modules '((gnu build marionette))
      #~(begin
          (use-modules (srfi srfi-64)
                       (gnu build marionette))
          (define marionette
            (make-marionette (list #$vm)))

          (test-runner-current (system-test-runner #$output))
          (test-begin "cachefilesd")

          (test-assert "service is running"
            (marionette-eval
             '(begin
                (use-modules (gnu services herd))
                (start-service 'cachefilesd))
             marionette))

          (test-end))))
  (gexp->derivation "cachefilesd-test" test))

(define %test-cachefilesd
  (system-test
   (name "cachefilesd")
   (description "Test that the cachefilesd runs when started.")
   (value (run-cachefilesd-test))))
*.fn /doc/guix*.fns /doc/guix*.html /doc/guix*.info /doc/guix*.info-[0-9] /doc/guix*.ky /doc/guix*.pg /doc/guix*.toc /doc/guix*.t2p /doc/guix*.tp /doc/guix*.vr /doc/guix*.vrs /doc/guix.*.texi /doc/guix-cookbook.*.texi /doc/guix.aux /doc/guix.cp /doc/guix.cps /doc/guix.fn /doc/guix.fns /doc/guix.html /doc/guix.info /doc/guix.info-[0-9] /doc/guix.ky /doc/guix.pg /doc/guix.toc /doc/guix.t2p /doc/guix.tp /doc/guix.vr /doc/guix.vrs /doc/os-config-bare-bones.texi /doc/os-config-desktop.texi /doc/stamp-vti /doc/version.texi /doc/version-*.texi /etc/committer.scm /etc/gnu-store.mount /etc/guix-daemon.cil /etc/guix-daemon.conf /etc/guix-daemon.service /etc/guix-publish.conf /etc/guix-publish.service /etc/init.d/guix-daemon /etc/openrc/guix-daemon /guix-daemon /guix/config.scm /libformat.a /libstore.a /libutil.a /m4/* /m4/ChangeLog /m4/gettext.m4 /m4/iconv.m4 /m4/lib-ld.m4 /m4/lib-link.m4 /m4/lib-prefix.m4 /m4/nls.m4 /m4/po.m4 /m4/progtest.m4 /nix/config.h /nix/config.h.in /po/doc/*.mo /po/guix/*.gmo /po/guix/*.insert-header /po/guix/*.mo /po/guix/ChangeLog /po/guix/Makefile.in.in /po/guix/Makevars.template /po/guix/POTFILES /po/guix/Rules-quot /po/guix/boldquot.sed /po/guix/en@boldquot.* /po/guix/en@quot.* /po/guix/guix.pot /po/guix/insert-header.sin /po/guix/quot.sed /po/guix/remove-potcdate.sed /po/guix/remove-potcdate.sin /po/guix/stamp-po /po/packages/*.gmo /po/packages/*.insert-header /po/packages/*.mo /po/packages/ChangeLog /po/packages/Makefile.in.in /po/packages/Makevars.template /po/packages/POTFILES /po/packages/Rules-quot /po/packages/boldquot.sed /po/packages/en@boldquot.* /po/packages/en@quot.* /po/packages/guix-packages.pot /po/packages/insert-header.sin /po/packages/quot.sed /po/packages/remove-potcdate.sed /po/packages/remove-potcdate.sin /po/packages/stamp-po /pre-inst-env /scripts/guix /test-env /test-tmp /tests/*.trs /tests/services/*.trs GPATH GRTAGS GTAGS Makefile Makefile.in config.cache stamp-h[0-9] .dirstamp .deps tmp /doc/os-config-lightweight-desktop.texi /nix/scripts/download /.version /doc/stamp-[0-9] /gnu/packages/bootstrap /gnu/packages/aux-files/guile-guile-launcher.o /guile