diff mbox series

tests: add json test for vlan rule fix

Message ID 20190811101603.2892-1-michael-dev@fami-braun.de
State Accepted
Delegated to: Pablo Neira
Headers show
Series tests: add json test for vlan rule fix | expand

Commit Message

michael-dev Aug. 11, 2019, 10:16 a.m. UTC
From: "M. Braun" <michael-dev@fami-braun.de>

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@netfilter.org
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
---
 tests/py/bridge/vlan.t.json        | 31 ++++++++++++++++++++++++++++++
 tests/py/bridge/vlan.t.json.output | 31 ++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 tests/py/bridge/vlan.t.json.output

Comments

Pablo Neira Ayuso Aug. 12, 2019, 8:06 a.m. UTC | #1
On Sun, Aug 11, 2019 at 12:16:03PM +0200, michael-dev@fami-braun.de wrote:
> From: "M. Braun" <michael-dev@fami-braun.de>
> 
> 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

Applied, thanks.
diff mbox series

Patch

diff --git a/tests/py/bridge/vlan.t.json b/tests/py/bridge/vlan.t.json
index 1a65464..3fb2e4f 100644
--- a/tests/py/bridge/vlan.t.json
+++ b/tests/py/bridge/vlan.t.json
@@ -499,3 +499,34 @@ 
     }
 ]
 
+# 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
index 0000000..8f27ec0
--- /dev/null
+++ b/tests/py/bridge/vlan.t.json.output
@@ -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
+    }
+]
+