From ad8546da23ecdccf31f8a77c8d7906fefd569bf5 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Fri, 17 Mar 2023 10:16:50 +0100 Subject: tests: shell: rename and move bitwise test-cases 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 Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/bitwise/0040mark_binop_0 | 11 +++++++++++ tests/shell/testcases/bitwise/0040mark_binop_1 | 11 +++++++++++ tests/shell/testcases/bitwise/dumps/0040mark_binop_0.nft | 6 ++++++ tests/shell/testcases/bitwise/dumps/0040mark_binop_1.nft | 6 ++++++ tests/shell/testcases/chains/0040mark_shift_0 | 11 ----------- tests/shell/testcases/chains/0040mark_shift_1 | 11 ----------- tests/shell/testcases/chains/dumps/0040mark_shift_0.nft | 6 ------ tests/shell/testcases/chains/dumps/0040mark_shift_1.nft | 6 ------ 8 files changed, 34 insertions(+), 34 deletions(-) create mode 100755 tests/shell/testcases/bitwise/0040mark_binop_0 create mode 100755 tests/shell/testcases/bitwise/0040mark_binop_1 create mode 100644 tests/shell/testcases/bitwise/dumps/0040mark_binop_0.nft create mode 100644 tests/shell/testcases/bitwise/dumps/0040mark_binop_1.nft delete mode 100755 tests/shell/testcases/chains/0040mark_shift_0 delete mode 100755 tests/shell/testcases/chains/0040mark_shift_1 delete mode 100644 tests/shell/testcases/chains/dumps/0040mark_shift_0.nft delete mode 100644 tests/shell/testcases/chains/dumps/0040mark_shift_1.nft (limited to 'tests') diff --git a/tests/shell/testcases/bitwise/0040mark_binop_0 b/tests/shell/testcases/bitwise/0040mark_binop_0 new file mode 100755 index 00000000..4280e33a --- /dev/null +++ b/tests/shell/testcases/bitwise/0040mark_binop_0 @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +RULESET=" + add table t + add chain t c { type filter hook output priority filter; } + add rule t c oif lo ct mark set (meta mark | 0x10) << 8 +" + +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/bitwise/0040mark_binop_1 b/tests/shell/testcases/bitwise/0040mark_binop_1 new file mode 100755 index 00000000..7e71f3eb --- /dev/null +++ b/tests/shell/testcases/bitwise/0040mark_binop_1 @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +RULESET=" + add table t + 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 +" + +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/bitwise/dumps/0040mark_binop_0.nft b/tests/shell/testcases/bitwise/dumps/0040mark_binop_0.nft new file mode 100644 index 00000000..fc0a600a --- /dev/null +++ b/tests/shell/testcases/bitwise/dumps/0040mark_binop_0.nft @@ -0,0 +1,6 @@ +table ip t { + chain c { + type filter hook output priority filter; policy accept; + oif "lo" ct mark set (meta mark | 0x00000010) << 8 + } +} diff --git a/tests/shell/testcases/bitwise/dumps/0040mark_binop_1.nft b/tests/shell/testcases/bitwise/dumps/0040mark_binop_1.nft new file mode 100644 index 00000000..dbaacefb --- /dev/null +++ b/tests/shell/testcases/bitwise/dumps/0040mark_binop_1.nft @@ -0,0 +1,6 @@ +table ip t { + chain c { + type filter hook input priority filter; policy accept; + iif "lo" ct mark & 0x000000ff == 0x00000010 meta mark set ct mark >> 8 + } +} diff --git a/tests/shell/testcases/chains/0040mark_shift_0 b/tests/shell/testcases/chains/0040mark_shift_0 deleted file mode 100755 index ef3dccfa..00000000 --- a/tests/shell/testcases/chains/0040mark_shift_0 +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -RULESET=" - add table t - add chain t c { type filter hook output priority mangle; } - add rule t c oif lo ct mark set (meta mark | 0x10) << 8 -" - -$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/chains/0040mark_shift_1 b/tests/shell/testcases/chains/0040mark_shift_1 deleted file mode 100755 index b609f5ef..00000000 --- a/tests/shell/testcases/chains/0040mark_shift_1 +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -RULESET=" - add table t - add chain t c { type filter hook input priority mangle; } - add rule t c iif lo ct mark & 0xff 0x10 meta mark set ct mark >> 8 -" - -$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/chains/dumps/0040mark_shift_0.nft b/tests/shell/testcases/chains/dumps/0040mark_shift_0.nft deleted file mode 100644 index 52d59d2c..00000000 --- a/tests/shell/testcases/chains/dumps/0040mark_shift_0.nft +++ /dev/null @@ -1,6 +0,0 @@ -table ip t { - chain c { - type filter hook output priority mangle; 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/chains/dumps/0040mark_shift_1.nft deleted file mode 100644 index 56ec8dc7..00000000 --- a/tests/shell/testcases/chains/dumps/0040mark_shift_1.nft +++ /dev/null @@ -1,6 +0,0 @@ -table ip t { - chain c { - type filter hook input priority mangle; policy accept; - iif "lo" ct mark & 0x000000ff == 0x00000010 meta mark set ct mark >> 8 - } -} -- cgit v1.2.3