* [PATCH nft] tests: shell: large set overlap and automerge
@ 2022-06-16 9:35 Pablo Neira Ayuso
2022-06-23 15:59 ` Phil Sutter
0 siblings, 1 reply; 4+ messages in thread
From: Pablo Neira Ayuso @ 2022-06-16 9:35 UTC (permalink / raw)
To: netfilter-devel; +Cc: phil
Add a test to validate set overlap and automerge for large set. This
test runs nft -f twice to cover for set reload without flush.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
.../testcases/sets/overlap_automerge_large_0 | 52 +++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100755 tests/shell/testcases/sets/overlap_automerge_large_0
diff --git a/tests/shell/testcases/sets/overlap_automerge_large_0 b/tests/shell/testcases/sets/overlap_automerge_large_0
new file mode 100755
index 000000000000..578eeda81831
--- /dev/null
+++ b/tests/shell/testcases/sets/overlap_automerge_large_0
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+set -e
+
+RULESET="table inet x {
+ set y {
+ type ipv4_addr
+ flags interval
+ }
+}"
+
+tmpfile=$(mktemp)
+
+for ((i=1;i<255;i+=2))
+do
+ for ((j=1;j<224;j+=2))
+ do
+ echo "add element inet x y { 10.100.$i.$j }" >> $tmpfile
+ done
+done
+
+$NFT -f - <<< $RULESET
+time $NFT -f $tmpfile
+time $NFT -f $tmpfile
+$NFT flush ruleset
+
+tmpfile2=$(mktemp)
+
+RULESET="table inet x {
+ set y {
+ type ipv4_addr
+ flags interval
+ auto-merge
+ }
+}"
+
+for ((i=1;i<255;i+=2))
+do
+ for ((j=1;j<224;j+=2))
+ do
+ echo "add element inet x y { 10.100.$i.$j }" >> $tmpfile2
+ j=$(($j+1))
+ echo "add element inet x y { 10.100.$i.$j }" >> $tmpfile2
+ done
+done
+
+$NFT -f - <<< $RULESET
+time $NFT -f $tmpfile2
+time $NFT -f $tmpfile2
+
+rm -f $tmpfile
+rm -f $tmpfile2
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH nft] tests: shell: large set overlap and automerge
2022-06-16 9:35 [PATCH nft] tests: shell: large set overlap and automerge Pablo Neira Ayuso
@ 2022-06-23 15:59 ` Phil Sutter
2022-06-23 16:14 ` Pablo Neira Ayuso
0 siblings, 1 reply; 4+ messages in thread
From: Phil Sutter @ 2022-06-23 15:59 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel
On Thu, Jun 16, 2022 at 11:35:41AM +0200, Pablo Neira Ayuso wrote:
> Add a test to validate set overlap and automerge for large set. This
> test runs nft -f twice to cover for set reload without flush.
I had this in mind as well, but didn't like to hard-code any thresholds.
Your test is useful only for manual result review and will always pass,
therefore will only increase testsuite run time without any benefit.
Cheers, Phil
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH nft] tests: shell: large set overlap and automerge
2022-06-23 15:59 ` Phil Sutter
@ 2022-06-23 16:14 ` Pablo Neira Ayuso
2022-06-23 16:16 ` Phil Sutter
0 siblings, 1 reply; 4+ messages in thread
From: Pablo Neira Ayuso @ 2022-06-23 16:14 UTC (permalink / raw)
To: Phil Sutter, netfilter-devel
On Thu, Jun 23, 2022 at 05:59:52PM +0200, Phil Sutter wrote:
> On Thu, Jun 16, 2022 at 11:35:41AM +0200, Pablo Neira Ayuso wrote:
> > Add a test to validate set overlap and automerge for large set. This
> > test runs nft -f twice to cover for set reload without flush.
>
> I had this in mind as well, but didn't like to hard-code any thresholds.
> Your test is useful only for manual result review and will always pass,
> therefore will only increase testsuite run time without any benefit.
Yes, I run them manually often and it won't work for a robot, unless
time is printed somewhere and the robot identifies an anomaly there.
I can remove it if you like.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH nft] tests: shell: large set overlap and automerge
2022-06-23 16:14 ` Pablo Neira Ayuso
@ 2022-06-23 16:16 ` Phil Sutter
0 siblings, 0 replies; 4+ messages in thread
From: Phil Sutter @ 2022-06-23 16:16 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel
On Thu, Jun 23, 2022 at 06:14:17PM +0200, Pablo Neira Ayuso wrote:
> On Thu, Jun 23, 2022 at 05:59:52PM +0200, Phil Sutter wrote:
> > On Thu, Jun 16, 2022 at 11:35:41AM +0200, Pablo Neira Ayuso wrote:
> > > Add a test to validate set overlap and automerge for large set. This
> > > test runs nft -f twice to cover for set reload without flush.
> >
> > I had this in mind as well, but didn't like to hard-code any thresholds.
> > Your test is useful only for manual result review and will always pass,
> > therefore will only increase testsuite run time without any benefit.
>
> Yes, I run them manually often and it won't work for a robot, unless
> time is printed somewhere and the robot identifies an anomaly there.
>
> I can remove it if you like.
Just don't push it? :)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-06-23 16:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-16 9:35 [PATCH nft] tests: shell: large set overlap and automerge Pablo Neira Ayuso
2022-06-23 15:59 ` Phil Sutter
2022-06-23 16:14 ` Pablo Neira Ayuso
2022-06-23 16:16 ` Phil Sutter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).