diff mbox series

[nft,4/4] tests/py: Fix JSON for icmp*.t

Message ID 20180911201427.25896-5-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show
Series Apply some recent changes to JSON output | expand

Commit Message

Phil Sutter Sept. 11, 2018, 8:14 p.m. UTC
A recent change to ip/icmp.t and ip6/icmpv6.t did not update JSON
equivalents accordingly, fix this.

Fixes: 0f44d4f627535 ("proto: fix icmp/icmpv6 code datatype")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 tests/py/ip/icmp.t.json           |  4 +--
 tests/py/ip/icmp.t.json.output    | 24 ++++++++++++++++++
 tests/py/ip6/icmpv6.t.json        |  6 ++---
 tests/py/ip6/icmpv6.t.json.output | 41 +++++++++++++++++++++++++++++++
 4 files changed, 70 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/tests/py/ip/icmp.t.json b/tests/py/ip/icmp.t.json
index 918621cb99027..4e17274587791 100644
--- a/tests/py/ip/icmp.t.json
+++ b/tests/py/ip/icmp.t.json
@@ -480,7 +480,7 @@ 
     }
 ]
 
-# icmp code != { 2, 4, 54, 33, 56}
+# icmp code != { prot-unreachable, 4, 33, 54, 56}
 [
     {
         "match": {
@@ -493,7 +493,7 @@ 
             "op": "!=",
             "right": {
                 "set": [
-                    2,
+                    "prot-unreachable",
                     4,
                     33,
                     54,
diff --git a/tests/py/ip/icmp.t.json.output b/tests/py/ip/icmp.t.json.output
index 30637a1345945..e8045bb8182e0 100644
--- a/tests/py/ip/icmp.t.json.output
+++ b/tests/py/ip/icmp.t.json.output
@@ -35,6 +35,30 @@ 
     }
 ]
 
+# icmp code { 2, 4, 54, 33, 56}
+[
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "code",
+                    "protocol": "icmp"
+                }
+            },
+            "op": "==",
+            "right": {
+                "set": [
+                    "prot-unreachable",
+                    4,
+                    33,
+                    54,
+                    56
+                ]
+            }
+        }
+    }
+]
+
 # icmp checksum { 1111, 222, 343} accept
 [
     {
diff --git a/tests/py/ip6/icmpv6.t.json b/tests/py/ip6/icmpv6.t.json
index 73b9277ae9872..f6cfbf172f562 100644
--- a/tests/py/ip6/icmpv6.t.json
+++ b/tests/py/ip6/icmpv6.t.json
@@ -519,7 +519,7 @@ 
     }
 ]
 
-# icmpv6 code != {5, 6, 7} accept
+# icmpv6 code != {policy-fail, reject-route, 7} accept
 [
     {
         "match": {
@@ -532,8 +532,8 @@ 
             "op": "!=",
             "right": {
                 "set": [
-                    5,
-                    6,
+                    "policy-fail",
+                    "reject-route",
                     7
                 ]
             }
diff --git a/tests/py/ip6/icmpv6.t.json.output b/tests/py/ip6/icmpv6.t.json.output
index 472b2ce74133b..3c56d86d18f90 100644
--- a/tests/py/ip6/icmpv6.t.json.output
+++ b/tests/py/ip6/icmpv6.t.json.output
@@ -93,3 +93,44 @@ 
     }
 ]
 
+# icmpv6 code 4
+[
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "code",
+                    "protocol": "icmpv6"
+                }
+            },
+	    "op": "==",
+            "right": "port-unreachable"
+        }
+    }
+]
+
+# icmpv6 code {5, 6, 7} accept
+[
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "code",
+                    "protocol": "icmpv6"
+                }
+            },
+	    "op": "==",
+            "right": {
+                "set": [
+                    "policy-fail",
+                    "reject-route",
+                    7
+                ]
+            }
+        }
+    },
+    {
+        "accept": null
+    }
+]
+