summaryrefslogtreecommitdiffstats
path: root/test/test-execute/exec-condition-skip.service
diff options
context:
space:
mode:
authorAnita Zhang <the.anitazha@gmail.com>2019-06-29 02:02:30 +0200
committerLennart Poettering <lennart@poettering.net>2019-07-17 11:35:02 +0200
commit31cd5f63ce86a0784c4ef869c4d323a11ff14adc (patch)
tree4762477054b47738120d76397e38a1703ad449da /test/test-execute/exec-condition-skip.service
parentMerge pull request #12927 from fbuihuu/coredump-cleanup-part-2 (diff)
downloadsystemd-31cd5f63ce86a0784c4ef869c4d323a11ff14adc.tar.xz
systemd-31cd5f63ce86a0784c4ef869c4d323a11ff14adc.zip
core: ExecCondition= for services
Closes #10596
Diffstat (limited to '')
-rw-r--r--test/test-execute/exec-condition-skip.service15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test-execute/exec-condition-skip.service b/test/test-execute/exec-condition-skip.service
new file mode 100644
index 0000000000..9450e8442a
--- /dev/null
+++ b/test/test-execute/exec-condition-skip.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Test for exec condition that triggers skipping
+
+[Service]
+Type=oneshot
+
+# exit codes [1, 254] will result in skipping the rest of execution
+ExecCondition=/bin/sh -c 'exit 0'
+ExecCondition=/bin/sh -c 'exit 254'
+
+# This would normally fail the unit but will not get run due to the skip above
+ExecCondition=/bin/sh -c 'exit 255'
+
+# This should not get run
+ExecStart=/bin/sh -c 'true'