netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nft PATCH 1/4] tests: monitor: Fix monitor JSON output for insert command
@ 2023-08-29 13:48 Phil Sutter
  2023-08-29 13:48 ` [nft PATCH 2/4] tests: monitor: Fix time format in ct timeout test Phil Sutter
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Phil Sutter @ 2023-08-29 13:48 UTC (permalink / raw)
  To: netfilter-devel

Looks like commit ba786ac758fba ("tests: monitor: update insert and
replace commands") missed to also fix expected JSON output.

Fixes: 48d20b8cf162e ("monitor: honor NLM_F_APPEND flag for rules")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 tests/monitor/testcases/simple.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/monitor/testcases/simple.t b/tests/monitor/testcases/simple.t
index 2d9c92de25dd3..c1c7bcfc08beb 100644
--- a/tests/monitor/testcases/simple.t
+++ b/tests/monitor/testcases/simple.t
@@ -15,7 +15,7 @@ J {"add": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "ex
 
 I insert rule ip t c counter accept
 O insert rule ip t c counter packets 0 bytes 0 accept
-J {"add": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "expr": [{"counter": {"packets": 0, "bytes": 0}}, {"accept": null}]}}}
+J {"insert": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "expr": [{"counter": {"packets": 0, "bytes": 0}}, {"accept": null}]}}}
 
 I replace rule ip t c handle 2 accept comment "foo bar"
 O delete rule ip t c handle 2
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [nft PATCH 2/4] tests: monitor: Fix time format in ct timeout test
  2023-08-29 13:48 [nft PATCH 1/4] tests: monitor: Fix monitor JSON output for insert command Phil Sutter
@ 2023-08-29 13:48 ` Phil Sutter
  2023-08-29 13:48 ` [nft PATCH 3/4] tests: monitor: Fix for wrong syntax in set-interval.t Phil Sutter
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Phil Sutter @ 2023-08-29 13:48 UTC (permalink / raw)
  To: netfilter-devel

The old "plain" numbers are still accepted (and assumed to be in
seconds), but output will use units which is unexpected due to 'O -'.
Adjust input instead of adding this subtly different output line.

Fixes: 5c25c5a35cbd2 ("parser: allow ct timeouts to use time_spec values")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 tests/monitor/testcases/object.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/monitor/testcases/object.t b/tests/monitor/testcases/object.t
index 2afe33c812571..53a9f8c59836b 100644
--- a/tests/monitor/testcases/object.t
+++ b/tests/monitor/testcases/object.t
@@ -37,7 +37,7 @@ I delete ct helper ip t cth
 O -
 J {"delete": {"ct helper": {"family": "ip", "name": "cth", "table": "t", "handle": 0, "type": "sip", "protocol": "tcp", "l3proto": "ip"}}}
 
-I add ct timeout ip t ctt { protocol udp; l3proto ip; policy = { unreplied : 15, replied : 12 }; }
+I add ct timeout ip t ctt { protocol udp; l3proto ip; policy = { unreplied : 15s, replied : 12s }; }
 O -
 J {"add": {"ct timeout": {"family": "ip", "name": "ctt", "table": "t", "handle": 0, "protocol": "udp", "l3proto": "ip", "policy": {"unreplied": 15, "replied": 12}}}}
 
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [nft PATCH 3/4] tests: monitor: Fix for wrong syntax in set-interval.t
  2023-08-29 13:48 [nft PATCH 1/4] tests: monitor: Fix monitor JSON output for insert command Phil Sutter
  2023-08-29 13:48 ` [nft PATCH 2/4] tests: monitor: Fix time format in ct timeout test Phil Sutter
@ 2023-08-29 13:48 ` Phil Sutter
  2023-08-29 13:48 ` [nft PATCH 4/4] tests: monitor: Fix for wrong ordering in expected JSON output Phil Sutter
  2023-08-29 16:10 ` [nft PATCH 1/4] tests: monitor: Fix monitor JSON output for insert command Phil Sutter
  3 siblings, 0 replies; 5+ messages in thread
From: Phil Sutter @ 2023-08-29 13:48 UTC (permalink / raw)
  To: netfilter-devel

Expected JSON output must be prefixed 'J'.

Fixes: 7ab453a033c9a ("monitor: do not call interval_map_decompose() for concat intervals")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 tests/monitor/testcases/set-interval.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/monitor/testcases/set-interval.t b/tests/monitor/testcases/set-interval.t
index b0649cdfe01e6..5053c596b3b1b 100644
--- a/tests/monitor/testcases/set-interval.t
+++ b/tests/monitor/testcases/set-interval.t
@@ -27,4 +27,4 @@ J {"add": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "ex
 # ... and anon concat range
 I add rule ip t c ether saddr . ip saddr { 08:00:27:40:f7:09 . 192.168.56.10-192.168.56.12 }
 O -
-{"add": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "expr": [{"match": {"op": "==", "left": {"concat": [{"payload": {"protocol": "ether", "field": "saddr"}}, {"payload": {"protocol": "ip", "field": "saddr"}}]}, "right": {"set": [{"concat": ["08:00:27:40:f7:09", {"range": ["192.168.56.10", "192.168.56.12"]}]}]}}}]}}}
+J {"add": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "expr": [{"match": {"op": "==", "left": {"concat": [{"payload": {"protocol": "ether", "field": "saddr"}}, {"payload": {"protocol": "ip", "field": "saddr"}}]}, "right": {"set": [{"concat": ["08:00:27:40:f7:09", {"range": ["192.168.56.10", "192.168.56.12"]}]}]}}}]}}}
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [nft PATCH 4/4] tests: monitor: Fix for wrong ordering in expected JSON output
  2023-08-29 13:48 [nft PATCH 1/4] tests: monitor: Fix monitor JSON output for insert command Phil Sutter
  2023-08-29 13:48 ` [nft PATCH 2/4] tests: monitor: Fix time format in ct timeout test Phil Sutter
  2023-08-29 13:48 ` [nft PATCH 3/4] tests: monitor: Fix for wrong syntax in set-interval.t Phil Sutter
@ 2023-08-29 13:48 ` Phil Sutter
  2023-08-29 16:10 ` [nft PATCH 1/4] tests: monitor: Fix monitor JSON output for insert command Phil Sutter
  3 siblings, 0 replies; 5+ messages in thread
From: Phil Sutter @ 2023-08-29 13:48 UTC (permalink / raw)
  To: netfilter-devel

Adjust JSON for delete before add for replace after respective kernel
fix, too.

Fixes: ba786ac758fba ("tests: monitor: update insert and replace commands")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 tests/monitor/testcases/simple.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/monitor/testcases/simple.t b/tests/monitor/testcases/simple.t
index c1c7bcfc08beb..67be5c85ab85d 100644
--- a/tests/monitor/testcases/simple.t
+++ b/tests/monitor/testcases/simple.t
@@ -20,8 +20,8 @@ J {"insert": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0,
 I replace rule ip t c handle 2 accept comment "foo bar"
 O delete rule ip t c handle 2
 O add rule ip t c handle 5 accept comment "foo bar"
-J {"add": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "comment": "foo bar", "expr": [{"accept": null}]}}}
 J {"delete": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "expr": [{"accept": null}]}}}
+J {"add": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "comment": "foo bar", "expr": [{"accept": null}]}}}
 
 I add counter ip t cnt
 O add counter ip t cnt { packets 0 bytes 0 }
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [nft PATCH 1/4] tests: monitor: Fix monitor JSON output for insert command
  2023-08-29 13:48 [nft PATCH 1/4] tests: monitor: Fix monitor JSON output for insert command Phil Sutter
                   ` (2 preceding siblings ...)
  2023-08-29 13:48 ` [nft PATCH 4/4] tests: monitor: Fix for wrong ordering in expected JSON output Phil Sutter
@ 2023-08-29 16:10 ` Phil Sutter
  3 siblings, 0 replies; 5+ messages in thread
From: Phil Sutter @ 2023-08-29 16:10 UTC (permalink / raw)
  To: netfilter-devel

On Tue, Aug 29, 2023 at 03:48:09PM +0200, Phil Sutter wrote:
> Looks like commit ba786ac758fba ("tests: monitor: update insert and
> replace commands") missed to also fix expected JSON output.
> 
> Fixes: 48d20b8cf162e ("monitor: honor NLM_F_APPEND flag for rules")
> Signed-off-by: Phil Sutter <phil@nwl.cc>

Series applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-29 16:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-29 13:48 [nft PATCH 1/4] tests: monitor: Fix monitor JSON output for insert command Phil Sutter
2023-08-29 13:48 ` [nft PATCH 2/4] tests: monitor: Fix time format in ct timeout test Phil Sutter
2023-08-29 13:48 ` [nft PATCH 3/4] tests: monitor: Fix for wrong syntax in set-interval.t Phil Sutter
2023-08-29 13:48 ` [nft PATCH 4/4] tests: monitor: Fix for wrong ordering in expected JSON output Phil Sutter
2023-08-29 16:10 ` [nft PATCH 1/4] tests: monitor: Fix monitor JSON output for insert command 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).