mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
test: merge TEST-11-ISSUE-3166 into TEST-07-PID1
This commit is contained in:
@@ -1 +0,0 @@
|
||||
../TEST-01-BASIC/Makefile
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
set -e
|
||||
|
||||
TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/3166"
|
||||
TEST_NO_NSPAWN=1
|
||||
|
||||
# shellcheck source=test/test-functions
|
||||
. "${TEST_BASE_DIR:?}/test-functions"
|
||||
|
||||
do_test "$@"
|
||||
16
test/units/testsuite-07.issue-3166.sh
Executable file
16
test/units/testsuite-07.issue-3166.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
set -eux
|
||||
set -o pipefail
|
||||
|
||||
# Service doesn't enter the "failed" state
|
||||
# Issue: https://github.com/systemd/systemd/issues/3166
|
||||
|
||||
systemctl --no-block start issue3166-fail-on-restart.service
|
||||
active_state="$(systemctl show --value --property ActiveState issue3166-fail-on-restart.service)"
|
||||
while [[ "$active_state" == "activating" || "$active_state" =~ ^(in)?active$ ]]; do
|
||||
sleep .5
|
||||
active_state="$(systemctl show --value --property ActiveState issue3166-fail-on-restart.service)"
|
||||
done
|
||||
systemctl is-failed issue3166-fail-on-restart.service || exit 1
|
||||
[[ "$(systemctl show --value --property NRestarts issue3166-fail-on-restart.service)" -le 3 ]] || exit 1
|
||||
@@ -1,8 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
[Unit]
|
||||
Description=TEST-11-ISSUE-3166
|
||||
|
||||
[Service]
|
||||
ExecStartPre=rm -f /failed /testok
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||
Type=oneshot
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
set -eux
|
||||
set -o pipefail
|
||||
|
||||
systemctl --no-block start fail-on-restart.service
|
||||
active_state=$(systemctl show --value --property ActiveState fail-on-restart.service)
|
||||
while [[ "$active_state" == "activating" || "$active_state" =~ ^(in)?active$ ]]; do
|
||||
sleep .5
|
||||
active_state=$(systemctl show --value --property ActiveState fail-on-restart.service)
|
||||
done
|
||||
systemctl is-failed fail-on-restart.service || exit 1
|
||||
[[ "$(systemctl show --value --property NRestarts fail-on-restart.service)" -le 3 ]] || exit 1
|
||||
touch /testok
|
||||
Reference in New Issue
Block a user