From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft,v2 7/8] tests: shell: rename and move bitwise test-cases
Date: Wed, 22 Mar 2023 22:53:02 +0100 [thread overview]
Message-ID: <20230322215303.239763-8-pablo@netfilter.org> (raw)
In-Reply-To: <20230322215303.239763-1-pablo@netfilter.org>
From: Jeremy Sowden <jeremy@azazel.net>
The `0040mark_shift_?` tests are testing not just shifts, but binops
more generally, so name them accordingly.
Move them to a new folder specifically for bitwise operations.
Change the priorities of the chains to match the type.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
.../{chains/0040mark_shift_0 => bitwise/0040mark_binop_0} | 2 +-
.../{chains/0040mark_shift_1 => bitwise/0040mark_binop_1} | 2 +-
.../0040mark_shift_0.nft => bitwise/dumps/0040mark_binop_0.nft} | 2 +-
.../0040mark_shift_1.nft => bitwise/dumps/0040mark_binop_1.nft} | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
rename tests/shell/testcases/{chains/0040mark_shift_0 => bitwise/0040mark_binop_0} (68%)
rename tests/shell/testcases/{chains/0040mark_shift_1 => bitwise/0040mark_binop_1} (70%)
rename tests/shell/testcases/{chains/dumps/0040mark_shift_0.nft => bitwise/dumps/0040mark_binop_0.nft} (58%)
rename tests/shell/testcases/{chains/dumps/0040mark_shift_1.nft => bitwise/dumps/0040mark_binop_1.nft} (64%)
diff --git a/tests/shell/testcases/chains/0040mark_shift_0 b/tests/shell/testcases/bitwise/0040mark_binop_0
similarity index 68%
rename from tests/shell/testcases/chains/0040mark_shift_0
rename to tests/shell/testcases/bitwise/0040mark_binop_0
index ef3dccfa049a..4280e33ac45a 100755
--- a/tests/shell/testcases/chains/0040mark_shift_0
+++ b/tests/shell/testcases/bitwise/0040mark_binop_0
@@ -4,7 +4,7 @@ set -e
RULESET="
add table t
- add chain t c { type filter hook output priority mangle; }
+ add chain t c { type filter hook output priority filter; }
add rule t c oif lo ct mark set (meta mark | 0x10) << 8
"
diff --git a/tests/shell/testcases/chains/0040mark_shift_1 b/tests/shell/testcases/bitwise/0040mark_binop_1
similarity index 70%
rename from tests/shell/testcases/chains/0040mark_shift_1
rename to tests/shell/testcases/bitwise/0040mark_binop_1
index b609f5ef10ad..7e71f3eb43a8 100755
--- a/tests/shell/testcases/chains/0040mark_shift_1
+++ b/tests/shell/testcases/bitwise/0040mark_binop_1
@@ -4,7 +4,7 @@ set -e
RULESET="
add table t
- add chain t c { type filter hook input priority mangle; }
+ add chain t c { type filter hook input priority filter; }
add rule t c iif lo ct mark & 0xff 0x10 meta mark set ct mark >> 8
"
diff --git a/tests/shell/testcases/chains/dumps/0040mark_shift_0.nft b/tests/shell/testcases/bitwise/dumps/0040mark_binop_0.nft
similarity index 58%
rename from tests/shell/testcases/chains/dumps/0040mark_shift_0.nft
rename to tests/shell/testcases/bitwise/dumps/0040mark_binop_0.nft
index 52d59d2c6da4..fc0a600a4dbe 100644
--- a/tests/shell/testcases/chains/dumps/0040mark_shift_0.nft
+++ b/tests/shell/testcases/bitwise/dumps/0040mark_binop_0.nft
@@ -1,6 +1,6 @@
table ip t {
chain c {
- type filter hook output priority mangle; policy accept;
+ type filter hook output priority filter; policy accept;
oif "lo" ct mark set (meta mark | 0x00000010) << 8
}
}
diff --git a/tests/shell/testcases/chains/dumps/0040mark_shift_1.nft b/tests/shell/testcases/bitwise/dumps/0040mark_binop_1.nft
similarity index 64%
rename from tests/shell/testcases/chains/dumps/0040mark_shift_1.nft
rename to tests/shell/testcases/bitwise/dumps/0040mark_binop_1.nft
index 56ec8dc766ca..dbaacefb93c7 100644
--- a/tests/shell/testcases/chains/dumps/0040mark_shift_1.nft
+++ b/tests/shell/testcases/bitwise/dumps/0040mark_binop_1.nft
@@ -1,6 +1,6 @@
table ip t {
chain c {
- type filter hook input priority mangle; policy accept;
+ type filter hook input priority filter; policy accept;
iif "lo" ct mark & 0x000000ff == 0x00000010 meta mark set ct mark >> 8
}
}
--
2.30.2
next prev parent reply other threads:[~2023-03-22 21:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 21:52 [PATCH nft,v2 0/8] mark statement support for non-constant expression Pablo Neira Ayuso
2023-03-22 21:52 ` [PATCH nft,v2 1/8] netlink_delinearize: correct type and byte-order of shifts Pablo Neira Ayuso
2023-03-22 21:52 ` [PATCH nft,v2 2/8] evaluate: support shifts larger than the width of the left operand Pablo Neira Ayuso
2023-03-22 21:52 ` [PATCH nft,v2 3/8] evaluate: don't eval unary arguments Pablo Neira Ayuso
2023-03-22 21:52 ` [PATCH nft,v2 4/8] evaluate: get length from statement instead of lhs expression Pablo Neira Ayuso
2023-03-22 21:53 ` [PATCH nft,v2 5/8] evaluate: relax type-checking for integer arguments in mark statements Pablo Neira Ayuso
2023-03-22 21:53 ` [PATCH nft,v2 6/8] tests: py: add test-cases for ct and packet mark payload expressions Pablo Neira Ayuso
2023-03-22 21:53 ` Pablo Neira Ayuso [this message]
2023-03-22 21:53 ` [PATCH nft,v2 8/8] tests: shell: " Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230322215303.239763-8-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox