summaryrefslogtreecommitdiffstats
path: root/test/TEST-03-JOBS
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
commit78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch)
treef515d16b6efd858a9aeb5b0ef5d6f90bf288283d /test/TEST-03-JOBS
parentAdding debian version 255.5-1. (diff)
downloadsystemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz
systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/TEST-03-JOBS')
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.service8
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.socket5
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.service11
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.target3
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.service11
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.target3
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/hello-after-sleep.target6
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/hello.service6
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-and-pullin.target5
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-indirect.target3
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-only.target3
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-simple.service7
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/sleep.service7
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service6
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.target3
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service6
-rwxr-xr-xtest/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.sh10
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.target3
-rw-r--r--test/TEST-03-JOBS/TEST-03-JOBS.units/unstoppable.service6
-rw-r--r--test/TEST-03-JOBS/meson.build9
20 files changed, 121 insertions, 0 deletions
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.service
new file mode 100644
index 0000000..93ddb85
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Service that never leaves state ACTIVATING
+Requires=always-activating.socket
+After=always-activating.socket
+
+[Service]
+Type=notify
+ExecStart=bash -c 'sleep infinity'
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.socket b/test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.socket
new file mode 100644
index 0000000..c76fed2
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.socket
@@ -0,0 +1,5 @@
+[Unit]
+Description=Socket that activates always-activating.service
+
+[Socket]
+ListenStream=/run/test-03-always-activating.sock
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.service
new file mode 100644
index 0000000..60ffd7a
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.service
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Fail on restart
+StartLimitIntervalSec=1m
+StartLimitBurst=3
+
+[Service]
+Type=oneshot
+ExecStart=false
+Restart=on-failure
+RestartMode=direct
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.target
new file mode 100644
index 0000000..58e2561
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.target
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Requires=fails-on-restart-restartdirect.service
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.service
new file mode 100644
index 0000000..fb7e7ae
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.service
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Fail on restart
+StartLimitIntervalSec=1m
+StartLimitBurst=3
+
+[Service]
+Type=oneshot
+ExecStart=false
+Restart=on-failure
+RestartMode=normal
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.target
new file mode 100644
index 0000000..865fb2a
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.target
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Requires=fails-on-restart.service
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/hello-after-sleep.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/hello-after-sleep.target
new file mode 100644
index 0000000..b0ddb30
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/hello-after-sleep.target
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Sleep for a minute, then say hello.
+Wants=sleep.service hello.service
+After=sleep.service
+Before=hello.service
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/hello.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/hello.service
new file mode 100644
index 0000000..0c3f2f8
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/hello.service
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Hello World
+
+[Service]
+ExecStart=/bin/echo "Hello World"
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-and-pullin.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-and-pullin.target
new file mode 100644
index 0000000..8e409af
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-and-pullin.target
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Requires=sleep-infinity-simple.service
+After=sleep-infinity-simple.service
+PropagatesStopTo=sleep-infinity-simple.service
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-indirect.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-indirect.target
new file mode 100644
index 0000000..e8229a7
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-indirect.target
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+PropagatesStopTo=propagatestopto-and-pullin.target
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-only.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-only.target
new file mode 100644
index 0000000..327b7c1
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-only.target
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+PropagatesStopTo=sleep-infinity-simple.service
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-simple.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-simple.service
new file mode 100644
index 0000000..211346d
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-simple.service
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Sleep infinitely
+
+[Service]
+Type=simple
+ExecStart=/bin/sleep infinity
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/sleep.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/sleep.service
new file mode 100644
index 0000000..32c2037
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/sleep.service
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Sleep for 1 minute
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sleep 60
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service
new file mode 100644
index 0000000..a2b9c33
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Service]
+Type=oneshot
+ExecStart=/usr/lib/systemd/tests/testdata/TEST-03-JOBS.units/succeeds-on-restart.sh
+Restart=on-failure
+RestartMode=direct
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.target
new file mode 100644
index 0000000..2cf3c60
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.target
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Requires=succeeds-on-restart-restartdirect.service
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service
new file mode 100644
index 0000000..d0e9c2b
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Service]
+Type=oneshot
+ExecStart=/usr/lib/systemd/tests/testdata/TEST-03-JOBS.units/succeeds-on-restart.sh
+Restart=on-failure
+RestartMode=normal
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.sh b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.sh
new file mode 100755
index 0000000..1428b18
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: LGPL-2.1-or-later
+if [[ ! -f "/succeeds-on-restart.ko" ]]
+then
+ touch "/succeeds-on-restart.ko"
+ exit 1
+else
+ rm "/succeeds-on-restart.ko"
+ exit 0
+fi
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.target
new file mode 100644
index 0000000..eb82f47
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.target
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Requires=succeeds-on-restart.service
diff --git a/test/TEST-03-JOBS/TEST-03-JOBS.units/unstoppable.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/unstoppable.service
new file mode 100644
index 0000000..6eb7c19
--- /dev/null
+++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/unstoppable.service
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/bin/echo "I'm unstoppable!"
+ExecStop=/bin/systemctl start --no-block unstoppable.service
diff --git a/test/TEST-03-JOBS/meson.build b/test/TEST-03-JOBS/meson.build
new file mode 100644
index 0000000..3484d21
--- /dev/null
+++ b/test/TEST-03-JOBS/meson.build
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+integration_tests += [
+ integration_test_template + {
+ 'name' : fs.name(meson.current_source_dir()),
+ },
+]
+
+testdata_subdirs += [meson.current_source_dir() / 'TEST-03-JOBS.units']