Blame SOURCES/0002-tests-add-icmp-6-test-where-dependency-should-be-lef.patch

195495
From bcd7ef679ca12700970e84fdd8ed38d8f58557ea Mon Sep 17 00:00:00 2001
195495
From: Florian Westphal <fw@strlen.de>
195495
Date: Mon, 1 Feb 2021 22:44:25 +0100
195495
Subject: [PATCH] tests: add icmp/6 test where dependency should be left alone
195495
195495
These tests fail: nft should leave the type as-is.
195495
195495
Signed-off-by: Florian Westphal <fw@strlen.de>
195495
(cherry picked from commit 3eb14fd93093c5e084d3ac1c4b0171cf80fb264f)
195495
195495
Conflicts:
195495
	tests/py/ip/icmp.t.json
195495
	tests/py/ip6/icmpv6.t.json
195495
-> Context change it seems.
195495
195495
Signed-off-by: Phil Sutter <psutter@redhat.com>
195495
---
195495
 tests/py/ip/icmp.t                |  2 ++
195495
 tests/py/ip/icmp.t.json           | 28 ++++++++++++++++++++
195495
 tests/py/ip/icmp.t.payload.ip     |  6 +++++
195495
 tests/py/ip6/icmpv6.t             |  2 ++
195495
 tests/py/ip6/icmpv6.t.json        | 44 +++++++++++++++++++++++++++++++
195495
 tests/py/ip6/icmpv6.t.payload.ip6 |  7 +++++
195495
 6 files changed, 89 insertions(+)
195495
195495
diff --git a/tests/py/ip/icmp.t b/tests/py/ip/icmp.t
195495
index c22b55eb1e3f4..11f3662e2b027 100644
195495
--- a/tests/py/ip/icmp.t
195495
+++ b/tests/py/ip/icmp.t
195495
@@ -86,3 +86,5 @@ icmp gateway != { 33-55};ok
195495
 icmp gateway != 34;ok
195495
 icmp gateway != { 333, 334};ok
195495
 
195495
+icmp code 1 icmp type 2;ok;icmp type 2 icmp code host-unreachable
195495
+icmp code != 1 icmp type 2 icmp mtu 5;fail
195495
diff --git a/tests/py/ip/icmp.t.json b/tests/py/ip/icmp.t.json
195495
index 965eb10be9edf..2ea5b1a3e5e02 100644
195495
--- a/tests/py/ip/icmp.t.json
195495
+++ b/tests/py/ip/icmp.t.json
195495
@@ -1424,3 +1424,31 @@
195495
     }
195495
 ]
195495
 
195495
+# icmp code 1 icmp type 2
195495
+[
195495
+    {
195495
+        "match": {
195495
+            "left": {
195495
+                "payload": {
195495
+                    "field": "type",
195495
+                    "protocol": "icmp"
195495
+                }
195495
+            },
195495
+            "op": "==",
195495
+            "right": 2
195495
+        }
195495
+    },
195495
+    {
195495
+        "match": {
195495
+            "left": {
195495
+                "payload": {
195495
+                    "field": "code",
195495
+                    "protocol": "icmp"
195495
+                }
195495
+            },
195495
+            "op": "==",
195495
+            "right": "host-unreachable"
195495
+        }
195495
+    }
195495
+]
195495
+
195495
diff --git a/tests/py/ip/icmp.t.payload.ip b/tests/py/ip/icmp.t.payload.ip
195495
index d75d12a061252..97464a08379e3 100644
195495
--- a/tests/py/ip/icmp.t.payload.ip
195495
+++ b/tests/py/ip/icmp.t.payload.ip
195495
@@ -787,3 +787,9 @@ ip test-ip4 input
195495
   [ lookup reg 1 set __set%d ]
195495
   [ immediate reg 0 accept ]
195495
 
195495
+# icmp code 1 icmp type 2
195495
+ip 
195495
+  [ meta load l4proto => reg 1 ]
195495
+  [ cmp eq reg 1 0x00000001 ]
195495
+  [ payload load 2b @ transport header + 0 => reg 1 ]
195495
+  [ cmp eq reg 1 0x00000102 ]
195495
diff --git a/tests/py/ip6/icmpv6.t b/tests/py/ip6/icmpv6.t
195495
index 8b411a8bf4392..d07c34bd939dc 100644
195495
--- a/tests/py/ip6/icmpv6.t
195495
+++ b/tests/py/ip6/icmpv6.t
195495
@@ -92,3 +92,5 @@ icmpv6 max-delay {33, 55, 67, 88};ok
195495
 icmpv6 max-delay != {33, 55, 67, 88};ok
195495
 icmpv6 max-delay {33-55};ok
195495
 icmpv6 max-delay != {33-55};ok
195495
+
195495
+icmpv6 type parameter-problem icmpv6 code no-route;ok
195495
diff --git a/tests/py/ip6/icmpv6.t.json b/tests/py/ip6/icmpv6.t.json
195495
index f6cfbf172f562..be2f1b462bb18 100644
195495
--- a/tests/py/ip6/icmpv6.t.json
195495
+++ b/tests/py/ip6/icmpv6.t.json
195495
@@ -1300,3 +1300,47 @@
195495
     }
195495
 ]
195495
 
195495
+# icmpv6 type packet-too-big icmpv6 mtu 1280
195495
+[
195495
+    {
195495
+        "match": {
195495
+            "left": {
195495
+                "payload": {
195495
+                    "field": "mtu",
195495
+                    "protocol": "icmpv6"
195495
+                }
195495
+            },
195495
+            "op": "==",
195495
+            "right": 1280
195495
+        }
195495
+    }
195495
+]
195495
+
195495
+# icmpv6 type parameter-problem icmpv6 code no-route
195495
+[
195495
+    {
195495
+        "match": {
195495
+            "left": {
195495
+                "payload": {
195495
+                    "field": "type",
195495
+                    "protocol": "icmpv6"
195495
+                }
195495
+            },
195495
+            "op": "==",
195495
+            "right": "parameter-problem"
195495
+        }
195495
+    },
195495
+    {
195495
+        "match": {
195495
+            "left": {
195495
+                "payload": {
195495
+                    "field": "code",
195495
+                    "protocol": "icmpv6"
195495
+                }
195495
+            },
195495
+            "op": "==",
195495
+            "right": "no-route"
195495
+        }
195495
+    }
195495
+]
195495
+
195495
diff --git a/tests/py/ip6/icmpv6.t.payload.ip6 b/tests/py/ip6/icmpv6.t.payload.ip6
195495
index 171b7eade6d3e..448779d16922c 100644
195495
--- a/tests/py/ip6/icmpv6.t.payload.ip6
195495
+++ b/tests/py/ip6/icmpv6.t.payload.ip6
195495
@@ -682,3 +682,10 @@ ip6 test-ip6 input
195495
   [ payload load 2b @ transport header + 4 => reg 1 ]
195495
   [ lookup reg 1 set __set%d 0x1 ]
195495
 
195495
+# icmpv6 type parameter-problem icmpv6 code no-route
195495
+ip6 
195495
+  [ meta load l4proto => reg 1 ]
195495
+  [ cmp eq reg 1 0x0000003a ]
195495
+  [ payload load 2b @ transport header + 0 => reg 1 ]
195495
+  [ cmp eq reg 1 0x00000004 ]
195495
+
195495
-- 
195495
2.31.1
195495