summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-04-11 20:47:37 +0100
committerLars Wirzenius <liw@liw.fi>2013-04-11 20:47:37 +0100
commitbcdbf46c8ec8f3daf60550c059693595cc4cff79 (patch)
treeea7d8623c12be6eb5a49e5fdeb11a69ba2414790 /tests
parentdccfdbe5bf7233cc369a4a4994e473f0869a5f15 (diff)
downloaddesktop-cronish-bcdbf46c8ec8f3daf60550c059693595cc4cff79.tar.gz
Add timeout feature
Diffstat (limited to 'tests')
-rwxr-xr-xtests/timeout.script13
-rw-r--r--tests/timeout.stderr1
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/timeout.script b/tests/timeout.script
new file mode 100755
index 0000000..0533880
--- /dev/null
+++ b/tests/timeout.script
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -eu
+
+cat <<EOF > "$DATADIR/foo.tasks"
+date:
+ interval: 2
+ timeout: 1
+ command: sleep 1000
+EOF
+
+
+./desktop-cronish --max-jobs=1 "$DATADIR/foo.tasks"
diff --git a/tests/timeout.stderr b/tests/timeout.stderr
new file mode 100644
index 0000000..a6741f6
--- /dev/null
+++ b/tests/timeout.stderr
@@ -0,0 +1 @@
+ERROR: Job date: Command failed: timeout 1 sh -c sleep 1000