diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-05-10 13:41:03 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-05-10 14:29:38 +0200 |
commit | a8faac7dae6f54e88aad08d2d8c34e165ce6e922 (patch) | |
tree | 4669587fda26bc32af15318311cd894e7f797efe /test | |
parent | 4966a31ba3ef1eae37733a81bf318f4b18d11a96 (diff) | |
download | systemd-a8faac7dae6f54e88aad08d2d8c34e165ce6e922.tar.gz |
test: merge TEST-10-ISSUE-2467 with TEST-07-PID1
Diffstat (limited to 'test')
-rwxr-xr-x | test/TEST-07-PID1/test.sh | 8 | ||||
l--------- | test/TEST-10-ISSUE-2467/Makefile | 1 | ||||
-rwxr-xr-x | test/TEST-10-ISSUE-2467/test.sh | 22 | ||||
-rw-r--r-- | test/meson.build | 1 | ||||
-rw-r--r-- | test/testsuite-07.units/issue2467.service (renamed from test/testsuite-10.units/test10.service) | 2 | ||||
-rw-r--r-- | test/testsuite-07.units/issue2467.socket (renamed from test/testsuite-10.units/test10.socket) | 0 | ||||
-rwxr-xr-x | test/units/testsuite-07.issue-2467.sh | 17 | ||||
-rw-r--r-- | test/units/testsuite-10.service | 16 |
8 files changed, 27 insertions, 40 deletions
diff --git a/test/TEST-07-PID1/test.sh b/test/TEST-07-PID1/test.sh index c241840327..1c3d7137fe 100755 --- a/test/TEST-07-PID1/test.sh +++ b/test/TEST-07-PID1/test.sh @@ -10,6 +10,14 @@ TEST_DESCRIPTION="Tests for core PID1 functionality" test_append_files() { local workspace="${1:?}" + # Collecting coverage slows this particular test quite a bit, causing + # it to fail with the default settings (20 triggers per 2 secs). + # Let's help it a bit in such case. + if get_bool "$IS_BUILT_WITH_COVERAGE"; then + mkdir -p "$workspace/etc/systemd/system/issue2467.socket.d" + printf "[Socket]\nTriggerLimitIntervalSec=10\n" >"$workspace/etc/systemd/system/issue2467.socket.d/coverage-override.conf" + fi + # Issue: https://github.com/systemd/systemd/issues/2730 mkdir -p "$workspace/etc/systemd/system/" cat >"$workspace/etc/systemd/system/issue2730.mount" <<EOF diff --git a/test/TEST-10-ISSUE-2467/Makefile b/test/TEST-10-ISSUE-2467/Makefile deleted file mode 120000 index e9f93b1104..0000000000 --- a/test/TEST-10-ISSUE-2467/Makefile +++ /dev/null @@ -1 +0,0 @@ -../TEST-01-BASIC/Makefile
\ No newline at end of file diff --git a/test/TEST-10-ISSUE-2467/test.sh b/test/TEST-10-ISSUE-2467/test.sh deleted file mode 100755 index 8dabf3f2b6..0000000000 --- a/test/TEST-10-ISSUE-2467/test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -e - -TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2467" - -# shellcheck source=test/test-functions -. "${TEST_BASE_DIR:?}/test-functions" - -test_append_files() { - ( - # Collecting coverage slows this particular test quite a bit, causing - # it to fail with the default settings (20 triggers per 2 secs) - # to trip over the default limit. Let's help it a bit in such case. - if get_bool "$IS_BUILT_WITH_COVERAGE"; then - mkdir -p "${initdir:?}/etc/systemd/system/test10.socket.d" - printf "[Socket]\nTriggerLimitIntervalSec=10\n" >"${initdir:?}/etc/systemd/system/test10.socket.d/coverage-override.conf" - fi - ) -} - -do_test "$@" diff --git a/test/meson.build b/test/meson.build index 61b47e199f..dc3b78be1f 100644 --- a/test/meson.build +++ b/test/meson.build @@ -15,6 +15,7 @@ if install_tests 'testsuite-03.units', 'testsuite-04.units', 'testsuite-06.units', + 'testsuite-07.units', 'testsuite-10.units', 'testsuite-11.units', 'testsuite-16.units', diff --git a/test/testsuite-10.units/test10.service b/test/testsuite-07.units/issue2467.service index fc8fad9327..99d886f025 100644 --- a/test/testsuite-10.units/test10.service +++ b/test/testsuite-07.units/issue2467.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -Requires=test10.socket +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 diff --git a/test/testsuite-10.units/test10.socket b/test/testsuite-07.units/issue2467.socket index af1317b409..af1317b409 100644 --- a/test/testsuite-10.units/test10.socket +++ b/test/testsuite-07.units/issue2467.socket diff --git a/test/units/testsuite-07.issue-2467.sh b/test/units/testsuite-07.issue-2467.sh new file mode 100755 index 0000000000..a5dcfd55dd --- /dev/null +++ b/test/units/testsuite-07.issue-2467.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -eux +set -o pipefail + +# Don't start services every few ms if condition fails +# Issue: https://github.com/systemd/systemd/issues/2467 + +rm -f /tmp/nonexistent +systemctl start issue2467.socket +nc -w20 -U /run/test.ctl || : + +# TriggerLimitIntervalSec= by default is set to 2s. A "sleep 10" should give +# systemd enough time even on slower machines, to reach the trigger limit. +# shellcheck disable=SC2016 +timeout 10 bash -c 'while ! [[ "$(systemctl show issue2467.socket -P ActiveState)" == failed ]]; do sleep .5; done' +[[ "$(systemctl show issue2467.socket -P Result)" == trigger-limit-hit ]] diff --git a/test/units/testsuite-10.service b/test/units/testsuite-10.service deleted file mode 100644 index 9fcfd673c6..0000000000 --- a/test/units/testsuite-10.service +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-10-ISSUE-2467 - -[Service] -ExecStartPre=rm -f /failed /testok -Type=oneshot -ExecStart=rm -f /tmp/nonexistent -ExecStart=systemctl start test10.socket -ExecStart=-nc -w20 -U /run/test.ctl -# TriggerLimitIntervalSec= by default is set to 2s. A "sleep 10" should give -# systemd enough time even on slower machines, to reach the trigger limit. -ExecStart=sleep 10 -ExecStart=sh -x -c 'test "$(systemctl show test10.socket -P ActiveState)" = failed' -ExecStart=sh -x -c 'test "$(systemctl show test10.socket -P Result)" = trigger-limit-hit' -ExecStart=sh -x -c 'echo OK >/testok' |