summaryrefslogtreecommitdiff
path: root/tests/services.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-04-10 01:24:30 +0200
committerLudovic Courtès <ludo@gnu.org>2022-04-10 01:24:30 +0200
commitec6a585ee2fd91c857276479411eedd0756e0093 (patch)
tree4a2697a47c97dae248431d028e6bb7ff328c7a57 /tests/services.scm
parente25eca35ff04e4234d0376fbb9a8e146869772c8 (diff)
services: Test 'shepherd-service-upgrade' with transient services.
This is a followup to eeb8ac43c8c0b0cc69422766070dbefc55f5c5c1. * tests/services.scm ("shepherd-service-upgrade: transient service"): New test.
Diffstat (limited to 'tests/services.scm')
-rw-r--r--tests/services.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/services.scm b/tests/services.scm
index 03c490100b..e64b3e8de8 100644
--- a/tests/services.scm
+++ b/tests/services.scm
@@ -260,6 +260,23 @@
(list (map live-service-provision unload)
(map shepherd-service-provision restart)))))
+(test-equal "shepherd-service-upgrade: transient service"
+ ;; Transient service must not be unloaded:
+ ;; <https://issues.guix.gnu.org/54812>.
+ '(((foo)) ;unload
+ ((qux))) ;restart
+ (call-with-values
+ (lambda ()
+ (shepherd-service-upgrade
+ (list (live-service '(sshd-42) '() #t 42) ;transient
+ (live-service '(foo) '() #f #t) ;obsolete
+ (live-service '(qux) '() #f #t)) ;running
+ (list (shepherd-service (provision '(qux))
+ (start #t)))))
+ (lambda (unload restart)
+ (list (map live-service-provision unload)
+ (map shepherd-service-provision restart)))))
+
(test-eq "lookup-service-types"
system-service-type
(and (null? (lookup-service-types 'does-not-exist-at-all))