summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2022-12-14 15:45:22 +0100
committerGitHub <noreply@github.com>2022-12-14 15:45:22 +0100
commite14613630480375c987d359128bef8a8e6892071 (patch)
tree49cb20f88e3ad2e6975d4fe796ae90bb9d68bbeb /test
parentbdc11d26d1ae151c6de91c75858a5775ed219879 (diff)
parent856bfaeb054729b92992bc392aca2dbcc62e4a8e (diff)
downloadsystemd-e14613630480375c987d359128bef8a8e6892071.tar.gz
Merge pull request #25717 from bluca/reload
manager: log reload() sender and allow rate-limiting
Diffstat (limited to 'test')
-rwxr-xr-xtest/units/testsuite-59.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/units/testsuite-59.sh b/test/units/testsuite-59.sh
index 83db053107..ab6b2216fe 100755
--- a/test/units/testsuite-59.sh
+++ b/test/units/testsuite-59.sh
@@ -85,6 +85,25 @@ wait_on_state_or_fail "testservice-abort-restart-59.service" "failed" "30"
systemd-analyze log-level info
+# Test that rate-limiting daemon-reload works
+mkdir -p /run/systemd/system.conf.d/
+cat >/run/systemd/system.conf.d/50-test-59-reload.conf <<EOF
+[Manager]
+ReloadLimitIntervalSec=9
+ReloadLimitBurst=3
+EOF
+
+# Pick up the new config
+systemctl daemon-reload
+
+# The timeout will hit (and the test will fail) if the reloads are not rate-limited
+timeout 15 bash -c 'while systemctl daemon-reload --no-block; do true; done'
+
+# Rate limit should reset after 9s
+sleep 10
+
+systemctl daemon-reload
+
echo OK >/testok
exit 0