| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 |
|
| 21 | (define-module (gnu tests cachefilesd)
|
| 22 | #:use-module (gnu tests)
|
| 23 | #:use-module (gnu system)
|
| 24 | #:use-module (gnu system vm)
|
| 25 | #:use-module (gnu services)
|
| 26 | #:use-module (gnu services linux)
|
| 27 | #:use-module (guix gexp)
|
| 28 | #:export (%test-cachefilesd))
|
| 29 |
|
| 30 | (define %cachefilesd-os
|
| 31 | (simple-operating-system
|
| 32 | (service cachefilesd-service-type
|
| 33 | (cachefilesd-configuration
|
| 34 | (cache-directory "/var/cache/fscache")))))
|
| 35 |
|
| 36 | (define (run-cachefilesd-test)
|
| 37 | "Run tests in %cachefilesd-os, which has cachefilesd running."
|
| 38 | (define os
|
| 39 | (marionette-operating-system
|
| 40 | %cachefilesd-os
|
| 41 | #:imported-modules '((gnu services herd))))
|
| 42 |
|
| 43 | (define vm
|
| 44 | (virtual-machine os))
|
| 45 |
|
| 46 | (define test
|
| 47 | (with-imported-modules '((gnu build marionette))
|
| 48 | #~(begin
|
| 49 | (use-modules (srfi srfi-64)
|
| 50 | (gnu build marionette))
|
| 51 | (define marionette
|
| 52 | (make-marionette (list #$vm)))
|
| 53 |
|
| 54 | (test-runner-current (system-test-runner #$output))
|
| 55 | (test-begin "cachefilesd")
|
| 56 |
|
| 57 | (test-assert "service is running"
|
| 58 | (marionette-eval
|
| 59 | '(begin
|
| 60 | (use-modules (gnu services herd))
|
| 61 | (start-service 'cachefilesd))
|
| 62 | marionette))
|
| 63 |
|
| 64 | (test-end))))
|
| 65 | (gexp->derivation "cachefilesd-test" test))
|
| 66 |
|
| 67 | (define %test-cachefilesd
|
| 68 | (system-test
|
| 69 | (name "cachefilesd")
|
| 70 | (description "Test that the cachefilesd runs when started.")
|
| 71 | (value (run-cachefilesd-test))))
|