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
+++ /dev/null
-../TEST-01-BASIC/Makefile
\ No newline at end of file
+++ /dev/null
-#!/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 "$@"
'testsuite-03.units',
'testsuite-04.units',
'testsuite-06.units',
+ 'testsuite-07.units',
'testsuite-10.units',
'testsuite-11.units',
'testsuite-16.units',
# 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
--- /dev/null
+#!/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 ]]
+++ /dev/null
-# 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'