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

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