guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[shepherd] 01/03: tests: Add test with exception thrown in 'start'.


From: Ludovic Courtès
Subject: [shepherd] 01/03: tests: Add test with exception thrown in 'start'.
Date: Sat, 06 Feb 2016 13:20:29 +0000

civodul pushed a commit to branch master
in repository shepherd.

commit 38eee33e64e259c831004cae0d338c52467fac38
Author: Ludovic Courtès <address@hidden>
Date:   Thu Feb 4 23:33:03 2016 +0100

    tests: Add test with exception thrown in 'start'.
    
    * tests/basic.sh: Add test with service 'broken'.
---
 tests/basic.sh |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/tests/basic.sh b/tests/basic.sh
index 89f09c3..18884b9 100644
--- a/tests/basic.sh
+++ b/tests/basic.sh
@@ -54,6 +54,13 @@ cat > "$conf"<<EOF
              #t)
    #:stop  (lambda _
              (delete-file "$stamp-2"))
+   #:respawn? #f)
+ (make <service>
+   #:provides '(broken)
+   #:requires '()
+   #:start (lambda _
+             (mkdir "/this/throws/a/system/error"))
+   #:stop  (const #f)
    #:respawn? #f))
 EOF
 
@@ -100,6 +107,9 @@ done
 if $herd an-action-that-does-not-exist root
 then false; else true; fi
 
+if $herd start broken
+then false; else true; fi
+
 # Wrong number of arguments for an action.
 if $herd status root foo bar baz;
 then false; else true; fi
@@ -113,7 +123,8 @@ then false; else true; fi
 if $herd load root /does/not/exist.scm;
 then false; else true; fi
 
-# Unload one service, make sure the other it still around.
+# Unload two services, make sure the other it still around.
+$herd unload root broken
 $herd unload root test
 $herd status | grep "Stopped: (test-2)"
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]