test: merge TEST-51-ISSUE-16115 into TEST-07-PID1

This commit is contained in:
Frantisek Sumsal
2023-05-10 21:26:26 +02:00
parent 11562ee585
commit d8d8380a35
8 changed files with 16 additions and 34 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eux
set -o pipefail
# Test ExecCondition= does not restart on abnormal or failure
# Issue: https://github.com/systemd/systemd/issues/16115
systemctl start issue16115-repro-1
systemctl start issue16115-repro-2
systemctl start issue16115-repro-3
sleep 5 # wait a bit in case there are restarts so we can count them below
[[ "$(systemctl show issue16115-repro-1 -P NRestarts)" == "0" ]]
[[ "$(systemctl show issue16115-repro-2 -P NRestarts)" == "0" ]]
[[ "$(systemctl show issue16115-repro-3 -P NRestarts)" == "0" ]]
-10
View File
@@ -1,10 +0,0 @@
# 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
-10
View File
@@ -1,10 +0,0 @@
# 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
-10
View File
@@ -1,10 +0,0 @@
# 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
-8
View File
@@ -1,8 +0,0 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Unit]
Description=TEST-51-ISSUE-16115
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot
-15
View File
@@ -1,15 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eux
set -o pipefail
systemctl start testsuite-51-repro-1
systemctl start testsuite-51-repro-2
systemctl start testsuite-51-repro-3
sleep 5 # wait a bit in case there are restarts so we can count them below
[[ "$(systemctl show testsuite-51-repro-1 -P NRestarts)" == "0" ]]
[[ "$(systemctl show testsuite-51-repro-2 -P NRestarts)" == "0" ]]
[[ "$(systemctl show testsuite-51-repro-3 -P NRestarts)" == "0" ]]
touch /testok