summaryrefslogtreecommitdiffstats
path: root/test/TEST-07-PID1/TEST-07-PID1.units
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-07-PID1/TEST-07-PID1.units
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-07-PID1/TEST-07-PID1.units')
-rw-r--r--test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service8
-rwxr-xr-xtest/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.sh6
-rw-r--r--test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-1.service10
-rw-r--r--test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-2.service10
-rw-r--r--test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-3.service10
-rw-r--r--test/TEST-07-PID1/TEST-07-PID1.units/issue2467.service10
-rw-r--r--test/TEST-07-PID1/TEST-07-PID1.units/issue2467.socket7
l---------test/TEST-07-PID1/TEST-07-PID1.units/issue2730-alias.mount1
-rw-r--r--test/TEST-07-PID1/TEST-07-PID1.units/issue2730.mount8
-rw-r--r--test/TEST-07-PID1/TEST-07-PID1.units/issue27953.service7
-rw-r--r--test/TEST-07-PID1/TEST-07-PID1.units/issue3166-fail-on-restart.service10
l---------test/TEST-07-PID1/TEST-07-PID1.units/local-fs.target.wants/issue2730.mount1
-rw-r--r--test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-no.socket35
-rw-r--r--test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-yes.socket36
14 files changed, 159 insertions, 0 deletions
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service
new file mode 100644
index 0000000..757f978
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Issue 14566 Repro
+
+[Service]
+ExecStart=/usr/lib/systemd/tests/testdata/TEST-07-PID1.units/%N.sh
+ExecStopPost=/bin/true
+KillMode=mixed
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.sh b/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.sh
new file mode 100755
index 0000000..74fa760
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+sleep infinity &
+echo $! >/leakedtestpid
+wait $!
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-1.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-1.service
new file mode 100644
index 0000000..90252b3
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-1.service
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Issue 16115 Repro with on-abnormal
+
+[Service]
+Type=simple
+Restart=on-abnormal
+ExecCondition=/bin/false
+ExecStart=sleep 100
+RestartSec=1
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-2.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-2.service
new file mode 100644
index 0000000..7c65691
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-2.service
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Issue 16115 Repro with on-failure
+
+[Service]
+Type=simple
+Restart=on-failure
+ExecCondition=/bin/false
+ExecStart=sleep 100
+RestartSec=1
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-3.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-3.service
new file mode 100644
index 0000000..c68f93d
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-3.service
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Issue 22257 Repro with Restart=always
+
+[Service]
+Type=simple
+Restart=always
+ExecCondition=/bin/false
+ExecStart=sleep 100
+RestartSec=1
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/issue2467.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue2467.service
new file mode 100644
index 0000000..99d886f
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue2467.service
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Requires=issue2467.socket
+ConditionPathExistsGlob=/tmp/nonexistent
+# Make sure we hit the socket trigger limit in the test and not the service start limit.
+StartLimitInterval=1000
+StartLimitBurst=1000
+
+[Service]
+ExecStart=true
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/issue2467.socket b/test/TEST-07-PID1/TEST-07-PID1.units/issue2467.socket
new file mode 100644
index 0000000..209b6bb
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue2467.socket
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Socket]
+ListenStream=/run/test.ctl
+# We might not be fast enough to hit the default limit (20 triggers per 2 secs)
+# in certain environments, i.e. when running without KVM or when collecting
+# coverage. Let's help it a bit in such cases by lowering the limit to 10 seconds.
+TriggerLimitIntervalSec=10
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/issue2730-alias.mount b/test/TEST-07-PID1/TEST-07-PID1.units/issue2730-alias.mount
new file mode 120000
index 0000000..802f026
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue2730-alias.mount
@@ -0,0 +1 @@
+issue2730.mount \ No newline at end of file
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/issue2730.mount b/test/TEST-07-PID1/TEST-07-PID1.units/issue2730.mount
new file mode 100644
index 0000000..2ac76c0
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue2730.mount
@@ -0,0 +1,8 @@
+[Mount]
+What=tmpfs
+Where=/issue2730
+Type=tmpfs
+
+[Install]
+WantedBy=local-fs.target
+Alias=issue2730-alias.mount
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/issue27953.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue27953.service
new file mode 100644
index 0000000..f441067
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue27953.service
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=This unit should not remain active once the shell process exits
+
+[Service]
+Type=oneshot
+ExecStart=sh -c 'sleep infinity & exit 0'
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/issue3166-fail-on-restart.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue3166-fail-on-restart.service
new file mode 100644
index 0000000..b8695d8
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue3166-fail-on-restart.service
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Fail on restart
+StartLimitIntervalSec=1m
+StartLimitBurst=3
+
+[Service]
+Type=exec
+ExecStart=false
+Restart=always
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/local-fs.target.wants/issue2730.mount b/test/TEST-07-PID1/TEST-07-PID1.units/local-fs.target.wants/issue2730.mount
new file mode 120000
index 0000000..70a8534
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/local-fs.target.wants/issue2730.mount
@@ -0,0 +1 @@
+../issue2730.mount \ No newline at end of file
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-no.socket b/test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-no.socket
new file mode 100644
index 0000000..8b7964b
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-no.socket
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Test if ExecXYZ= commands don't inherit listen FDs when PassFileDescriptorsToExec= is unset
+
+[Socket]
+# With Accept= set we don't need a corresponding service unit
+Accept=yes
+FileDescriptorName=foo
+ListenStream=127.0.0.1:1234
+ListenStream=[::1]:1234
+PassFileDescriptorsToExec=no
+ExecStartPre=\
+ test ExecStartPre -a \
+ -z ${LISTEN_FDS} -a \
+ -z ${LISTEN_FDNAMES} -a \
+ ! -e /dev/fd/3 -a \
+ ! -e /dev/fd/4
+ExecStartPost=\
+ test ExecStartPost -a \
+ -z ${LISTEN_FDS} -a \
+ -z ${LISTEN_FDNAMES} -a \
+ ! -e /dev/fd/3 -a \
+ ! -e /dev/fd/4
+ExecStopPre=\
+ test ExecStopPre -a \
+ -z ${LISTEN_FDS} -a \
+ -z ${LISTEN_FDNAMES} -a \
+ ! -e /dev/fd/3 -a \
+ ! -e /dev/fd/4
+ExecStopPost=\
+ test ExecStopPost -a \
+ -z ${LISTEN_FDS} -a \
+ -z ${LISTEN_FDNAMES} -a \
+ ! -e /dev/fd/3 -a \
+ ! -e /dev/fd/4
diff --git a/test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-yes.socket b/test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-yes.socket
new file mode 100644
index 0000000..bff192d
--- /dev/null
+++ b/test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-yes.socket
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Unit]
+Description=Test if ExecXYZ= commands inherit listen FDs when PassFileDescriptorsToExec= is set
+
+[Socket]
+# With Accept= set we don't need a corresponding service unit
+Accept=yes
+FileDescriptorName=foo
+ListenStream=127.0.0.1:1234
+ListenStream=[::1]:1234
+PassFileDescriptorsToExec=yes
+# ExecStartPre runs before we create sockets. Nothing to pass.
+ExecStartPre=\
+ test ExecStartPre -a \
+ -z ${LISTEN_FDS} -a \
+ -z ${LISTEN_FDNAMES} -a \
+ ! -e /dev/fd/3 -a \
+ ! -e /dev/fd/4
+ExecStartPost=\
+ test ExecStartPost -a \
+ ${LISTEN_FDS} = 2 -a \
+ ${LISTEN_FDNAMES} = foo:foo -a \
+ -S /dev/fd/3 -a \
+ -S /dev/fd/4
+ExecStopPre=\
+ test "ExecStopPre" -a \
+ ${LISTEN_FDS} = 2 -a \
+ ${LISTEN_FDNAMES} = foo:foo -a \
+ -S /dev/fd/3 -a \
+ -S /dev/fd/4
+ExecStopPost=\
+ test "ExecStopPost" -a \
+ ${LISTEN_FDS} = 2 -a \
+ ${LISTEN_FDNAMES} = foo:foo -a \
+ -S /dev/fd/3 -a \
+ -S /dev/fd/4