[nft PATCH 13/14] tests: py: Fix tests added for 'icmpv6 taddr' support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There was a duplicate test, also stored JSON equivalents should match
input as much as possible. The expected deviation in output (just like
with standard syntax) is stored in the .json.output file instead.

Fixes: 2e86f45d0260a ("icmpv6: Allow matching target address in NS/NA, redirect and MLD")
Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 tests/py/ip6/icmpv6.t             |  2 --
 tests/py/ip6/icmpv6.t.json        | 58 -------------------------------
 tests/py/ip6/icmpv6.t.json.output | 36 +++++++++++++++++++
 3 files changed, 36 insertions(+), 60 deletions(-)

diff --git a/tests/py/ip6/icmpv6.t b/tests/py/ip6/icmpv6.t
index 7632bfd878f47..5108b427a60a5 100644
--- a/tests/py/ip6/icmpv6.t
+++ b/tests/py/ip6/icmpv6.t
@@ -91,8 +91,6 @@ icmpv6 type nd-neighbor-solicit icmpv6 taddr 2001:db8::133;ok
 icmpv6 type nd-neighbor-advert icmpv6 taddr 2001:db8::133;ok
 icmpv6 taddr 2001:db8::133;ok;icmpv6 type { mld-listener-query, mld-listener-report, mld-listener-done, nd-neighbor-solicit, nd-neighbor-advert, nd-redirect} icmpv6 taddr 2001:db8::133
 
-icmpv6 taddr 2001:db8::133;ok;icmpv6 type { mld-listener-query, mld-listener-report, mld-listener-done, nd-neighbor-solicit, nd-neighbor-advert, nd-redirect} icmpv6 taddr 2001:db8::133
-
 icmpv6 type { mld-listener-query, mld-listener-report, mld-listener-done, nd-neighbor-solicit, nd-neighbor-advert, nd-redirect} icmpv6 taddr 2001:db8::133;ok
 icmpv6 type { nd-neighbor-solicit, nd-neighbor-advert } icmpv6 taddr 2001:db8::133;ok
 icmpv6 daddr 2001:db8::133;ok
diff --git a/tests/py/ip6/icmpv6.t.json b/tests/py/ip6/icmpv6.t.json
index 9df886dd22772..5c36aabaaaee5 100644
--- a/tests/py/ip6/icmpv6.t.json
+++ b/tests/py/ip6/icmpv6.t.json
@@ -1250,64 +1250,6 @@
 
 # icmpv6 taddr 2001:db8::133
 [
-    {
-        "match": {
-            "left": {
-                "payload": {
-                    "field": "type",
-                    "protocol": "icmpv6"
-                }
-            },
-            "op": "==",
-            "right": {
-                "set": [
-                    "mld-listener-query",
-                    "mld-listener-report",
-                    "mld-listener-done",
-                    "nd-neighbor-solicit",
-                    "nd-neighbor-advert",
-                    "nd-redirect"
-                ]
-            }
-        }
-    },
-    {
-        "match": {
-            "left": {
-                "payload": {
-                    "field": "taddr",
-                    "protocol": "icmpv6"
-                }
-            },
-            "op": "==",
-            "right": "2001:db8::133"
-        }
-    }
-]
-
-# icmpv6 taddr 2001:db8::133
-[
-    {
-        "match": {
-            "left": {
-                "payload": {
-                    "field": "type",
-                    "protocol": "icmpv6"
-                }
-            },
-            "op": "==",
-            "right": {
-                "set": [
-                    "mld-listener-query",
-                    "mld-listener-report",
-                    "mld-listener-done",
-                    "nd-neighbor-solicit",
-                    "nd-neighbor-advert",
-                    "nd-redirect"
-                ]
-            }
-        }
-    },
     {
         "match": {
             "left": {
diff --git a/tests/py/ip6/icmpv6.t.json.output b/tests/py/ip6/icmpv6.t.json.output
index 5d33780ee82ba..568bdb533910a 100644
--- a/tests/py/ip6/icmpv6.t.json.output
+++ b/tests/py/ip6/icmpv6.t.json.output
@@ -696,3 +696,39 @@
     }
 ]
 
+# icmpv6 taddr 2001:db8::133
+[
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "type",
+                    "protocol": "icmpv6"
+                }
+            },
+            "op": "==",
+            "right": {
+                "set": [
+                    "mld-listener-query",
+                    "mld-listener-report",
+                    "mld-listener-done",
+                    "nd-neighbor-solicit",
+                    "nd-neighbor-advert",
+                    "nd-redirect"
+                ]
+            }
+        }
+    },
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "taddr",
+                    "protocol": "icmpv6"
+                }
+            },
+            "op": "==",
+            "right": "2001:db8::133"
+        }
+    }
+]
-- 
2.49.0





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux