Skip to contentSkip to conversation

tests: add json test for vlan rule fix

PATCH Applied [email protected] 2 participants 2 messages Aug 11, 2019 – Aug 12, 2019 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: add json test for vlan rule fix

From: "M. Braun" <[email protected]>

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

---
 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
tests/py/bridge/vlan.t.json +31 -0
index 1a65464..3fb2e4f 100644
@@ -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
+    }
+]
+
tests/py/bridge/vlan.t.json.output new file +31 -0
new file mode 100644
index 0000000..8f27ec0
@@ -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
+    }
+]
+
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 10 lines · On Sun, Aug 11, 2019 at 12:16:03PM +0200, [email protected] wrote:

From: "M. Braun" <[email protected]>

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.