linux/tools/testing/selftests/cgroup
Shaojie Sun 2d19207f3f selftests/cgroup: Remove redundant chown in test_cgcore_lesser_ns_open
test_cgcore_lesser_ns_open runs as root throughout and never changes its
euid, so chowning the two cgroup.procs files to a non-root uid has no
effect on the test.

The ENOENT the test expects comes from the cgroup namespace delegation
check in cgroup_procs_write_permission(): the source and destination
cgroups must both be descendants of the namespace root captured at open
time.  That check does not depend on file ownership.  In addition, the
permission check only examines the common ancestor's cgroup.procs file
(the test root here), which the chown calls do not touch.

Remove the redundant chown calls and the now unused test_euid and
cg_test_a_procs variables.

Signed-off-by: Shaojie Sun <sunshaojie@kylinos.cn>
Reviewed-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
History 2026-08-14 08:32:58 -10:00
..
lib selftests/cgroup: Adjust cpu test duration based on HZ 2026-06-29 08:52:56 -10:00
.gitignore selftests: cgroup: Add basic tests for pids controller 2024-05-26 08:45:10 -10:00
config mm: remove CONFIG_MEMCG_KMEM 2024-07-10 12:14:54 -07:00
Makefile cgroup: selftests: Move cgroup_util into its own library 2025-05-16 11:45:15 -07:00
memcg_protection.m selftests: memcg: adjust expected reclaim values of protected cgroups 2022-05-27 09:33:45 -07:00
test_core.c selftests/cgroup: Remove redundant chown in test_cgcore_lesser_ns_open 2026-08-14 08:32:58 -10:00
test_cpu.c selftests/cgroup: add user_usec sanity check in test_cpucg_nice 2026-08-02 09:50:55 -10:00
test_cpuset.c selftests/cgroup: Fix minor defects in test_cpuset 2026-07-17 12:12:44 -10:00
test_cpuset_prs.sh selftests/cgroup: Preserve CPU hotplug write errors 2026-08-13 07:07:34 -10:00
test_cpuset_v1_base.sh selftests/cgroup: Fix string comparison in write_test 2026-05-10 15:54:12 -10:00
test_cpuset_v1_hp.sh selftests/cgroup: Avoid awk -e in cpuset tests 2026-08-10 09:28:03 -10:00
test_freezer.c mm.git review status for mm-hotfixes-stable..mm-stable 2026-06-19 10:14:34 -07:00
test_hugetlb_memcg.c selftests/cgroup: fix missing TAP output in test_hugetlb_memcg 2026-07-14 11:42:10 -10:00
test_kill.c selftests/cgroup: Don't require synchronous populated update on task exit 2026-03-24 10:21:57 -10:00
test_kmem.c selftests/cgroup: include slab in test_percpu_basic memory check 2026-05-28 21:05:07 -07:00
test_memcontrol.c mm.git review status for mm-hotfixes-stable..mm-stable 2026-06-19 10:14:34 -07:00
test_pids.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
test_stress.sh kseltest/cgroup: Make test_stress.sh work if run interactively 2022-05-13 09:33:21 -10:00
test_zswap.c selftests/cgroup: test_zswap: wait for asynchronous writeback 2026-05-28 21:04:47 -07:00
wait_inotify.c kselftest/cgroup: Add cpuset v2 partition root state test 2022-09-04 10:47:28 -10:00
with_stress.sh selftests: cgroup: Run test_core under interfering stress 2019-10-07 07:11:54 -07:00