summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2025-05-20 01:59:06 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2025-05-20 13:42:23 +0200
commitd94582cbcb3c9a76b81ceba69ef80a4735772893 (patch)
tree14c83f5b456f534ce33a17f646f34e49939ec62c
parentbce58907df15a51322a78b6cd154255f6edf9a3c (diff)
tests: shell: check if kernel supports for cgroupsv2 matching
Update packetpath/cgroupv2 to skip it if kernel does not support it. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--tests/shell/features/cgroupsv2.nft7
-rwxr-xr-xtests/shell/testcases/packetpath/cgroupv21
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/shell/features/cgroupsv2.nft b/tests/shell/features/cgroupsv2.nft
new file mode 100644
index 00000000..b6a3869d
--- /dev/null
+++ b/tests/shell/features/cgroupsv2.nft
@@ -0,0 +1,7 @@
+# e0bb96db96f8 ("netfilter: nft_socket: add support for cgroupsv2")
+# v5.13-rc1~94^2~35^2~20
+table ip t {
+ chain c {
+ socket cgroupv2 level 1 "user.slice" counter
+ }
+}
diff --git a/tests/shell/testcases/packetpath/cgroupv2 b/tests/shell/testcases/packetpath/cgroupv2
index 65916e9d..0a6199fe 100755
--- a/tests/shell/testcases/packetpath/cgroupv2
+++ b/tests/shell/testcases/packetpath/cgroupv2
@@ -1,6 +1,7 @@
#!/bin/bash
# NFT_TEST_REQUIRES(NFT_TEST_HAVE_socat)
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_cgroupsv2)
doit="$1"
rc=0