All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH nft] tests: monitor: fix up test case breakage
Date: Tue, 29 Oct 2024 21:12:19 +0100	[thread overview]
Message-ID: <20241029201221.17865-1-fw@strlen.de> (raw)

Monitor test fails:

echo: running tests from file set-simple.t
echo output differs!
--- /tmp/tmp.FGtiyL99bB/tmp.2QxLSjzQqk  2024-10-29 20:54:41.308293201 +0100
+++ /tmp/tmp.FGtiyL99bB/tmp.A5rp0Z0dBJ  2024-10-29 20:54:41.317293201 +0100
@@ -1,2 +1,3 @@
-add element ip t portrange { 1024-65535 }
 add element ip t portrange { 100-200 }
+add element ip t portrange { 1024-65535 }
+# new generation 510 by process 129009 (nft)

I also noticed -j mode did not work correctly, add missing json annotations
in set-concat-interval.t while at it.

Fixes: 20f1c60ac8c8 ("src: collapse set element commands from parser")
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 tests/monitor/testcases/set-concat-interval.t | 3 +++
 tests/monitor/testcases/set-simple.t          | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/monitor/testcases/set-concat-interval.t b/tests/monitor/testcases/set-concat-interval.t
index 763dc319f0d1..75f38280bf82 100644
--- a/tests/monitor/testcases/set-concat-interval.t
+++ b/tests/monitor/testcases/set-concat-interval.t
@@ -10,3 +10,6 @@ I add map ip t s { typeof udp length . @ih,32,32 : verdict; flags interval; elem
 O add map ip t s { typeof udp length . @ih,32,32 : verdict; flags interval; }
 O add element ip t s { 20-80 . 0x14 : accept }
 O add element ip t s { 1-10 . 0xa : drop }
+J {"add": {"map": {"family": "ip", "name": "s", "table": "t", "type": ["integer", "integer"], "handle": 0, "map": "verdict", "flags": ["interval"]}}}
+J {"add": {"element": {"family": "ip", "table": "t", "name": "s", "elem": {"set": [[{"concat": [{"range": [20, 80]}, 20]}, {"accept": null}]]}}}}
+J {"add": {"element": {"family": "ip", "table": "t", "name": "s", "elem": {"set": [[{"concat": [{"range": [1, 10]}, 10]}, {"drop": null}]]}}}}
diff --git a/tests/monitor/testcases/set-simple.t b/tests/monitor/testcases/set-simple.t
index 8ca4f32463fd..6853a0ebbb0c 100644
--- a/tests/monitor/testcases/set-simple.t
+++ b/tests/monitor/testcases/set-simple.t
@@ -37,9 +37,10 @@ J {"add": {"element": {"family": "ip", "table": "t", "name": "portrange", "elem"
 # make sure half open before other element works
 I add element ip t portrange { 1024-65535 }
 I add element ip t portrange { 100-200 }
-O -
-J {"add": {"element": {"family": "ip", "table": "t", "name": "portrange", "elem": {"set": [{"range": [1024, 65535]}]}}}}
+O add element ip t portrange { 100-200 }
+O add element ip t portrange { 1024-65535 }
 J {"add": {"element": {"family": "ip", "table": "t", "name": "portrange", "elem": {"set": [{"range": [100, 200]}]}}}}
+J {"add": {"element": {"family": "ip", "table": "t", "name": "portrange", "elem": {"set": [{"range": [1024, 65535]}]}}}}
 
 # make sure deletion of elements works
 I delete element ip t portrange { 0-10 }
-- 
2.45.2


             reply	other threads:[~2024-10-29 20:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 20:12 Florian Westphal [this message]
2024-10-29 21:27 ` [PATCH nft] tests: monitor: fix up test case breakage Pablo Neira Ayuso
2024-10-30 18:19 ` Phil Sutter
2024-10-30 18:54   ` Florian Westphal
2024-10-30 21:38   ` Pablo Neira Ayuso
2024-10-30 22:21     ` Pablo Neira Ayuso
2024-10-30 23:29       ` Florian Westphal
2024-10-31 13:07         ` Phil Sutter

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=20241029201221.17865-1-fw@strlen.de \
    --to=fw@strlen.de \
    --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.