]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: monitor: Fix for single flag array avoidance
authorPhil Sutter <phil@nwl.cc>
Wed, 11 Jun 2025 15:15:22 +0000 (17:15 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 12 Jun 2025 20:55:53 +0000 (22:55 +0200)
Missed to update the JSON monitor expected output.

Fixes: 6bedb12af1658 ("json: Print single set flag as non-array")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/monitor/testcases/map-expr.t
tests/monitor/testcases/set-concat-interval.t
tests/monitor/testcases/set-interval.t
tests/monitor/testcases/set-maps.t
tests/monitor/testcases/set-mixed.t
tests/monitor/testcases/set-multiple.t
tests/monitor/testcases/set-simple.t

index d11ad0ebc0d5761ce809f65f2cc24cce8d7a967f..904200418745ef2b1f8d4639445c3aeaeae49b9c 100644 (file)
@@ -3,4 +3,4 @@ I add table ip t
 I add map ip t m { typeof meta day . meta hour : verdict; flags interval; counter; }
 O -
 J {"add": {"table": {"family": "ip", "name": "t", "handle": 0}}}
-J {"add": {"map": {"family": "ip", "name": "m", "table": "t", "type": {"typeof": {"concat": [{"meta": {"key": "day"}}, {"meta": {"key": "hour"}}]}}, "handle": 0, "map": "verdict", "flags": ["interval"], "stmt": [{"counter": null}]}}}
+J {"add": {"map": {"family": "ip", "name": "m", "table": "t", "type": {"typeof": {"concat": [{"meta": {"key": "day"}}, {"meta": {"key": "hour"}}]}}, "handle": 0, "map": "verdict", "flags": "interval", "stmt": [{"counter": null}]}}}
index 3542b8225ebd1a9659b75140f32589db96cc037b..a42682f503246a28398be34cd21dadc65f5f2cbc 100644 (file)
@@ -10,6 +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": {"typeof": {"concat": [{"payload": {"protocol": "udp", "field": "length"}}, {"payload": {"base": "ih", "offset": 32, "len": 32}}]}}, "handle": 0, "map": "verdict", "flags": ["interval"]}}}
+J {"add": {"map": {"family": "ip", "name": "s", "table": "t", "type": {"typeof": {"concat": [{"payload": {"protocol": "udp", "field": "length"}}, {"payload": {"base": "ih", "offset": 32, "len": 32}}]}}, "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}]]}}}}
index 5053c596b3b1b388cc7d1b688515982096d45b89..84cf98c21467168a7038d68d800698908645a8d6 100644 (file)
@@ -10,7 +10,7 @@ I add set ip t s { type inet_service; flags interval; elements = { 20, 30-40 };
 O add set ip t s { type inet_service; flags interval; }
 O add element ip t s { 20 }
 O add element ip t s { 30-40 }
-J {"add": {"set": {"family": "ip", "name": "s", "table": "t", "type": "inet_service", "handle": 0, "flags": ["interval"]}}}
+J {"add": {"set": {"family": "ip", "name": "s", "table": "t", "type": "inet_service", "handle": 0, "flags": "interval"}}}
 J {"add": {"element": {"family": "ip", "table": "t", "name": "s", "elem": {"set": [20]}}}}
 J {"add": {"element": {"family": "ip", "table": "t", "name": "s", "elem": {"set": [{"range": [30, 40]}]}}}}
 
index acda480d86dbbada7e664f23165d4a7d804fb000..aaf332f3caf98964106c26a6842c2430182b262b 100644 (file)
@@ -3,7 +3,7 @@ I add table ip t
 I add map ip t portip { type inet_service: ipv4_addr; flags interval; }
 O -
 J {"add": {"table": {"family": "ip", "name": "t", "handle": 0}}}
-J {"add": {"map": {"family": "ip", "name": "portip", "table": "t", "type": "inet_service", "handle": 0, "map": "ipv4_addr", "flags": ["interval"]}}}
+J {"add": {"map": {"family": "ip", "name": "portip", "table": "t", "type": "inet_service", "handle": 0, "map": "ipv4_addr", "flags": "interval"}}}
 
 I add element ip t portip { 80-100: 10.0.0.1 }
 O -
index 08c20116de92f783e8e480ccae70f2004356e800..1cf3d38e34a7baa8a718fe5a826b8e80c7620678 100644 (file)
@@ -4,7 +4,7 @@ I add set ip t portrange { type inet_service; flags interval; }
 I add set ip t ports { type inet_service; }
 O -
 J {"add": {"table": {"family": "ip", "name": "t", "handle": 0}}}
-J {"add": {"set": {"family": "ip", "name": "portrange", "table": "t", "type": "inet_service", "handle": 0, "flags": ["interval"]}}}
+J {"add": {"set": {"family": "ip", "name": "portrange", "table": "t", "type": "inet_service", "handle": 0, "flags": "interval"}}}
 J {"add": {"set": {"family": "ip", "name": "ports", "table": "t", "type": "inet_service", "handle": 0}}}
 
 # make sure concurrent adds work
index bd7a6246a46b45a8c1f8a798e57582898db03f82..84de98e94d139b9de4a2e6bbc608b8f598487d11 100644 (file)
@@ -4,8 +4,8 @@ I add set ip t portrange { type inet_service; flags interval; }
 I add set ip t portrange2 { type inet_service; flags interval; }
 O -
 J {"add": {"table": {"family": "ip", "name": "t", "handle": 0}}}
-J {"add": {"set": {"family": "ip", "name": "portrange", "table": "t", "type": "inet_service", "handle": 0, "flags": ["interval"]}}}
-J {"add": {"set": {"family": "ip", "name": "portrange2", "table": "t", "type": "inet_service", "handle": 0, "flags": ["interval"]}}}
+J {"add": {"set": {"family": "ip", "name": "portrange", "table": "t", "type": "inet_service", "handle": 0, "flags": "interval"}}}
+J {"add": {"set": {"family": "ip", "name": "portrange2", "table": "t", "type": "inet_service", "handle": 0, "flags": "interval"}}}
 
 # make sure concurrent adds work
 I add element ip t portrange { 1024-65535 }
index 6853a0ebbb0cb7361d0fc92cc29d81229562bd6b..4bef144875876badbf092b95df5f16245ce33324 100644 (file)
@@ -3,7 +3,7 @@ I add table ip t
 I add set ip t portrange { type inet_service; flags interval; }
 O -
 J {"add": {"table": {"family": "ip", "name": "t", "handle": 0}}}
-J {"add": {"set": {"family": "ip", "name": "portrange", "table": "t", "type": "inet_service", "handle": 0, "flags": ["interval"]}}}
+J {"add": {"set": {"family": "ip", "name": "portrange", "table": "t", "type": "inet_service", "handle": 0, "flags": "interval"}}}
 
 # adding some ranges
 I add element ip t portrange { 1-10 }