summaryrefslogtreecommitdiffstats
path: root/test/units/testsuite-07.poll-limit.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
commit78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch)
treef515d16b6efd858a9aeb5b0ef5d6f90bf288283d /test/units/testsuite-07.poll-limit.sh
parentAdding debian version 255.5-1. (diff)
downloadsystemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz
systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/units/testsuite-07.poll-limit.sh')
-rwxr-xr-xtest/units/testsuite-07.poll-limit.sh48
1 files changed, 0 insertions, 48 deletions
diff --git a/test/units/testsuite-07.poll-limit.sh b/test/units/testsuite-07.poll-limit.sh
deleted file mode 100755
index 480d7ee..0000000
--- a/test/units/testsuite-07.poll-limit.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: LGPL-2.1-or-later
-set -eux
-set -o pipefail
-
-systemd-analyze log-level debug
-
-cat > /run/systemd/system/floodme@.service <<EOF
-[Service]
-ExecStart=/bin/true
-EOF
-
-cat > /run/systemd/system/floodme.socket <<EOF
-[Socket]
-ListenStream=/tmp/floodme
-PollLimitIntervalSec=10s
-Accept=yes
-PollLimitBurst=3
-EOF
-
-systemctl daemon-reload
-systemctl start floodme.socket
-
-START=$(date +%s%N)
-
-# Trigger this 100 times in a flood
-for (( i=0 ; i < 100; i++ )) ; do
- logger -u /tmp/floodme foo &
-done
-
-# Let some time pass
-sleep 5
-
-END=$(date +%s%N)
-
-PASSED=$((END-START))
-
-# Calculate (round up) how many trigger events could have happened in the passed time
-MAXCOUNT=$(((PASSED+10000000000)*3/10000000000))
-
-# We started 100 connection attempts, but only 3 should have gone through, as per limit
-test "$(systemctl show -P NAccepted floodme.socket)" -le "$MAXCOUNT"
-
-systemctl stop floodme.socket floodme@*.service
-
-rm /run/systemd/system/floodme@.service /run/systemd/system/floodme.socket /tmp/floodme
-
-systemctl daemon-reload