]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
json: tests: add missing concat test case
authorFlorian Westphal <fw@strlen.de>
Mon, 14 Jun 2021 13:01:41 +0000 (15:01 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 14 Jun 2021 13:03:41 +0000 (15:03 +0200)
Fix
ERROR: did not find JSON equivalent for rule 'ip saddr . ip daddr { 192.0.2.1 . 10.0.0.1-10.0.0.2 }'

when running nft-test.py -j

Fixes: bbcc5eda7e58 ("evaluate: restore interval + concatenation in anonymous set")
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/py/ip/ip.t.json

index 42f936c163b296fdf0d3680537aaf14251c49b6c..32312b152ccfc6d35e49df00a388746747531e85 100644 (file)
     }
 ]
 
+# ip saddr . ip daddr { 192.0.2.1 . 10.0.0.1-10.0.0.2 }
+[
+    {
+        "match": {
+            "left": {
+                "concat": [
+                    {
+                        "payload": {
+                            "field": "saddr",
+                            "protocol": "ip"
+                        }
+                    },
+                    {
+                        "payload": {
+                            "field": "daddr",
+                            "protocol": "ip"
+                        }
+                    }
+                ]
+            },
+            "op": "==",
+            "right": {
+                "set": [
+                    {
+                        "concat": [
+                            "192.0.2.1",
+                            {
+                                "range": [
+                                    "10.0.0.1",
+                                    "10.0.0.2"
+                                ]
+                            }
+                        ]
+                    }
+                ]
+            }
+        }
+    }
+]