From: Florian Westphal <fw@strlen.de>
To: kadlec@netfilter.org
Cc: <netfilter-devel@vger.kernel.org>, Florian Westphal <fw@strlen.de>
Subject: [PATCH ipset 1/5] tests: check_extensions: introduce and use IPSET_MACHINE_SLOW
Date: Thu, 23 Jul 2026 12:35:00 +0200 [thread overview]
Message-ID: <20260723103504.3175-2-fw@strlen.de> (raw)
In-Reply-To: <20260723103504.3175-1-fw@strlen.de>
Running ipset tests on my laptop with a debug kernel (i.e. kasan,
kmemleak and so on) fails the check_extensions subtests because the
observed timeout is below the lower threshold. Add IPSET_MACHINE_SLOW,
similar to KSFT_MACHINE_SLOW used in the kernel kselftest framework.
If set, raise the slack value to 30s.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
tests/check_extensions | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/tests/check_extensions b/tests/check_extensions
index 77e7c2cd8b90..ce39366ad46d 100755
--- a/tests/check_extensions
+++ b/tests/check_extensions
@@ -1,11 +1,26 @@
#!/bin/bash
ipset=${IPSET_BIN:-../src/ipset}
+setname="$1"
+elem="$2"
+wanted_timeout="$3"
+wanted_packets="$4"
+wanted_bytes="$5"
-read ip t timeout p packets b bytes <<< $($ipset l $1 | grep ^$2)
-test -z "$timeout" -o -z "$packets" -o -z "$bytes" && exit 1
-test $timeout -gt $3 -o $timeout -lt $(($3 - 10)) && exit 1
-test $packets -ne $4 -o $bytes -ne $5 && exit 1
+allowed_slack=10
+[ "$IPSET_MACHINE_SLOW" = "yes" ] && allowed_slack=30
+
+die() {
+ echo "FAIL: $0: $@"
+ exit 1
+}
+
+timeout_lower=$((wanted_timeout - allowed_slack))
+
+read ip t timeout p packets b bytes <<< $($ipset l $setname | grep ^$elem)
+test -z "$timeout" -o -z "$packets" -o -z "$bytes" && die "at least of one timeout $timeout, packets $packets, bytes $bytes not set"
+test $timeout -gt $wanted_timeout -o $timeout -lt $timeout_lower && die "timeout $timeout gt $wanted_timeout or $timeout lt $timeout_lower"
+test $packets -ne $wanted_packets -o $bytes -ne $wanted_bytes && die "packets $packets ne $wanted_packets or $bytes ne $wanted_bytes"
exit 0
--
2.54.0
next prev parent reply other threads:[~2026-07-23 10:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 10:34 [PATCH ipset 0/5] ipset test updates Florian Westphal
2026-07-23 10:35 ` Florian Westphal [this message]
2026-07-23 10:35 ` [PATCH ipset 2/5] tests: hash:net.t: prefer tail -n Florian Westphal
2026-07-23 10:35 ` [PATCH ipset 3/5] tests: prefer diff -u to cmp Florian Westphal
2026-07-23 10:35 ` [PATCH ipset 4/5] tests: hash:net,iface.t: add reproducer for UaF Florian Westphal
2026-07-23 10:35 ` [PATCH ipset 5/5] tests: match_target.t check for proper cidr matching Florian Westphal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260723103504.3175-2-fw@strlen.de \
--to=fw@strlen.de \
--cc=kadlec@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.