Skip to contentSkip to conversation

tests: shell: use mount --bind to change cgroupsv2 root

PATCH New Pablo Neira Ayuso 1 participant 1 message Jan 16, 2025 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 tests: shell: use mount --bind to change cgroupsv2 root

Instead of remount which fails with SKIP in one of my test boxes because cgroupsv2 rootfs is busy.

---
 tests/shell/testcases/packetpath/cgroupv2 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/shell/testcases/packetpath/cgroupv2 +3 -1
index 20bd18ae3b4f..80a6c24c0817 100755
@@ -126,7 +126,7 @@ if [ "$doit" != "setup-done" ];then
 	rc=$?
 else
 	want_inode=$(stat --printf=%i "/sys/fs/cgroup/nft-test1a/")
-	mount -t cgroup2 cgroup2 /sys/fs/cgroup
+	mount --bind /sys/fs/cgroup/nft-test1a/ /sys/fs/cgroup/
 
 	# /sys/fs/cgroup/  should now match "/sys/fs/cgroup/nft-test1a/cgroup.procs"
 	rootinode=$(stat --printf=%i "/sys/fs/cgroup/")
@@ -138,6 +138,8 @@ else
 
 	do_initial_setup
 	run_test
+
+	umount --bind /sys/fs/group/
 fi
 
 exit $rc
Signature · 1 line
2.30.2