]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: add json test for vlan rule fix
authorM. Braun <michael-dev@fami-braun.de>
Sun, 11 Aug 2019 10:16:03 +0000 (12:16 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 12 Aug 2019 08:04:13 +0000 (10:04 +0200)
This fixes

ERROR: did not find JSON equivalent for rule 'ether type vlan ip
protocol 1 accept'

when running

./nft-test.py -j bridge/vlan.t

Reported-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/py/bridge/vlan.t.json
tests/py/bridge/vlan.t.json.output [new file with mode: 0644]

index 1a654640db98a9ae3a9c9957facc2d2e90ae72f5..3fb2e4f71c755b19d7b85457163075a571a90d01 100644 (file)
     }
 ]
 
+# ether type vlan ip protocol 1 accept
+[
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "type",
+                    "protocol": "ether"
+                }
+            },
+            "op": "==",
+            "right": "vlan"
+        }
+    },
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "protocol",
+                    "protocol": "ip"
+                }
+            },
+            "op": "==",
+            "right": "icmp"
+        }
+    },
+    {
+        "accept": null
+    }
+]
+
diff --git a/tests/py/bridge/vlan.t.json.output b/tests/py/bridge/vlan.t.json.output
new file mode 100644 (file)
index 0000000..8f27ec0
--- /dev/null
@@ -0,0 +1,31 @@
+# ether type vlan ip protocol 1 accept
+[
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "type",
+                    "protocol": "ether"
+                }
+            },
+            "op": "==",
+            "right": "vlan"
+        }
+    },
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "protocol",
+                    "protocol": "ip"
+                }
+            },
+            "op": "==",
+            "right": 1
+        }
+    },
+    {
+        "accept": null
+    }
+]
+