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

This commit is contained in:
Frantisek Sumsal
2023-05-10 14:26:08 +02:00
parent 11562ee585
commit d8d8380a35
8 changed files with 16 additions and 34 deletions

View File

@@ -1 +0,0 @@
../TEST-01-BASIC/Makefile

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
TEST_DESCRIPTION="Test ExecCondition= does not restart on abnormal or failure"
# shellcheck source=test/test-functions
. "${TEST_BASE_DIR:?}/test-functions"
do_test "$@"

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" ]]

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

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