233 lines
5.0 KiB
Diff
233 lines
5.0 KiB
Diff
From 63408cb71377404ecc2584c5b2b83eccd405763d Mon Sep 17 00:00:00 2001
|
|
From: Phil Sutter <psutter@redhat.com>
|
|
Date: Fri, 17 Jul 2026 11:14:04 +0200
|
|
Subject: [PATCH] tests: py: Properly fix JSON equivalents for netdev/reject.t
|
|
|
|
JIRA: https://issues.redhat.com/browse/RHEL-190549
|
|
Upstream Status: nftables commit b7a11c691d459d06a801a28ae9a52bc564584a1a
|
|
|
|
commit b7a11c691d459d06a801a28ae9a52bc564584a1a
|
|
Author: Phil Sutter <phil@nwl.cc>
|
|
Date: Thu Jun 12 12:59:29 2025 +0200
|
|
|
|
tests: py: Properly fix JSON equivalents for netdev/reject.t
|
|
|
|
Revert commit d1a7b9e19fe65 ("tests: py: update netdev reject test
|
|
file"), the stored JSON equivalents were correct in that they matched
|
|
the standard syntax input.
|
|
|
|
In fact, we missed a .json.output file recording the expected deviation
|
|
in JSON output.
|
|
|
|
Fixes: d1a7b9e19fe65 ("tests: py: update netdev reject test file")
|
|
Fixes: 7ca3368cd7575 ("reject: Unify inet, netdev and bridge delinearization")
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
|
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
---
|
|
tests/py/netdev/reject.t.json | 66 +++++++++++++++--------
|
|
tests/py/netdev/reject.t.json.output | 81 ++++++++++++++++++++++++++++
|
|
2 files changed, 126 insertions(+), 21 deletions(-)
|
|
create mode 100644 tests/py/netdev/reject.t.json.output
|
|
|
|
diff --git a/tests/py/netdev/reject.t.json b/tests/py/netdev/reject.t.json
|
|
index 9968aaf..b80db03 100644
|
|
--- a/tests/py/netdev/reject.t.json
|
|
+++ b/tests/py/netdev/reject.t.json
|
|
@@ -130,17 +130,6 @@
|
|
|
|
# mark 12345 reject with tcp reset
|
|
[
|
|
- {
|
|
- "match": {
|
|
- "left": {
|
|
- "meta": {
|
|
- "key": "l4proto"
|
|
- }
|
|
- },
|
|
- "op": "==",
|
|
- "right": 6
|
|
- }
|
|
- },
|
|
{
|
|
"match": {
|
|
"left": {
|
|
@@ -162,30 +151,43 @@
|
|
# reject
|
|
[
|
|
{
|
|
- "reject": {
|
|
- "expr": "port-unreachable",
|
|
- "type": "icmpx"
|
|
- }
|
|
+ "reject": null
|
|
}
|
|
]
|
|
|
|
# meta protocol ip reject
|
|
[
|
|
{
|
|
- "reject": {
|
|
- "expr": "port-unreachable",
|
|
- "type": "icmp"
|
|
+ "match": {
|
|
+ "left": {
|
|
+ "meta": {
|
|
+ "key": "protocol"
|
|
+ }
|
|
+ },
|
|
+ "op": "==",
|
|
+ "right": "ip"
|
|
}
|
|
+ },
|
|
+ {
|
|
+ "reject": null
|
|
}
|
|
]
|
|
|
|
# meta protocol ip6 reject
|
|
[
|
|
{
|
|
- "reject": {
|
|
- "expr": "port-unreachable",
|
|
- "type": "icmpv6"
|
|
+ "match": {
|
|
+ "left": {
|
|
+ "meta": {
|
|
+ "key": "protocol"
|
|
+ }
|
|
+ },
|
|
+ "op": "==",
|
|
+ "right": "ip6"
|
|
}
|
|
+ },
|
|
+ {
|
|
+ "reject": null
|
|
}
|
|
]
|
|
|
|
@@ -231,6 +233,17 @@
|
|
|
|
# meta protocol ip reject with icmp host-unreachable
|
|
[
|
|
+ {
|
|
+ "match": {
|
|
+ "left": {
|
|
+ "meta": {
|
|
+ "key": "protocol"
|
|
+ }
|
|
+ },
|
|
+ "op": "==",
|
|
+ "right": "ip"
|
|
+ }
|
|
+ },
|
|
{
|
|
"reject": {
|
|
"expr": "host-unreachable",
|
|
@@ -241,6 +254,17 @@
|
|
|
|
# meta protocol ip6 reject with icmpv6 no-route
|
|
[
|
|
+ {
|
|
+ "match": {
|
|
+ "left": {
|
|
+ "meta": {
|
|
+ "key": "protocol"
|
|
+ }
|
|
+ },
|
|
+ "op": "==",
|
|
+ "right": "ip6"
|
|
+ }
|
|
+ },
|
|
{
|
|
"reject": {
|
|
"expr": "no-route",
|
|
diff --git a/tests/py/netdev/reject.t.json.output b/tests/py/netdev/reject.t.json.output
|
|
new file mode 100644
|
|
index 0000000..cbd7310
|
|
--- /dev/null
|
|
+++ b/tests/py/netdev/reject.t.json.output
|
|
@@ -0,0 +1,81 @@
|
|
+# mark 12345 reject with tcp reset
|
|
+[
|
|
+ {
|
|
+ "match": {
|
|
+ "left": {
|
|
+ "meta": {
|
|
+ "key": "l4proto"
|
|
+ }
|
|
+ },
|
|
+ "op": "==",
|
|
+ "right": 6
|
|
+ }
|
|
+ },
|
|
+ {
|
|
+ "match": {
|
|
+ "left": {
|
|
+ "meta": {
|
|
+ "key": "mark"
|
|
+ }
|
|
+ },
|
|
+ "op": "==",
|
|
+ "right": 12345
|
|
+ }
|
|
+ },
|
|
+ {
|
|
+ "reject": {
|
|
+ "type": "tcp reset"
|
|
+ }
|
|
+ }
|
|
+]
|
|
+
|
|
+# reject
|
|
+[
|
|
+ {
|
|
+ "reject": {
|
|
+ "expr": "port-unreachable",
|
|
+ "type": "icmpx"
|
|
+ }
|
|
+ }
|
|
+]
|
|
+
|
|
+# meta protocol ip reject
|
|
+[
|
|
+ {
|
|
+ "reject": {
|
|
+ "expr": "port-unreachable",
|
|
+ "type": "icmp"
|
|
+ }
|
|
+ }
|
|
+]
|
|
+
|
|
+# meta protocol ip6 reject
|
|
+[
|
|
+ {
|
|
+ "reject": {
|
|
+ "expr": "port-unreachable",
|
|
+ "type": "icmpv6"
|
|
+ }
|
|
+ }
|
|
+]
|
|
+
|
|
+# meta protocol ip reject with icmp host-unreachable
|
|
+[
|
|
+ {
|
|
+ "reject": {
|
|
+ "expr": "host-unreachable",
|
|
+ "type": "icmp"
|
|
+ }
|
|
+ }
|
|
+]
|
|
+
|
|
+# meta protocol ip6 reject with icmpv6 no-route
|
|
+[
|
|
+ {
|
|
+ "reject": {
|
|
+ "expr": "no-route",
|
|
+ "type": "icmpv6"
|
|
+ }
|
|
+ }
|
|
+]
|
|
+
|