Skip to contentSkip to conversation

tests: shell: check if kernel supports for cgroupsv2 matching

PATCH New Pablo Neira Ayuso 1 participant 1 message May 20, 2025 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 tests: shell: check if kernel supports for cgroupsv2 matching

Update packetpath/cgroupv2 to skip it if kernel does not support it.

---
 tests/shell/features/cgroupsv2.nft        | 7 +++++++
 tests/shell/testcases/packetpath/cgroupv2 | 1 +
 2 files changed, 8 insertions(+)
 create mode 100644 tests/shell/features/cgroupsv2.nft
tests/shell/features/cgroupsv2.nft new file +7 -0
new file mode 100644
index 000000000000..b6a3869dbe89
@@ -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
+	}
+}
tests/shell/testcases/packetpath/cgroupv2 +1 -0
index 65916e9db1e8..0a6199fee91f 100755
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 # NFT_TEST_REQUIRES(NFT_TEST_HAVE_socat)
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_cgroupsv2)
 
 doit="$1"
 rc=0
Signature · 1 line
2.30.2