]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: rename and move bitwise test-cases
authorJeremy Sowden <jeremy@azazel.net>
Fri, 17 Mar 2023 09:16:50 +0000 (10:16 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 28 Mar 2023 08:26:34 +0000 (10:26 +0200)
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>
tests/shell/testcases/bitwise/0040mark_binop_0 [moved from tests/shell/testcases/chains/0040mark_shift_0 with 68% similarity]
tests/shell/testcases/bitwise/0040mark_binop_1 [moved from tests/shell/testcases/chains/0040mark_shift_1 with 70% similarity]
tests/shell/testcases/bitwise/dumps/0040mark_binop_0.nft [moved from tests/shell/testcases/chains/dumps/0040mark_shift_0.nft with 58% similarity]
tests/shell/testcases/bitwise/dumps/0040mark_binop_1.nft [moved from tests/shell/testcases/chains/dumps/0040mark_shift_1.nft with 64% similarity]

similarity index 68%
rename from tests/shell/testcases/chains/0040mark_shift_0
rename to tests/shell/testcases/bitwise/0040mark_binop_0
index ef3dccfa049aea7964852c191a000e71cde36f5e..4280e33ac45a3750c966e27e9016e0dc09cd1752 100755 (executable)
@@ -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
 "
 
similarity index 70%
rename from tests/shell/testcases/chains/0040mark_shift_1
rename to tests/shell/testcases/bitwise/0040mark_binop_1
index b609f5ef10ad73dc91399fbdf528e2dc7dee9327..7e71f3eb43a8d40590cc6643230a12852dd13712 100755 (executable)
@@ -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
 "
 
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 52d59d2c6da4d7aaa894e087137dacefefa9f601..fc0a600a4dbede3bd34c3ceab51885b6ab8b1aed 100644 (file)
@@ -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
        }
 }
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 56ec8dc766cab80da8cce6fe45deb083da9be7ad..dbaacefb93c7eac21f5eff9f291f9aa7f5de0344 100644 (file)
@@ -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
        }
 }