summaryrefslogtreecommitdiff
path: root/tests/services.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-08-31 12:38:38 +0200
committerLudovic Courtès <ludo@gnu.org>2016-08-31 15:44:20 +0200
commita5d78eb64bcb87440a0b3ff25eec5568df0bc47c (patch)
tree0e358fc5568bfd4ac5577c91de3eaca235aacbf1 /tests/services.scm
parentb8692e4696d0d2b36466827da1e0d25d69a298af (diff)
services: shepherd: Add 'shepherd-service-lookup-procedure'.
* gnu/services/shepherd.scm (shepherd-service-lookup-procedure): New procedure. (shepherd-service-back-edges)[provision->service]: Use it. * tests/services.scm ("shepherd-service-lookup-procedure"): New test.
Diffstat (limited to 'tests/services.scm')
-rw-r--r--tests/services.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/services.scm b/tests/services.scm
index 477a197160c..12745c80061 100644
--- a/tests/services.scm
+++ b/tests/services.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -105,6 +105,15 @@
105 (fold-services (list s) #:target-type t1) 105 (fold-services (list s) #:target-type t1)
106 #f))) 106 #f)))
107 107
108(test-assert "shepherd-service-lookup-procedure"
109 (let* ((s1 (shepherd-service (provision '(s1 s1b)) (start #f)))
110 (s2 (shepherd-service (provision '(s2 s2b)) (start #f)))
111 (s3 (shepherd-service (provision '(s3 s3b s3c)) (start #f)))
112 (lookup (shepherd-service-lookup-procedure (list s1 s2 s3))))
113 (and (eq? (lookup 's1) (lookup 's1b) s1)
114 (eq? (lookup 's2) (lookup 's2b) s2)
115 (eq? (lookup 's3) (lookup 's3b) s3))))
116
108(test-assert "shepherd-service-back-edges" 117(test-assert "shepherd-service-back-edges"
109 (let* ((s1 (shepherd-service (provision '(s1)) (start #f))) 118 (let* ((s1 (shepherd-service (provision '(s1)) (start #f)))
110 (s2 (shepherd-service (provision '(s2)) 119 (s2 (shepherd-service (provision '(s2))